Last active
November 17, 2016 18:19
-
-
Save vinicius-stutz/afd2945ec6300fcd586529fcdcc962de to your computer and use it in GitHub Desktop.
How to write an information in the V$SESSION table using the current user session in Oracle Database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* HOW TO WRITE AN INFORMATION IN THE V$SESSION TABLE USING THE | |
* CURRENT USER SESSION IN ORACLE DATABASE. | |
*/ | |
-- EXAMPLE OF RECORDING INFORMATION | |
BEGIN | |
DBMS_APPLICATION_INFO.SET_MODULE('ANY_ID', 'YOUR INFO HERE'); | |
END; | |
-- READING INFORMATION | |
SELECT S.OSUSER, S.MACHINE, S.PROGRAM, S.MODULE, S.ACTION | |
FROM V$SESSION S | |
WHERE S.MODULE = 'ANY_ID' | |
AND S.STATUS = 'ACTIVE'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment