Today we will mainly introduce the Oracle database Viewing Article, which describes the statements being executed by the Session and how to execute the actual SQL statement. SQL for the Oracle database. . The following is an introduction to the text.
- SELECT b.sql_text, sid, serial#, osuser, machine
- FROM v$session a, v$sqlarea b
- WHERE a.sql_address = b.address;
Query the SQL statements issued by the front-end. SQL
- select user_name,sql_text
- from v$open_cursor
- where sid in
(select sid from (select sid,serial#,username,program from v$session where status='ACTIVE'));
Query sessions by SPID
- SELECT * FROM v$session WHERE paddr IN
(SELECT addr FROM v$process WHERE spid=&spid);
Query process by SID
- SELECT * FROM v$process WHERE addr IN
(SELECT paddr FROM v$session WHERE sid=&sid);
How does DBA query operations performed by other users? SQL
- SELECT sql_text
- FROM v$sql t1, v$session t2
- WHERE t1.address = t2.sql_address
- AND t2.sid = &sid;
The above content is an introduction to the Oracle database to view what SQL statements are being executed by a process. I hope you will get some benefits.