V$seesion_longops
视图
中记录了长时间(运行时间超过
6
秒的)运行的事物,一般很多情况是全表扫描操作。
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

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
:用于连接查询的列

本系统查询如下:

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

收藏

12篇文章,3W+人气,0粉丝