We have created one application. If USER1_ runs this application, then it will execute some set of procedures,packages with the hardcoded USER2_ credentials in that application. Due to this process execution few tables(let us say TABLE1_) is getting updated.
Now my problem is, I want to know the details of USER1. i.e who ran the application.
For this I have tried the below option,
1. Created a trigger on table TABLE1
2. by using 'user' keyword I tried to capture the user credentials.
But, since that updation of table is taking place with the help of hard-coded USER2 credentials, i am getting ouptut as USER2.
Since USER2 credentials is used for session, trigger will always get 'user' as user2.. you can make a procedure to update the table, When running as user1 with user2 credentials pass 'user1' as a parameter to the procedure.