Oracle8 BLOCKDUMPs ~~~~~~~~~~~~~~~~~~ Oracle7 BLOCKDUMPs: <> A 'blockdump' allows you to dump Oracles SYMBOLLIC interpretation of a block on the database. For indexes you may also want to look at <> Steps: ~~~~~~ 1. Determine the file and decimal block number of the block you want to dump. 2. Use the steps below to dump the block substituting the filename/number and block number/range: *From an SQL Session: ALTER SYSTEM DUMP DATAFILE {'filename'}|{filenumber} |---BLOCK MIN {blockno} BLOCK MAX {blockno}|--> | | |----BLOCK {blockno}-----------------------| Eg: ALTER SYSTEM DUMP DATAFILE 1 BLOCK 5586; ALTER SYSTEM DUMP DATAFILE 1 BLOCK MIN 5585 BLOCK MAX 5586; ALTER SYSTEM DUMP DATAFILE '/u01/oradata/MYDB/system01.dbf' BLOCK 98; *NOTE: - This command returns SUCCESS even when it sometimes fails. The failure message is written to the trace file. Eg: Dumping an invalid block number returns 'Statement processed'. - If you omit a BLOCK (or block range) the entire file is dumped !! (Up to <> ) - To use a {filenumber} the database MUST be OPEN and the file ONLINE. {filenumber} should be the absolute file number (not a relative no.). - If you use a 'filename' you can dump any datafile with the same blocksize, even one from a different database. The session you dump from must be at least a 'nomount' instance. Eg: startup nomount alter system dump datafile '/other/db/datafile.dbf' block 88; - This command returns SUCCESS even when it sometimes fails. The failure message is written to the trace file. 3. The trace should be in USER_DUMP_DEST (default $ORACLE_HOME/rdbms/log). (Even if USER_DUMP_DEST is set then in some cases output will still go to $ORACLE_HOME/rdbms/log so check both locations) 4. It is sometimes useful to get an OS blockdump also. *Disk dump (if block wont blockdump): Interpreting: <> VMS: DUMP/BLOCKS=(start:XXXX,end:YYYY)/out=dump.out dbfile.dbf VMS blocks=512 bytes. XXXX=OS block number UNIX: dd if=dbfile.dbf bs=2k skip={block} count=1 | od -x > dump.out ^^block size skip=n blocks to skip It is sometimes useful to dump the block BEFORE and AFTER the one required. Eg: skip={block}-1 count=3 NT: There is no tool shipped as standard. Suggestions include: MKS Toolkit (includes the 'dd' command as above) FileView (Shareware) HEdit (Shareware as referenced from Microsoft WWW Home Page) .