|
再翻了下邮件,这个问题我之前好像碰到了。下面是当时我找到的语句。当时是在另一台DB服务器上,两台服务器功能一样的,我们是分布式。
oracle@bmpdb1a:~> ps -e -o flags,stat,user,pid,ppid,pcpu,vsize,cmd --sort -pcpu | head
F STAT USER PID PPID %CPU VSZ CMD
0 Ss oracle 21166 1 2.0 16996648 oracleora11g (LOCAL=NO)
0 Ds oracle 18517 1 16.1 17059568 ora_j000_ora11g
0 Ss oracle 21162 1 2.0 16996648 oracleora11g (LOCAL=NO)
0 Ss oracle 21158 1 3.0 16996644 oracleora11g (LOCAL=NO)
0 Ss oracle 21154 1 4.0 16996648 oracleora11g (LOCAL=NO)
0 Ds oracle 17580 1 4.2 16998172 oracleora11g (LOCAL=NO)
0 Ss oracle 17526 1 3.8 16998184 oracleora11g (LOCAL=NO)
0 Ss oracle 20710 1 1.6 16997200 oracleora11g (LOCAL=NO)
0 Ss oracle 3971 1 1.4 17001480 oracleora11g (LOCAL=NO)
操作系统进程ID=18517;
SQL> select a.machine, a.osuser, a.program, a.username,
SQL> a.sql_hash_value, a.last_call_et, b.SPID
2 from v$session a, v$process b
3 where status='ACTIVE'
4 and type='USER'
5 and a.paddr=b.addr
6 and b.spid=18517
7 order by last_call_et desc;
MACHINE OSUSER PROGRAM USERNAME SQL_HASH_VALUE LAST_CALL_ET SPID
---------------------------------------------------------------- ------------------------------ ------------------------------------------------ ------------------------------ -------------- ------------ ------------------------
bmpdb1a oracle oracle@bmpdb1a (J000) SYS 1294132239 772 18517
得到Hash_value=1294132239;
SQL> select sql_text from v$sqlarea where HASH_VALUE=1611294122;
SQL_TEXT
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/* SQL Analyze(1046,1) */ select /*+ full(t) no_parallel(t) no_parallel_index(t) dbms_stats cursor_sharing_exact use_weak_name_resl dynamic_sampling(0) no_monitoring */to_char(count("OPERTIME5")),to_char(substrb(dump(min("OPERTIME5"),16,0,32),1,120)),to_char(substrb(dump(max("OPERTIME5"),16,0,32),1,120)),to_char(count("SERVICEORDERFLAG5")),to_char(substrb(dump(min("SERVICEORDERFLAG5"),16,0,32),1,120)),to_char(substrb(dump(max("SERVICEORDERFLAG5"),16,0,32),1,120)),to_char(count("STATUS5")),to_char(substrb(dump(min("STATUS5"),16,0,32),1,120)),to_char(substrb(dump(max("STATUS5"),16,0,32),1,120)),to_char(count("SUSPENDTIME5")),to_char(substrb(dump(min("SUSPENDTIME5"),16,0,32),1,120)),to_char(substrb(dump(max("SUSPENDTIME5"),16,0,32),1,120)),to_char(count("ORDERTYPE1")),to_char(substrb(dump(min("ORDERTYPE1"),16,0,32),1,120)),to_char(substrb(dump(max("ORDERTYPE1"),16,0,32),1,120)),to_char(count("ORDERTYPE2")),to_char(substrb(dump(min("ORDERTYPE2"),16,0,32),1,120)),to_char(substrb(dump(max("O
――这语句是在做什么分析吧?? |
|