Home / Scripting / Oracle SQL – Nibbles

Oracle SQL – Nibbles

Below a selection of useful Oracle SQL scripts. If you want to audit a user or check the user grants these small scripts will help you

 

Audit User

Below an example SQL to display selected information about the Users with the first Name “John” from the Oracle table sys.dba_users

Audit User Grants

Below an example SQL to display all Privileges for a specific User. In my case the User John. Just change the name to the grantor you want to display. The script will lookup the table dab_tab_privs for the information.

Show the SQL that is currently ACTIVE

Ok with this little query you can display the SQL process that is currently actively running on your Oracle Database. In order to get this Information we want to query the table V$SESSION and look for the status Active and grabbing for each user the bytes from V$SQLTEXT