Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sys log trigger check each instance ID in cluster database

592815Dec 14 2011 — edited Dec 14 2011
Hi Experts,

I copied a only audit sys log trigger code that is for a single instance database. We have a 3 nodes (instances) cluster database.

As I know session ID value can be duplicate in each instance in cluster database. How can we get a log audit information for each instance?

I declared v_INST_ID sys.gv_$session.INST_ID%TYPE; how do I get a instance ID ? USERENV('INST_ID')?

SELECT username, machine, command ,INST_ID
INTO v_username, v_machine, v_command,v_INST_ID
FROM sys.gv_$session
WHERE audsid = USERENV('SESSIONID')
AND audsid != 0 -- Don't Check SYS Connections
AND ROWNUM = 1
AND INST_ID= what? or USERENV('INST_ID')?

I have a 10GR2 3 nodes cluster database.

Thanks for help!

Jin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 11 2012
Added on Dec 14 2011
2 comments
524 views