楼主: grassbell

[精华] 关于索引(index)的中度理解,请指正!

[复制链接]
论坛徽章:
0
41#
发表于 2005-12-1 11:16 | 只看该作者
请问一下 按照版主的意思每个索引块最多可保存7ROWS(8K的数据块),但是我DUMP出来的索引块怎么不是这样的,每个块可以用几百行的ROWS-8k的数据块。

SQL> alter system dump datafile 24 block 29728;

Leaf block dump
===============
header address 4327297084=0x101ed503c
kdxcolev 0
kdxcolok 0
kdxcoopc 0x80: opcode=0: iot flags=--- is converted=Y
kdxconco 1
kdxcosdc 0
kdxconro 349   
kdxcofbo 734=0x2de
kdxcofeo 1561=0x619
kdxcoavs 827
kdxlespl 0
kdxlende 0
kdxlenxt 100693025=0x6007421
kdxleprv 100693023=0x600741f
kdxledsz 6
kdxlebksz 7840
row#0[7822] flag: -----, lock: 0, data6):  04 42 af 90 00 0c
col 0; len 9; (9):  c8 0c 05 08 06 03 07 32 08
row#1[7804] flag: -----, lock: 0, data6):  04 42 af 90 00 0d
col 0; len 9; (9):  c8 0c 05 08 06 03 07 32 09
row#2[7786] flag: -----, lock: 0, data6):  04 42 af 90 00 0e
col 0; len 9; (9):  c8 0c 05 08 06 03 07 32 0a
row#3[7768] flag: -----, lock: 0, data6):  04 42 af 90 00 0f
col 0; len 9; (9):  c8 0c 05 08 06 03 07 32 0b
row#4[7750] flag: -----, lock: 0, data6):  04 42 af 90 00 10
col 0; len 9; (9):  c8 0c 05 08 06 03 07 32 0c
.......
row#347[1579] flag: -----, lock: 0, data6):  04 42 af a4 00 0f
col 0; len 9; (9):  c8 0c 05 08 07 03 07 35 38
row#348[1561] flag: -----, lock: 0, data6):  04 42 af a4 00 10
col 0; len 9; (9):  c8 0c 05 08 07 03 07 35 39
----- end of leaf block dump -----
End dump data blocks tsn: 15 file#: 24 minblk 29728 maxblk 29728

从上可以看出总共该块中含349行的记录。如何解释,谢谢!

使用道具 举报

回复
论坛徽章:
0
42#
发表于 2005-12-4 22:19 | 只看该作者
楼上的兄弟,小弟是这么认为的:

1、row id是定位数据行在数据库中的位置,以迅速读取,是一个对象的物理信息。

2、object id是数据库内部识别一个对象的标志,是一个对象在数据库中的逻辑信息。

3、只有这个物理对象本身才知道如何将自己的逻辑信息和物理信息对应起来。

使用道具 举报

回复
论坛徽章:
0
43#
发表于 2005-12-4 22:27 | 只看该作者
oraclerain

你的列长度不对。

使用道具 举报

回复
论坛徽章:
0
44#
发表于 2005-12-5 11:17 | 只看该作者
以上DUMP出来的是一个LOCAL的主键的索引块信息,可以看出的是STRICT ROWID-少了32位的data_object_id#信息,我的疑问是为什么单个索引块的记录条数可以达到几百个,远不是楼主讲的7行记录,从其他非主键的索引块DUMP出来的信息也是这样的。谢谢!

使用道具 举报

回复
论坛徽章:
0
45#
发表于 2005-12-12 17:23 | 只看该作者
请楼主和版主出来释疑,谢!

使用道具 举报

回复
论坛徽章:
86
ITPUB元老
日期:2005-02-28 12:57:002012新春纪念徽章
日期:2012-01-04 11:49:542012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20咸鸭蛋
日期:2012-05-08 10:27:19版主8段
日期:2012-05-15 15:24:112013年新春福章
日期:2013-02-25 14:51:24
46#
发表于 2005-12-12 18:03 | 只看该作者
最初由 oraclerain 发布
[B]请楼主和版主出来释疑,谢! [/B]



SQL> create table t(x char(1024));



他的字段长度是1024 啊,在这个字段上面创建索引当然 8k 只能装7行。

使用道具 举报

回复
论坛徽章:
0
47#
发表于 2005-12-13 17:22 | 只看该作者
呵呵 谢谢

使用道具 举报

回复
论坛徽章:
47
马上加薪
日期:2014-02-19 11:55:142011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:502011新春纪念徽章
日期:2011-01-25 15:41:012010新春纪念徽章
日期:2010-03-01 11:20:512010年世界杯参赛球队:日本
日期:2010-02-26 11:04:222010新春纪念徽章
日期:2010-01-04 08:33:08祖国60周年纪念徽章
日期:2009-10-09 08:28:00生肖徽章2007版:牛
日期:2009-09-10 11:14:59
48#
发表于 2006-7-15 17:02 | 只看该作者
最初由 grassbell 发布
[B]1)索引的root,branch,leaf;

~~~Leaf~~~

[php]
SQL> create table t(x char(1024));

Table created.

SQL> create index ti on t(x);

Index created.

SQL> insert into t values(1);

1 row created.

SQL> commit;

Commit complete.

SQL> select file_id,extent_id,block_id,blocks from dba_extents where segment_name='TI';

   FILE_ID  EXTENT_ID   BLOCK_ID     BLOCKS
---------- ---------- ---------- ----------
         3          0        249          8

'BLOCK 250 开始存储索引的第一个leaf note'

SQL> alter system dump datafile 3 block 250;

System altered.
[/php]
'trace...'
kdxledsz 0
kdxlebksz 8036
row#0[7001] flag: -----, lock: 2
col 0; len 1024; (1024):  'indexed data value(1024B),第一个31代表1'
31 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
......
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
col 1; len 6; (6):  00 c0 00 da 00 00  'RowID(6B)'
----- end of leaf block dump -----

index leaf note每个entry有5列:
row header(3B)|length(1B)|indexed data value(1024B)|length(1B)|RowID(6B)
这样每个row的大小为:3+1+1024+1+6=1035
db_block_size=8192,
block的默认pct_free=10%,
所以每个block能存储7个rows:
[php]
SQL> select 8192*0.9/1035 from dual;

8192*0.9/1035
-------------
   7.12347826

'再插入6row的数据:'

SQL>begin
  2 for i in 2..7 loop
  3     insert into t values(i);
  4 end loop;
  5 end;
  6 /

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

SQL> ANALYZE INDEX TI VALIDATE STRUCTURE;

Index analyzed.

SQL> select btree_space,used_space,pct_used,blocks,lf_blks,br_blks from index_stats;

BTREE_SPACE USED_SPACE   PCT_USED     BLOCKS    LF_BLKS    BR_BLKS
----------- ---------- ---------- ---------- ---------- ----------
       8000       7259         91          8          1          0        '只有一个leaf note,没有branch note'

SQL> alter system dump datafile 3 block 250;

System altered.
[/php]
'trace...'
kdxlebksz 8036
row#0[7001] flag: -----, lock: 0
col 0; len 1024; (1024): '31代表1'
31 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
...
col 1; len 6; (6):  00 c0 00 da 00 00
row#1[5966] flag: -----, lock: 2
col 0; len 1024; (1024): '32代表2'
32 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
...
...
row#6[791] flag: -----, lock: 2
col 0; len 1024; (1024): '37代表7'
37 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
...
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
col 1; len 6; (6):  00 c0 00 da 00 06
----- end of leaf block dump ----- [/B]

请问怎么查看'trace...dump,如果它是文件,保存在什么目录

使用道具 举报

回复
论坛徽章:
16
ITPUB元老
日期:2006-08-12 12:42:51授权会员
日期:2006-08-12 12:36:09数据库板块每日发贴之星
日期:2006-11-19 01:03:11数据库板块每日发贴之星
日期:2007-04-23 01:05:28会员2007贡献徽章
日期:2007-09-26 18:42:10ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44BLOG每日发帖之星
日期:2008-06-29 01:02:22
49#
发表于 2006-7-17 20:51 | 只看该作者
这是我对create index的跟踪,其中有许多递归调用不太理解:(直接贴出,有点长,多包涵)
create index ind_test01_EMPNO01 ON TEST01(EMPNO01)


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.04          0          1          1           0
Execute      1      0.12       2.12       3949       6189        233           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.12       2.17       3949       6190        234           0

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 61  

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  db file scattered read                        264        0.01          0.60
  db file sequential read                        10        0.01          0.05
  control file sequential read                   57        0.01          0.27
  Data file init write                            6        0.00          0.00
  db file single write                            3        0.00          0.00
  control file parallel write                     9        0.00          0.00
  rdbms ipc reply                                 3        0.26          0.45
  direct path write                               6        0.00          0.00
  SQL*Net message to client                       1        0.00          0.00
  SQL*Net message from client                     1        0.00          0.00
********************************************************************************

select audit$,options
from
procedure$ where obj#=:1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        4      0.00       0.00          0          0          0           0
Execute      4      0.01       0.00          0          0          0           0
Fetch        4      0.00       0.00          0         12          0           4
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       12      0.01       0.00          0         12          0           4

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  TABLE ACCESS BY INDEX ROWID PROCEDURE$ (cr=3 pr=0 pw=0 time=26 us)
      1   INDEX UNIQUE SCAN I_PROCEDURE1 (cr=2 pr=0 pw=0 time=16 us)(object id 109)

********************************************************************************

select actionsize
from
trigger$ where obj# = :1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        4      0.00       0.00          0          0          0           0
Execute      4      0.00       0.00          0          0          0           0
Fetch        4      0.00       0.00          0          8          0           4
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       12      0.00       0.00          0          8          0           4

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=2 pr=0 pw=0 time=29 us)
      1   INDEX UNIQUE SCAN I_TRIGGER2 (cr=1 pr=0 pw=0 time=12 us)(object id 126)

********************************************************************************

select action#
from
trigger$ where obj# = :1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        4      0.00       0.00          0          0          0           0
Execute      4      0.01       0.00          0          0          0           0
Fetch        4      0.00       0.00          0         12          0           4
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       12      0.01       0.00          0         12          0           4

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=2 pr=0 pw=0 time=25 us)
      1   INDEX UNIQUE SCAN I_TRIGGER2 (cr=1 pr=0 pw=0 time=11 us)(object id 126)

********************************************************************************

select baseobject,type#,update$,insert$,delete$,refnewname,refoldname,
  whenclause,definition,enabled,property,sys_evts,nttrigcol,nttrigatt,
  refprtname,rowid
from
trigger$ where obj# =:1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        4      0.00       0.00          0          0          0           0
Execute      4      0.01       0.00          0          0          0           0
Fetch        4      0.00       0.00          0          8          0           4
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       12      0.01       0.00          0          8          0           4

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=2 pr=0 pw=0 time=28 us)
      1   INDEX UNIQUE SCAN I_TRIGGER2 (cr=1 pr=0 pw=0 time=11 us)(object id 126)

********************************************************************************

select tc.type#,tc.intcol#,tc.position#,c.type#, c.length,c.scale,
  c.precision#,c.charsetid,c.charsetform
from
triggercol$ tc,col$ c ,trigger$ tr where tc.obj#=:1 and c.obj#=:2 and
  tc.intcol#=c.intcol# and tr.obj# = tc.obj# and (bitand(tr.property,32) !=
  32 or bitand(tc.type#,20) = 20) union select type#,intcol#,position#,69,0,0,
  0,0,0 from triggercol$ where obj#=:3 and intcol#=1001 union select tc.type#,
  tc.intcol#,tc.position#,121,0,0,0,0,0 from triggercol$ tc,trigger$ tr where
  tr.obj# = tc.obj# and bitand(tr.property,32) = 32 and tc.obj# = :4 and
  bitand(tc.type#,20) != 20


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        4      0.01       0.00          0          0          0           0
Execute      4      0.03       0.00          0          0          0           0
Fetch        4      0.00       0.01          1         32          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       12      0.04       0.02          1         32          0           0

Misses in library cache during parse: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  SORT UNIQUE (cr=8 pr=1 pw=0 time=11054 us)
      0   UNION-ALL  (cr=8 pr=1 pw=0 time=11033 us)
      0    HASH JOIN  (cr=4 pr=0 pw=0 time=196 us)
      0     NESTED LOOPS  (cr=4 pr=0 pw=0 time=51 us)
      1      TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=2 pr=0 pw=0 time=33 us)
      1       INDEX UNIQUE SCAN I_TRIGGER2 (cr=1 pr=0 pw=0 time=15 us)(object id 126)
      0      TABLE ACCESS CLUSTER COL$ (cr=2 pr=0 pw=0 time=13 us)
      0       INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=0 pw=0 time=9 us)(object id 3)
      0     INDEX RANGE SCAN I_TRIGGERCOL2 (cr=0 pr=0 pw=0 time=0 us)(object id 128)
      0    INDEX RANGE SCAN I_TRIGGERCOL2 (cr=2 pr=1 pw=0 time=10787 us)(object id 128)
      0    NESTED LOOPS  (cr=2 pr=0 pw=0 time=28 us)
      0     TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=2 pr=0 pw=0 time=25 us)
      1      INDEX UNIQUE SCAN I_TRIGGER2 (cr=1 pr=0 pw=0 time=8 us)(object id 126)
      0     INDEX RANGE SCAN I_TRIGGERCOL2 (cr=0 pr=0 pw=0 time=0 us)(object id 128)


Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  db file sequential read                         1        0.01          0.01
********************************************************************************

insert into obj$(owner#,name,namespace,obj#,type#,ctime,mtime,stime,status,
  remoteowner,linkname,subname,dataobj#,flags,oid$,spare1,spare2)
values
(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16, :17)


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          1          6           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       0.00          0          1          6           1

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)
********************************************************************************

select file#
from
file$ where ts#=:1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse       10      0.00       0.00          0          0          0           0
Execute     10      0.01       0.00          0          0          0           0
Fetch       20      0.00       0.00          0         40          0          10
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       40      0.01       0.00          0         40          0          10

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  TABLE ACCESS FULL FILE$ (cr=4 pr=0 pw=0 time=41 us)

********************************************************************************

select distinct(-privilege#),nvl(option$,0)
from
sysauth$ where grantee#=:1 and privilege#<0


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        2      0.00       0.00          0          4          0           1
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        4      0.00       0.00          0          4          0           1

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  SORT UNIQUE (cr=4 pr=0 pw=0 time=112 us)
      1   TABLE ACCESS FULL SYSAUTH$ (cr=4 pr=0 pw=0 time=84 us)

********************************************************************************

select type#,blocks,extents,minexts,maxexts,extsize,extpct,user#,iniexts,
  NVL(lists,65535),NVL(groups,65535),cachehint,hwmincr, NVL(spare1,0),
  NVL(scanhint,0)
from
seg$ where ts#=:1 and file#=:2 and block#=:3


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        1      0.00       0.00          0          2          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3      0.00       0.00          0          2          0           0

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  TABLE ACCESS CLUSTER SEG$ (cr=2 pr=0 pw=0 time=22 us)
      0   INDEX UNIQUE SCAN I_FILE#_BLOCK# (cr=2 pr=0 pw=0 time=15 us)(object id 9)

********************************************************************************

select con#,obj#,rcon#,enabled,nvl(defer,0)
from
cdef$ where robj#=:1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      3      0.00       0.00          0          0          0           0
Fetch        3      0.00       0.00          0          3          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        7      0.00       0.00          0          3          0           0

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 2)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  TABLE ACCESS BY INDEX ROWID CDEF$ (cr=1 pr=0 pw=0 time=27 us)
      0   INDEX RANGE SCAN I_CDEF3 (cr=1 pr=0 pw=0 time=21 us)(object id 52)

********************************************************************************

select con#,type#,condlength,intcols,robj#,rcon#,match#,refact,nvl(enabled,0),
  rowid,cols,nvl(defer,0),mtime,nvl(spare1,0)
from
cdef$ where obj#=:1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      3      0.00       0.00          0          0          0           0
Fetch       41      0.00       0.00          0         82          0          38
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       45      0.00       0.00          0         82          0          38

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 2)

Rows     Row Source Operation
-------  ---------------------------------------------------
     16  TABLE ACCESS BY INDEX ROWID CDEF$ (cr=34 pr=0 pw=0 time=43 us)
     16   INDEX RANGE SCAN I_CDEF2 (cr=18 pr=0 pw=0 time=127 us)(object id 51)

********************************************************************************

select intcol#,nvl(pos#,0),col#,nvl(spare1,0)
from
ccol$ where con#=:1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute     38      0.00       0.00          0          0          0           0
Fetch       76      0.00       0.00          0        152          0          38
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total      115      0.00       0.00          0        152          0          38

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 2)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  TABLE ACCESS BY INDEX ROWID CCOL$ (cr=4 pr=0 pw=0 time=42 us)
      1   INDEX RANGE SCAN I_CCOL1 (cr=3 pr=0 pw=0 time=29 us)(object id 54)

********************************************************************************

insert into seg$ (file#,block#,type#,ts#,blocks,extents,minexts,maxexts,
  extsize,extpct,user#,iniexts,lists,groups,cachehint,bitmapranges,hwmincr,
  spare1, scanhint)
values
(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,0,:16,DECODE(:17,0,NULL,
  :17),:18)


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.01       0.00          0          0          0           0
Execute      1      0.00       0.00          0          3          7           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.01       0.00          0          3          7           1

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)
********************************************************************************

select file#, block#
from
seg$ where type# = 3 and ts# = :1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        6      0.00       0.00          0          0          0           0
Execute      6      0.00       0.00          0          0          0           0
Fetch       12      0.00       0.00          0         42          0           6
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       24      0.00       0.00          0         42          0           6

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  TABLE ACCESS CLUSTER SEG$ (cr=7 pr=0 pw=0 time=53 us)
      3   INDEX RANGE SCAN I_FILE#_BLOCK# (cr=3 pr=0 pw=0 time=27 us)(object id 9)

********************************************************************************

select obj#, type#, flags, related, bo, purgeobj, con#   
from
RecycleBin$    where ts#=:1 and to_number(bitand(flags, 16)) = 16    order
  by dropscn


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        6      0.00       0.00          0          0          0           0
Execute      6      0.00       0.00          0          0          0           0
Fetch        6      0.00       0.00          0          6          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       18      0.00       0.00          0          6          0           0

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  SORT ORDER BY (cr=1 pr=0 pw=0 time=37 us)
      0   TABLE ACCESS BY INDEX ROWID RECYCLEBIN$ (cr=1 pr=0 pw=0 time=22 us)
      0    INDEX RANGE SCAN RECYCLEBIN$_TS (cr=1 pr=0 pw=0 time=16 us)(object id 704)

********************************************************************************

update seg$ set type#=:4,blocks=:5,extents=:6,minexts=:7,maxexts=:8,extsize=
  :9,extpct=:10,user#=:11,iniexts=:12,lists=decode(:13, 65535, NULL, :13),
  groups=decode(:14, 65535, NULL, :14), cachehint=:15, hwmincr=:16, spare1=
  DECODE(:17,0,NULL,:17),scanhint=:18
where
ts#=:1 and file#=:2 and block#=:3


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        5      0.00       0.00          0          0          0           0
Execute      5      0.01       0.01          0         25          6           5
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       10      0.01       0.01          0         25          6           5

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  UPDATE  SEG$ (cr=5 pr=0 pw=0 time=246 us)
      1   TABLE ACCESS CLUSTER SEG$ (cr=5 pr=0 pw=0 time=111 us)
      1    INDEX UNIQUE SCAN I_FILE#_BLOCK# (cr=2 pr=0 pw=0 time=18 us)(object id 9)

********************************************************************************

select parttype, partcnt, partkeycols, flags, defts#, defpctfree, defpctused,
  definitrans, defmaxtrans, deftiniexts, defextsize, defminexts, defmaxexts,
  defextpct, deflists, defgroups, deflogging, spare1, mod(spare2, 256)
  subparttype, mod(trunc(spare2/256), 256) subpartkeycols,
  mod(trunc(spare2/65536), 65536) defsubpartcnt, mod(trunc(spare2/4294967296),
   256) defhscflags
from
partobj$ where obj# = :1


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        1      0.00       0.00          0          1          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3      0.00       0.00          0          1          0           0

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  TABLE ACCESS BY INDEX ROWID PARTOBJ$ (cr=1 pr=0 pw=0 time=19 us)
      0   INDEX UNIQUE SCAN I_PARTOBJ$ (cr=1 pr=0 pw=0 time=12 us)(object id 263)

********************************************************************************

select blocks,maxblocks,grantor#,priv1,priv2,priv3
from
tsq$ where ts#=:1 and user#=:2


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        1      0.00       0.00          0          2          0           1
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        3      0.00       0.00          0          2          0           1

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      1  TABLE ACCESS CLUSTER TSQ$ (cr=2 pr=0 pw=0 time=37 us)
      1   INDEX UNIQUE SCAN I_USER# (cr=1 pr=0 pw=0 time=14 us)(object id 11)

********************************************************************************

insert into icol$(obj#,bo#,intcol#,pos#,segcol#,segcollength,offset,col#,
  spare1,spare2)
values
(:1,:2,:3,:4,0,0,0,:5,:6,:7)


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          2          3           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       0.00          0          2          3           1

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)
********************************************************************************

insert into ind$(bo#,obj#,ts#,file#,block#,intcols,type#,flags,property,
  pctfree$,initrans,maxtrans,blevel,leafcnt,distkey,lblkkey,dblkkey,clufac,
  cols,analyzetime,samplesize,dataobj#,degree,instances,rowcnt,pctthres$,
  indmethod#,trunccnt,spare1,spare4,spare2,spare6)
values
(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,:18,:19,:20,:21,
  :22,decode(:23,1,null,:23),decode(:24,1,null,:24),:25, :32*256+:26,:27,:28,
  :29,:30,:31,:33)


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.01       0.00          0          0          0           0
Execute      1      0.00       0.00          0          2          3           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.01       0.01          0          2          3           1

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net break/reset to client                   2        0.00          0.00
  SQL*Net message to client                       1        0.00          0.00
  SQL*Net message from client                     1        0.00          0.00
********************************************************************************

update obj$ set obj#=:6,type#=:7,ctime=:8,mtime=:9,stime=:10,status=:11,
  dataobj#=:13,flags=:14,oid$=:15,spare1=:16, spare2=:17
where
owner#=:1 and name=:2 and namespace=:3 and(remoteowner=:4 or remoteowner is
  null and :4 is null)and(linkname=:5 or linkname is null and :5 is null)
  and(subname=:12 or subname is null and :12 is null)


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.01       0.00          0          2          1           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.01       0.00          0          2          1           1

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  UPDATE  OBJ$ (cr=2 pr=0 pw=0 time=143 us)
      1   INDEX RANGE SCAN I_OBJ2 (cr=2 pr=0 pw=0 time=34 us)(object id 37)

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
50#
发表于 2006-7-18 11:54 | 只看该作者
最初由 hotiice 发布
[B]
请问怎么查看'trace...dump,如果它是文件,保存在什么目录 [/B]


If you trace a user session (v$session.type='USER'), which is most likely the case, the trace file is in udump (user_dump_dest). If you trace a background session (v$session.type='BACKGROUND'), the trace file is in bdump. Normally you should never trace a background session.

Yong Huang

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表