Because there are many ODU commands, especially the key unload commands, this article will briefly introduce the command sequence used for data recovery using ODU in several scenarios.
Scenario 1: The database cannot be started, but the data dictionary in the system tablespace is complete.
Generate data dictionary: unload dict
List users: list users
List all tables of a user: list table username
Restore table: unload table username. tablename
It can also be restored by user: unload user username
Scenario 2: The table is TRUNCATE.
Table space of the OFFLINE table
Generate data dictionary: unload dict
Display the table field header: desc username. tablename
Find the actual data object id: dump datafile file # block #
Scan data: scan extent
Restore table: unload table username. tablename object object_id
UPDATE:
Starting from version 3.0.7, it is more convenient to restore the Truncate table. You only need to perform the following steps:
Table space of the OFFLINE table
Generate data dictionary: unload dict
Scan data: scan extent
Restore table: unload table username. tablename object auto
Scenario 3: The table is dropped.
Table space of the OFFLINE table
Use logminer to mine the data object id of the drop table from the log. If the data object id cannot be mined, use scenario 4 below to restore the table.
Scan data: scan extent
If there is no table structure information, you need to automatically determine: unload object data_object_id sample
Restore table: unload object data_object_id column coltype...
Scenario 4: The system tablespace is damaged.
Scan data: scan extent
Search data: unload object all sample
Search for the required data from the result file sample.txt
Restore the required table: unload object data_object_id column coltype...
Scenario 5: The table data is deleted.
Set the parameter unload_deleted to YES.
Generate data dictionary: unload dict
Restore table: unload table username. tablename