V$seesion_longops視圖中記錄了長時間(運行時間超過6秒的)運行的事物,一般很多情況是全表掃描操作。
V$SESSION_LONGOPS列說明
SID:Session標識
SERIAL#:Session串號
OPNAME:操作簡要說明
TARGET:操作運行所在的對象
TARGET_DESC:目標對象說明
SOFAR:至今爲止完成的工作量
TOTALWORK:總工作量
UNITS:工作量單位
START_TIME:操作開始時間
LAST_UPDATE_TIME:統計項最後更新時間
TIME_REMAINING:預計完成操作的剩餘時間(秒)
ELAPSED_SECONDS:從操作開始總花費時間(秒)
CONTEXT:前後關係
MESSAGE:統計項的完整描述
USERNAME:執行操作的用戶ID
SQL_ADDRESS:用於連接查詢的列
SQL_HASH_VALUE:用於連接查詢的列
SERIAL#:Session串號
OPNAME:操作簡要說明
TARGET:操作運行所在的對象
TARGET_DESC:目標對象說明
SOFAR:至今爲止完成的工作量
TOTALWORK:總工作量
UNITS:工作量單位
START_TIME:操作開始時間
LAST_UPDATE_TIME:統計項最後更新時間
TIME_REMAINING:預計完成操作的剩餘時間(秒)
ELAPSED_SECONDS:從操作開始總花費時間(秒)
CONTEXT:前後關係
MESSAGE:統計項的完整描述
USERNAME:執行操作的用戶ID
SQL_ADDRESS:用於連接查詢的列
SQL_HASH_VALUE:用於連接查詢的列
本系統查詢如下:
1.查詢v$seesion_longops視圖,發現23點時有個session執行時間爲27秒
select sid,serial#,target ,last_update_time,SQL_HASH_VALUE from v$session_longops order by last_update_time;
SID SERIAL# TARGET LAST_UPDATE_TIME SQL_HASH_VALUE
-------------------------------------------------------------------
39 2038 ITSM.ITSM_INCIDENT 2011/10/26 23:30 1640565597
2.通過v$sqltext視圖查出該sql語句
SQL> select sql_text from v$sqltext where hash_value='1640565597' order by piece;
SQL_TEXT
----------------------------------------------------------------
SELECT /*+NESTED_TABLE_GET_REFS+*/ "ITSM"."ITSM_INCIDENT".* FROM
"ITSM"."ITSM_INCIDENT"
3.查metalink:
This hint specifies that nested tables should be retrieved as refs.It is used for exporting, importing and loading. It should never be issued by
user queries, and in fact is unlikely to make a difference if tried.This is also consistent with seeing large amounts of queries with this hint, and that those queries are not reused. If this is a problem for you, try to export at another time of day. If the exports are really long-running or the system load is constant, try to find out what you are using exports for and suggest alternatives (eg. backup and recovery purposes, etc). If this is a DSS system, you probably have a smaller shared pool and use import/export heavily. If so, it might be a good idea to use a bigger shared pool when doing this activity. 該hint用於expimp的嵌套表,想起該庫每天晚上23點半要自動exp備份。
user queries, and in fact is unlikely to make a difference if tried.This is also consistent with seeing large amounts of queries with this hint, and that those queries are not reused. If this is a problem for you, try to export at another time of day. If the exports are really long-running or the system load is constant, try to find out what you are using exports for and suggest alternatives (eg. backup and recovery purposes, etc). If this is a DSS system, you probably have a smaller shared pool and use import/export heavily. If so, it might be a good idea to use a bigger shared pool when doing this activity. 該hint用於expimp的嵌套表,想起該庫每天晚上23點半要自動exp備份。
©著作權歸作者所有:來自51CTO博客作者kankanhoney的原創作品,如需轉載,請註明出處,否則將追究法律責任
0
收藏