标签:param offline 查询 file ble varchar2 var bsp 步骤
生成测试表
conn liang/chengce243
create table tab_01(id int,name VARCHAR2(128));
insert into tab_01
select OBJECT_ID,OBJECT_NAME
from dba_objects where rownum<=10000;
commit;
create table tab_05 as select * from tab_01;
drop table tab_05;
恢复的步骤为:
OFFLINE表所在的表空间
扫描数据:scan extent
搜索数据:unload object all sample
从结果文件sample.txt查找需要的数据
恢复需要的表:unload object data_object_id column coltype coltype...
ONLINE表所在的表空间
set linesize 180
col FILE_NAME for a50
col VALUE for a8
select ts#,file_id fno#,file_id rfno#,file_name,value
from V$tablespace t,dba_data_files d,v$parameter p
where t.name=d.tablespace_name
and p.name=‘db_block_size‘;
把查询结果贴到control.txt;
修改配置文件config.txt output_format 为 DMP
[oracle@hncdf odu]$ cat config.txt
byte_order little
block_size 8192
db_timezone -7
client_timezone 8
data_path data
charset_name ZHS16GBK
ncharset_name AL16UTF16
output_format DMP
lob_storage infile
clob_byte_order little
OFFLINE表所在的表空间
SQL> alter tablespace users offline;
做一个Checkpoint,让ODU能够读到最新的数据字典数据。
SQL> alter system checkpoint;
ODU> scan extent tablespace 4;
ODU> unload object all sample
从结果文件sample.txt查找需要的数据
恢复需要的表:unload object 87368 tablespace 4 column NUMBER VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2
使用imp导入数据
imp liang/chengce243 file=data/ODU_0000087368.dmp full=y
参考文档:http://www.laoxiong.net/category/odu
odu恢复drop表--不通过logmnr挖掘object_id
标签:param offline 查询 file ble varchar2 var bsp 步骤
原文地址:https://www.cnblogs.com/liang545621/p/12611618.html