This content has been marked as final. Show 4 replies
You would have to execute the DBMS_APPLICATION_INFO.SET_ACTION package on the remote database, i.e.
Of course, I am assuming from your queries that the database link DB2 is configured to connect to the remote database as user USER1 (i.e. that you either specified that the database link use the CURRENT USER or that you specified a hard-coded user name of USER1). If the database link is not connecting to DB2 as USER1, then the query on DB2 against V$SESSION would need to be modified to look at sessions for the particular user the database link is using.
SQL> EXEC dbms_application_info.set_action@db2( 'Some Action' );
I had specified a hard-coded user name of USER1 in DB2 database link.
I tested your idea and below is what I got:
SQL> EXEC DBMS_APPLICATION_INFO.SET_ACTION('TEST ACTION')@db2 ;If you have any other idea that enables me to distinguish the session in DB2, I would appreciate it.
BEGIN DBMS_APPLICATION_INFO.SET_ACTION('TEST ACTION')@db2 ; END;
ERROR at line 1:
ORA-06550: line 1, column 54:
PLS-00103: Encountered the symbol "@" when expecting one of the following:
:= . ( % ;
ORA-06550: line 1, column 71:
PLS-00103: Encountered the symbol "END"