【遇到問題】v$session_longops視圖

V$seesion_longops視圖中記錄了長時間(運行時間超過6秒的)運行的事物,一般很多情況是全表掃描操作。

V$SESSION_LONGOPS列說明

SIDSession標識
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-LO(r[:XCO^s0user queries, and in fact is unlikely to make a difference if tried.
‑mE)i#c A,y5B
W0ITPUB
個人空間2KzT]
F?[1]Ij[:I t
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備份。

0

收藏

kankanhoney

12篇文章,2W+人氣,0粉絲

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章