001 ?
7FFF332CCFD8 ? 000000000 ?
......为了排版,后续省略......
打开跟踪文件,通常第一步做的是搜索第一个"Session Cursor Dump",当搜索它的时候,将看到如下的输出
-----
Session
Cursor Dump -----
Current
cursor: 2, pgadep=1
Open cursors(pls, sys, hwm,
max): 3(1, 1, 64, 1000)
NULL=0 SYNTAX=0 PARSE=0 BOUND=3
FETCH=0
ROW=0
Cached frame pages(total,
free):
4k(11, 8), 8k(0, 0), 16k(0, 0), 32k(0, 0)
-----
Current
Cursor -----
xsc=0x7f5227898580 ctx=0xf92d7aa8 pgactx=0xf92d7aa8 ctxcbk=0xf92d74f8 ctxqbc=(nil) ctxrws=0x10293a4c0
-----
Explain Plan Dump -----
----- Compact Format (Stream) -----
Dumping stream
from 0
to 22
----------------------------------
0000: 143 137 23 1 1 0 105 0 0 0 1 0 0 0 0 21 9 4 6 7 ......i.............
0020: 0 142 ..
----- Plan
Table -----
============
Plan
Table
============
--------------------------------------------+-----------------------------------+
| Id |
Operation |
Name |
Rows | Bytes | Cost |
Time |
--------------------------------------------+-----------------------------------+
| 0 |
INSERT
STATEMENT | | | | 1 | |
| 1 |
LOAD
TABLE CONVENTIONAL | | | | | |
--------------------------------------------+-----------------------------------+
Content
of other_xml
column
===========================
db_version : 11.2.0.1
parse_schema : DBMON
plan_hash : 0
plan_hash_2 : 0
Compilation Environment Dump
optimizer_mode_hinted =
false
optimizer_features_hinted = 0.0.0
parallel_execution_enabled =
true
parallel_query_forced_dop = 0
......为了排版,后续省略......
我们可以发现如下有用的内容
Current cursor: 2,这个告诉我们在这个会话的UGA打开的cursor中,当前正在执行Cursor# 6 游标
the pgadep:1变量告诉我们PGA depth,也就是这个查询执行的递归的深度
如果pgadep为0,它意味着这个查询是一个top-level查询,正在被用户或者应用通过OCI接口在执行。 pgadep为1,意味着它是一个递归的查询,通过递归程序接口(RPI)来执行,可能是数据字典查询或者仅仅通过PL/SQL调用执行的SQL。 所以,能够发现当前正在执行的当前查询的绑定变量值,我们需要做的是在trace file中朝前搜索Cursor2#,如下 注意:这个搜索词是大小写敏感的。
Cursor#2(0x7f5227951aa0)
state=BOUND curiob=0x7f5227898580
curflg=cd fl2=0 par=(nil) ses=0x129a8edc0
----- Dump
Cursor sql_id=b8n03s73k7d39 xsc=0x7f5227898580 cur=0x7f5227951aa0 -----
LibraryHandle: Address=f68ce8d8 Hash=c723b469 LockMode=N PinMode=0 LoadLockMode=0 Status=VALD
ObjectName:
Name=
INSERT INTO DH_T
VALUES (:B2 ,:B1 )
FullHashValue=38f6bac85b76f427b45003c1c723b469 Namespace=
SQL AREA(00)
Type=
CURSOR(00) Identifier=3341005929 OwnerIdn=148
Statistics: InvalidationCount=0 ExecutionCount=1 LoadCount=2 ActiveLocks=1 TotalLockCount=1 TotalPinCount=1
Counters: BrokenCount=1 RevocablePointer=1 KeepDependency=1 KeepHandle=1 BucketInUse=0 HandleInUse=0
Concurrency: DependencyMutex=f68ce988(0, 1, 0, 0) Mutex=f68cea00(61, 19, 0, 6)
Flags=RON/PIN/TIM/PN0/DBN/[10012841]
WaitersLists:
Lock=f68ce968[f68ce968,f68ce968]
Pin=f68ce978[f68ce948,f68ce948]
Timestamp:
Current=07-01-2014 11:16:35
LibraryObject: Address=f6b87d18 HeapMask=0000-0001-0001 Flags=EXS[0000] Flags2=[0000] PublicFlags=[0000]
ChildTable:
size='16'
Child: id='0'
Table=f6b88bc8 Reference=f6b88668 Handle=fab7b4c0
Children:
Child: childNum='0'
LibraryHandle: Address=fab7b4c0 Hash=0 LockMode=N PinMode=S LoadLockMode=0 Status=VALD
Name: Namespace=
SQL AREA(00)
Type=
CURSOR(00)
Statistics: InvalidationCount=0 ExecutionCount=1 LoadCount=1 ActiveLocks=1 TotalLockCount=1 TotalPinCount=2
Counters: BrokenCount=1 RevocablePointer=1 KeepDepende |