温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

DUL 恢复简单表测试

发布时间:2020-07-03 13:24:16 来源:网络 阅读:1136 作者:背向天堂 栏目:关系型数据库

--1. 构造测试数据

SQL> alter database datafile '/oracle/app/oracle/oradata/test/users01.dbf' resize 100m;
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. 构造DUL使用的控制文件

在control.dul中必须包含SYSTEM表空间的文件信息,以及想UNLOAD的表的表空间文件信息。


SQL> select ts# || ' '|| rfile# || ' '|| name || ' block_size '|| block_size
  2  from v$datafile
  3  /
TS#||''||RFILE#||''||NAME||'BLOCK_SIZE'||BLOCK_SIZE
--------------------------------------------------------------------------------
0 1 /oracle/app/oracle/oradata/test/system01.dbf block_size 8192
1 2 /oracle/app/oracle/oradata/test/sysaux01.dbf block_size 8192
2 3 /oracle/app/oracle/oradata/test/undotbs01.dbf block_size 8192
4 4 /oracle/app/oracle/oradata/test/users01.dbf block_size 8192
4 5 /oracle/app/oracle/oradata/test/users02.dbf block_size 8192


--2.1 DUL控制文件

(python3venv) [oracle@sqlaudit ~]$ cat control.dul 
0 1 /oracle/app/oracle/oradata/test/system01.dbf block_size 8192
1 2 /oracle/app/oracle/oradata/test/sysaux01.dbf block_size 8192
2 3 /oracle/app/oracle/oradata/test/undotbs01.dbf block_size 8192
4 4 /oracle/app/oracle/oradata/test/users01.dbf block_size 8192
4 5 /oracle/app/oracle/oradata/test/users02.dbf block_size 8192


--2.2 DUL参数文件

(python3venv) [oracle@sqlaudit ~]$ cat init.dul
#Platform specific parameter  
OSD_BIG_ENDIAN_FLAG=FALSE
OSD_DBA_FILE_BITS=10
OSD_C_STRUCT_ALIGNMENT=32
OSD_FILE_LEADER_SIZE=1
OSD_WORD_SIZE=32
# Size of dul dictionary caches. If one of these is too low startup will fail.
DC_COLUMNS=200000
DC_TABLES=100000
DC_OBJECTS=100000
DC_USERS=100
DC_SEGMENTS=100000
# Location and filename ofthe control file
CONTROL_FILE=/home/oracle/control.dul
# Database blocksize
DB_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 parameter
COMPATIBLE=10
FILE_SIZE_IN_MB=1000
BUFFER=200000000


--3. 运行DUL

rm *.ctl
rm *.dat
rm *.log
rm *.ddl
rm *.out


--3.1 在DUL运行环境下执行BOOTSTRAP命令,生成字典信息,为UNLOAD做必要的准备。


(python3venv) [oracle@sqlaudit ~]$ ./dul 
DUL> bootstrap;



--3.2 在DUL运行环境下执行UNLOAD过程:

  1. UNLOAD TABLE owner.table ; 

    1. This will unload the one table definition and the table's data. 

  2. UNLOAD USER user name ; 

    1. This unloads all tables and data for the specified user. 

  3. UNLOAD DATABASE ; 

    1. This unloads all of the database tables available. (except the user SYS). 


DUL>
 
unload table ducw.test_dul;



向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI