Now we need to dump the undo block to see
which
object was affected.
We noted
Step 2 that this is the active transaction (from the trace
):
TRN TBL
# uel scn dba
0x45 10 0x80 0x35b1b 0x0000 0x0695.3a0aba4d 0x1081e796
Dba----------------> Undo block containing the undo records
dba--->0x1081e796 is the block containing the active transaction .
Use the WebIV tools to convert this RDBA to block number (block
V SPLIT ==> DBA (Hex) = File
= ===== === ===== ============
V8 10,10 ==> 276948886 (0x1081e796) = 66,124822 (0x42 0x1e796)
So the
file
sql> Alter system dump datafile 66 block 124822;
This will generate a trace
in
the user_dump_dest. The following is a sample of the information
the undo block:
UNDO BLK:
xid: 0x000c.045.00035b1b
: 0x1e14 cnt: 0x17 irb: 0x17 icl: 0x0 flg: 0x0000
Rec Offset Rec Offset Rec Offset Rec Offset Rec Offset
---------------------------------------------------------------------------
0x01 0x1f8c 0x02 0x1f30 0x03 0x1ed4 0x04 0x1e78 0x05 0x1e1c
0x06 0x1dc0 0x07 0x1d64 0x08 0x1d08 0x09 0x1cac 0x0a 0x1c50
0x0b 0x1bf4 0x0c 0x1b98 0x0d 0x1b3c 0x0e 0x1ae0 0x0f 0x1a74
0x10 0x1a18 0x11 0x19bc 0x12 0x1960 0x13 0x1904 0x14 0x187c
0x15 0x181c 0x16 0x1798 0x17 0x173c
* Rec
* Layer: 11 (Row) opc: 1 rci 0x00
Undo
type
: Regular undo Begin trans Last buffer
split
: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000
*-----------------------------
uba: 0x1081e796.1e14.14 ctl max scn: 0x0695.38f69853 prv tx scn: 0x0695.38f698a1
KDO undo record:
KTB Redo
op
: 0x04 ver: 0x01
: L itl: scn: 0x0019.009.00034237 uba: 0x36c0cce4.1d2f.19
flg: C--- lkc: 0 scn: 0x0695.38f6b96b
KDO Op code: URP xtype: XA bdba: 0x35406893 hdba: 0x35406892
itli: 1 ispac: 0 maxfr: 4863
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 0 ckix: 0
ncol: 1 nnew: 1 size: -1
col 0: [ 4] c3 0e 36 2e
*-----------------------------
#0x17 slt: 0x45 objn: 1485619(0x0016ab33) objd: 1485619 tblspc: 71(0x00000047)
* Layer: 11 (Row) opc: 1 rci 0x16
: Regular undo Last buffer
: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000
*-----------------------------
above:
UNDO BLK:
: 0x1e14 cnt: 0x17 irb: 0x17 icl: 0x0 flg: 0x0000
The undo segment with the active transaction is segment is 0x000c (Hex)
is 12 (Dec) as the XID is:
Undo segment no + Slot no + Sequence no
This step is often skipped because it was performed earlier
step 3,however it is a good idea to
do
this
again now to
make
sure that the XID from the UNDO block matches the UNDO SEGMENT HEADER,
this way you have followed all the chain,from the UNDO SEGMENT to UNDO BLOCK,back and forth.
If there is a conflict here please check and
sure that the customer dumped the correct undo block.
Check
the value of irb
is an index
points you to the latest change
done
to the undo block.
This is the point from
a rollback would begin
one was issued.
we see:
'irb: 0x17'
so this points to record 0x17,
so search
this particular string i.e 0x17 and it will take you to undo record
'REC #0x17'
,e.g.:
#0x17 slt: 0x45 objn: 1485619(0x0016ab33) objd: 1485619 tblspc: 71(0x00000047)
* Layer: 11 (Row) opc: 1 rci 0x16
: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000
*-----------------------------
Note the slot number (slt) is 0x45,the object number (objn) is the OBJECT_ID from dba_objects
and data object number (objd) is the DATA_OBJECT_ID from dba_objects.
These numbers may be the same but not necessarily,and so
the database is
open
then
identify this object,e.g.:
select
object_name,owner,object_type,data_object_id from dba_objects where object_id = <objn>;
This is the object,
has an active transaction. Note
the above trace
extract that rci
has a value of 0x16
means that this record is at the end of an undo chain.
This means that the chain continues
another UNDO BLOCK.
Please refer to unpublished Note:281504.1
information on Undo chains.
So the next record that needs to be rolled back is present
REC
If rci is 0x00
it means that this is the first record present
the undo chain
and so you can check to see
there is rdba info,e.g.:
#0x16 slt: 0x45 objn: 1485619(0x0016ab33) objd: 1485619 tblspc: 71(0x00000047)
* Layer: 11 (Row) opc: 1 rci 0x00
: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000
*-----------------------------
uba: 0x1081e796.1e14.14 ctl max scn: 0x0695.38f69853 prv tx scn: 0x0695.38f698a1
KDO undo record:
KTB Redo
: 0x04 ver: 0x01
: L itl: scn: 0x0019.009.00034237 uba: 0x36c0cce4.1d2f.19
flg: C--- lkc: 0 scn: 0x0695.38f6b96b
KDO Op code: URP xtype: XA bdba: 0x35406893 hdba: 0x35406892
itli: 1 ispac: 0 maxfr: 4863
tabn: 0 slot: 0(0x0) flag: 0x2c lock: 0 ckix: 0
ncol: 1 nnew: 1 size: -1
col 0: [ 4] c3 0e 36 2e
*-----------------------------
If the object is an Index,drop and recreate it. If it is a table,
again the table would need to be dropped and recreated (or truncated)
so that its object number changes and hence the rollback
is no longer required.
If this isn't possible,monospace!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; line-height:1.1em!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; width:auto!important; direction:ltr!important; display:inline!important"> you have two options:
First take a backup of the database
its current state.
This is critical
in
case
anything goes wrong and you lose the opportunity to salvage the data!
Option 1
- Restore the undo segment datafile and the datafile containing the object and perform a full recovery.
This can only be
done
if
you have all the archived redo as you will need to
full recovery on these files.
OR
Option 2
If option 1 is not possible,you can use the unsupported method,e.g.:
Specify the undo segment
the _OFFLINE_ROLLBACK_SEGMENTS parameter and try to drop the rollback segment.
If there is an active transaction
this is not likely to work and you will probably need
to
the _CORRUPTED_ROLLBACK_SEGMENTS parameter as well