SELECT 'USERNAME :' || s.username || chr(10) || 'SCHEMA:' || s.schemaname || chr(10) || 'OSUSER:' || s.osuser || chr(10) || 'SPID:' || p.spid || chr(10) || 'SID:' || s.sid || chr(10) || 'SERIAL#:' || s.serial# || chr(10) || 'KILL STRING: ' || '''' || s.sid || ',' || s.serial# || '''' || chr(10) || 'MACHINE: ' || s.machine || chr(10) || 'TYPE:' || s.type || chr(10) || 'SQL_ID:' || q.sql_id || chr(10) || 'SQL_TEXT: ' || q.sql_text FROM v$session s, v$process p, v$sql q WHERE s.paddr = p.addr AND p.spid = '&PID_FROM_OS' AND s.sql_id = q.sql_id(+)
'USERNAME:'||S.USERNAME||CHR(10)||'SCHEMA:'||S.SCHEMANAME||CHR(10)||'OSUSER:'||S -------------------------------------------------------------------------------- USERNAME :RPT SCHEMA:RPT OSUSER:zed SPID:54657092 SID:1854 SERIAL#:35907 KILL STRING: '1854,35907' MACHINE: aix TYPE:USER SQL_ID:4wv8ms79s6m37 SQL_TEXT: SELECT '073000' AS TIMEKEY FROM DUAL 'USERNAME:'||S.USERNAME||CHR(10)||'SCHEMA:'||S.SCHEMANAME||CHR(10)||'OSUSER:'||S
成都创新互联专注于江口网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供江口营销型网站建设,江口网站制作、江口网页设计、江口网站官网定制、重庆小程序开发服务,打造江口网络公司原创品牌,更为您提供江口网站排名全网营销落地服务。
SQL> select * from table(dbms_xplan.display_cursor(('&sql_id')));
Enter value for sql_id: 4wv8ms79s6m37
old 1: select * from table(dbms_xplan.display_cursor(('&sql_id')))
new 1: select * from table(dbms_xplan.display_cursor(('4wv8ms79s6m37')))
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
SQL_ID 4wv8ms79s6m37, child number 0
-------------------------------------
SELECT '073000' AS TIMEKEY FROM DUAL
Plan hash value: 1546270724
-----------------------------------------------------------------
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
-----------------------------------------------------------------
| 0 | SELECT STATEMENT | | | 2 (100)| |
| 1 | FAST DUAL | | 1 | 2 (0)| 00:00:01 |
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
13 rows selected.
也可以通过另外一种方式
SQL> conn / as sysdba
Connected.
SQL> oradebug setospid 54657092
Oracle pid: 45, Unix process pid: 54657092, p_w_picpath: oracle@aix (TNS V1-V3)
SQL> oradebug current_sql;
SELECT '235959' AS TIMEKEY FROM DUAL
新闻名称:通过操作系统进程找到topsql信息
转载源于:http://scyingshan.cn/article/psiijd.html