Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6660326
  • 博文数量: 1005
  • 博客积分: 8199
  • 博客等级: 中将
  • 技术积分: 13071
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-25 20:19
个人简介

脚踏实地、勇往直前!

文章分类

全部博文(1005)

文章存档

2020年(2)

2019年(93)

2018年(208)

2017年(81)

2016年(49)

2015年(50)

2014年(170)

2013年(52)

2012年(177)

2011年(93)

2010年(30)

分类: Oracle

2012-01-05 15:05:25

步骤1:找到索引的Object_Id.
SQL> select object_id,object_name from dba_objects where owner='HXL';
 OBJECT_ID OBJECT_NAME
---------- ---------------------------------------------
     51786 IDX_TB_TEST_N1
 
步骤2:Tree Dump
alter session set events 'immediate trace name treedump level 51786'
 
步骤3:找到索引树的首地址
[oracle@hxl udump]$ more oracl_ora_2679.trc
/u01/app/oracle/admin/oracl/udump/oracl_ora_2679.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1
System name:    Linux
Node name:      hxl
Release:        2.6.9-42.0.0.0.1.ELhugemem
Version:        #1 SMP Sun Oct 15 14:06:18 PDT 2006
Machine:        i686
Instance name: oracl
Redo thread mounted by this instance: 1
Oracle process number: 18
Unix process pid: 2679, image:
(TNS V1-V3)
*** 2012-01-04 18:23:29.845
*** SERVICE NAME:(SYS$USERS) 2012-01-04 18:23:29.791
*** SESSION ID:(144.20) 2012-01-04 18:23:29.789
----- begin tree dump
branch: 0x1400494 20972692 (0: nrow: 2, level: 1)
   leaf: 0x1400497 20972695 (-1: nrow: 540 rrow: 540)
   leaf: 0x1400498 20972696 (0: nrow: 23 rrow: 23)
----- end tree dump
*** 2012-01-04 18:27:52.766
*** 2012-01-04 18:27:52.765 60679 kcrr.c
ARCH: Archival disabled due to shutdown: 1089
*** 2012-01-04 18:27:53.904 60679 kcrr.c
ARCH: Archival disabled due to shutdown: 1089
 
步骤4:通过首地址获取索引所在的快号
SELECT dbms_utility.data_block_address_file(to_number(ltrim('0x1400494',
                                                            '0x'),
                                                      'xxxxxxxx')) file#,
       dbms_utility.data_block_address_block(to_number(ltrim('0x1400494',
                                                             '0x'),
                                                       'xxxxxxxx')) block#
      FROM dual;
     FILE#     BLOCK#
---------- ----------
         5       1172
 
这里1172就是索引IDX_TB_TEST_N1所占用的起始数据块号.
阅读(3371) | 评论(0) | 转发(0) |
0

上一篇:B*Tree Index的dump

下一篇:在linux下安装vnc

给主人留下些什么吧!~~