Execution Environment: SQL, Sql*plus, isql*plusaccess privileges: Requires Select privileges on view V$sqltext, V$session and V$process. Usage: sqlplus/nolog sql> connect sys;/<password> sql> @sqltextInstructions: Copy the script into the file Sqltext.sql and execute it from Sql*plus connected as sys. Proofread this SCRIPT before USING it! Due to differences in the same-editors, e-mail packages, and operating systems handle text formatting (spaces, tabs, a ND carriage returns), this script is not being in a executable statewhen you first receive it. Check the script to ensure that errors ofthis type is corrected. |
|
Description |
The script displays the text of the SQL statements of the shared cursors in THESGA and information of the sessions Executi ng them. sql> @sqltextUnix PID OS User Oracle Us SID serial# sql_text----------------------------------------- ---------------------------------16995 lsupport SYS 7 */oracleoem */select value from v$ Sysstat ORDER by statistic#16999 Lsupport SYS for 6769/* oracleoem */select value from v$ Sesstat t where sid =: 1 |
|
References |
|
|
Script |
Set pagesize 66col C1 for A9col C1 heading ' OS User ' col C2 for A9col C2 heading ' Oracle User ' col B1 for A9col B1 heading ' Unix PID "Col B2 for 9999 justify Leftcol B2 heading" SID "Col B3 for 99999 justify Leftcol b3 heading" serial# "Col sql_text For A35break on B1 nodup on C1 nodup on C2 nodup on B2 nodup on B3 skip 3select c.spid B1, B.osuser C1, B.username C2, B. Sid B2, b.serial# b3,a.sql_text from v$sqltext A, v$session B, v$process c where a.address = b.sql_address--< C4/>and b.status = ' ACTIVE '/* CAN CHOOSE This OPTION is only to see-- actve TRANSACTION on that moment * /an D b.paddr = c.addr and A.hash_value = b.sql_hash_value ORDER by c.spid,a.hash_value,a.piece/ |
|
|
Disclaimer |
EXCEPT where expressly provided OTHERWISE, the information, Software,provided on a "as is" and "as AVAILABLE" BASIS. ORACLE expressly disclaimsall warranties of any KIND, WHETHER EXPRESS OR implied, including, but notlimited to, the Implie D warranties of merchantability, FITNESS for A Particularpurpose and Non-infringement. ORACLE makes NO WARRANTY that: (A) The resultsthat is obtained from the use of the software would be accurate ORRELIABL E or (B) the information, or other MATERIAL obtained would MEET yourexpectations. Any CONTENT, materials, information OR software downloaded Orotherwise obtained are done at YOUR OWN discretion and RISK. ORACLE shall Haveno RESPONSIBILITY for any DAMAGE to YOUR computer SYSTEM OR LOSS of DATA thatresults from the DOWNLOAD of Any CONTENT, materials, information OR software.
ORACLE reserves the changes OR UPDATES to the software at ANYTIME without NOTICE. |
|
Script to Monitor current User Activity in the Database