Saturday, June 30, 2012

Dumping Oracle data block


Getting Absolute File number and Block number of a rowid
select rowid,
       dbms_rowid.rowid_to_absolute_fno(rowid, 'MURTY', 'T1') "File no" ,
       dbms_rowid.rowid_block_number(rowid) "Block no"
from t1;

ROWID              File no      Block no
------------------ ---------- ----------
AAADaGAAEAAAACEAAA          4        132

Getting header block of a segment
select header_file, header_block
from   dba_segments
where  owner='MURTY'
and    segment_name = 'T1';

HEADER_FILE HEADER_BLOCK
----------- ------------
          4          130

Dumping a single block
alter system dump datafile 4 block 132;

Finding an extent start and end
select file_id, block_id, blocks
from   dba_extents
where  owner = 'MURTY'
and    segment_name = 'T1';

   FILE_ID   BLOCK_ID     BLOCKS
---------- ---------- ----------
         4        128          8

Dumping more than one block
alter system dump datafile 4 block min 128 block max 135;

No comments:

Post a Comment