Ukoug2012 Dude
Ukoug2012 Dude
Ukoug2012 Dude
• Author of DUDE
• Data Unloader tool (www.ora600.be)
What ?
How ?
Use Cases
Demo
Disclaimer
I don’t do blockdumps in this presentation
Crashed Running
instance instance
What are data unloaders ?
• What are you talking about ...
– unload data ?
– not in the sense of ETL
• Panic
• Cry
• Take up smoking again ...
• Call the wife – it’ll be long night ... Again ...
• Oracle support
– spend the next 30min trying to open a severity 1 SR
– *call* them
What are data unloaders ?
1. you’re screwed
datafile unloader
datafile unloader
• But how can we find the block containing the segment header ?
• Look it up in SEG$ (file#, block#) part of c_file#_block# !
What if
Fileheader is corrupt
Bootstrap$ is corrupt
Dictionary is corrupt
Segment header/extentmap is corrupt
Identifying datablocks
*THE BLOCKMAPPER ROUTINE*
1. Scan everyblock
2. Note down file#, offset#
3. Group by dataobjectid
4. For select number of blocktypes
Identifying datablocks
*THE BLOCKMAPPER ROUTINE*
DUDE> create blockmap for tablespace USERS ;
DUDE> ID := 0 BLOCKMAPPER for TABLESPACE NAME = USERS
OFFSET = 0
ASSM = true
BIGFILE = false
BLOCKSIZE = 2048
NUMBER = 11 FILENAME = c:\dudecase\users_01.dbf IBS = 2048
- Truncated tables
- Dropped tables
Identifying datablocks
DUDE> Done !
Scanning datablocks
1. LOB index
2. In-memory high version chunk hash
3. On-disk high version chunk hash
Yves 2 Lobid2,flags,length,header
Pierre 2 Lobid3,flags,length,header
Lobid1, dba1, dba2 Lobid3, dba1, dba2
Lobsegment
Direct accessable
portion
Lobid5, v1 Lobid5, v1
Lobid2, v0 Lobid4, v0 Lobid3, v1
Unloading LOBs
LOB index is special
[Lobid1,0], dba1
Lobid1, v0 Lobid2, v1
Lobid5, v1 Lobid5, v1
Lobid2, v0 Lobid4, v0 Lobid3, v1
Unloading LOBs
The reusable block/chunk list
[pctversion/retention]
New entry
[Lobid1,0], dba2 [timestamp,0], dba1
update
Lobid5, v1 Lobid5, v1
Lobid2, v0 Lobid4, v0 Lobid3, v1
Unloading LOBs
The reusable block/chunk list
[pctversion/retention]
Lobid5, v1 Lobid5, v1
Lobid2, v0 Lobid4, v0 Lobid3, v1
Unloading LOBs
Avoiding LOB index (corruption)
Downsides of in-memory hash
1. Time consuming
– blockmap all datafiles first
- Hashing
2. Resource consumption
Memory constraints
32bit java - ~2GB process memory
Unloading LOBs
Avoiding LOB index (corruption)
On-disk hashing
SLOWWWW!
Recovering from RAID5 Failure
Recovering from RAID5 Failure
• Customer case
DEMO TIME