DUL recovery simple table test
-1. Construct test data
SQL > alter database datafile'/ oracle/app/oracle/oradata/test/users01.dbf' resize 100m * from dba_objects;SQL > create table ducw.test_dul tablespace users 2 as 3 select * from dba_objects;SQL > select count (1) from ducw.test_dul;SQL > exit
-- 2. Construct the control file used by DUL
The control.dul must include file information for SYSTEM tablespaces, as well as tablespace file information for tables that want to UNLOAD.
SQL > select ts# | |'| rfile# | |''| | name | | 'block_size' | | block_size 2 from v$datafile 3 / TS# | |'| RFILE# |''| | NAME | | 'BLOCK_SIZE' | | BLOCK_SIZE---- | -01 / oracle/app/oracle/oradata/test/system01.dbf block_size 81921 2 / oracle/app/oracle/oradata/test/sysaux01.dbf block_size 81922 3 / oracle/app/oracle/oradata/test/undotbs01.dbf block_size 81924 4 / oracle/app/oracle/oradata/test/users01.dbf block_size 81924 5 / oracle/app/oracle/oradata/test/users02.dbf block_size 8192
-- 2.1 DUL control file
(python3venv) [oracle@sqlaudit ~] $cat control.dul 01 / oracle/app/oracle/oradata/test/system01.dbf block_size 81921 2 / oracle/app/oracle/oradata/test/sysaux01.dbf block_size 81922 3 / oracle/app/oracle/oradata/test/undotbs01.dbf block_size 81924 4 / oracle/app/oracle/oradata/test/users01.dbf block_size 81924 5 / oracle/app/oracle/oradata/test/users02.dbf block_size 8192
-- 2.2 DUL parameter file
(python3venv) [oracle@sqlaudit] $cat init.dul#Platform specific parameter OSD_BIG_ENDIAN_FLAG=FALSEOSD_DBA_FILE_BITS=10OSD_C_STRUCT_ALIGNMENT=32OSD_FILE_LEADER_SIZE=1OSD_WORD_SIZE=32# Size of dul dictionary caches. If one of these is too low startup will fail.DC_COLUMNS=200000DC_TABLES=100000DC_OBJECTS=100000DC_USERS=100DC_SEGMENTS=100000# Location and filename ofthe control fileCONTROL_FILE=/home/oracle/control.dul# Database blocksizeDB_BLOCK_SIZE=8192# Using Import to restore the data retrieved EXPORT_MODE=TRUE# Using SQL*Loader to restore the data retrieved # EXPORT_MODE=FALSE# Compatible parameterCOMPATIBLE=10FILE_SIZE_IN_MB=1000BUFFER=200000000
-3. Run DUL
Rm * .ctlrm * .datrm * .logrm * .ddlrm * .out
Execute the BOOTSTRAP command in the DUL running environment to generate dictionary information and make necessary preparations for UNLOAD.
(python3venv) [oracle@sqlaudit ~] $. / dul DUL > bootstrap
-- 3.2 execute the UNLOAD process in the DUL running environment:
UNLOAD TABLE owner.table
This will unload the one table definition and the table's data.
UNLOAD USER user name
This unloads all tables and data for the specified user.
UNLOAD DATABASE
This unloads all of the database tables available. (except the user SYS).
DUL > unload table ducw.test_dul