Oracle以TSPITR方式恢复表空间数据一例(5)

. . importing table                           "T1"    --导入误删除的测试表

. importing SYS's objects into SYS

Import terminated successfully without warnings.

host command complete

 

sql statement: alter tablespace  TSPITR online

 

sql statement: alter tablespace  TSPITR offline    --最后一步操作是把要恢复的表空间offline的

 

sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end;

 

Removing automatic instance    --删除自动化实例以及相关文件

Automatic instance removed

auxiliary instance file /u01/aux/cntrl_tspitr_ORA10G_xvBc.f deleted

auxiliary instance file /u01/aux/TSPITR_ORA10G_XVBC/datafile/o1_mf_system_b9t8nvw3_.dbf deleted

auxiliary instance file /u01/aux/TSPITR_ORA10G_XVBC/datafile/o1_mf_undotbs1_b9t8nvx5_.dbf deleted

auxiliary instance file /u01/aux/TSPITR_ORA10G_XVBC/datafile/o1_mf_temp_b9t8t370_.tmp deleted

auxiliary instance file /u01/aux/TSPITR_ORA10G_XVBC/onlinelog/o1_mf_1_b9t8srrv_.log deleted

auxiliary instance file /u01/aux/TSPITR_ORA10G_XVBC/onlinelog/o1_mf_2_b9t8svp8_.log deleted

auxiliary instance file /u01/aux/TSPITR_ORA10G_XVBC/onlinelog/o1_mf_3_b9t8sy5v_.log deleted

Finished recover at 26-DEC-14

 

RMAN> exit

 

 

Recovery Manager complete.

[oracle@bak ~]$ sqlplus /nolog

 

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Dec 26 17:03:26 2014

 

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

 

SQL> conn zlm/zlm@ora10g213

Connected.

SQL> select count(*) from t1;

select count(*) from t1

                     *

ERROR at line 1:

ORA-00376: file 6 cannot be read at this time

ORA-01110: data file 6: '/data/oradata/ora10g/tspitr01.dbf'

 

无法打开恢复的6号文件,由于最后的操作是把该表空间offline的

 

SQL> select status from dba_tablespaces where tablespace_name='TSPITR';

 

STATUS

---------

OFFLINE

 

--重新将tspitr表空间online

 

SQL> alter tablespace tspitr online;

 

Tablespace altered.

 

SQL> select count(*) from t1;

 

  COUNT(*)

----------

     50382

 

之前误删除的测试表T1的数据又回来了。

 

最后来看一下auxiliary目录结构

 

[oracle@bak admin]$ cd /u01/aux

[oracle@bak aux]$ ll

total 4

drwxr-x--- 4 oracle oinstall 4096 Dec 26 16:55 TSPITR_ORA10G_XVBC

[oracle@bak aux]$ cd TSPITR_ORA10G_XVBC/

[oracle@bak TSPITR_ORA10G_XVBC]$ ll -lrth

total 8.0K

drwxr-x--- 2 oracle oinstall 4.0K Dec 26 16:59 onlinelog

drwxr-x--- 2 oracle oinstall 4.0K Dec 26 16:59 datafile

[oracle@bak TSPITR_ORA10G_XVBC]$ cd onlinelog/

[oracle@bak onlinelog]$ ll

total 0

[oracle@bak onlinelog]$ cd ..

[oracle@bak TSPITR_ORA10G_XVBC]$ cd datafile

[oracle@bak datafile]$ ll

total 0

[oracle@bak datafile]$ 

 

虽然在中间过程创建了相关目录和文件,恢复结束以后,只留下了目录结构,文件都被自动删除了

 

总结:

 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/0f417dac01ed75369c919483d6341626.html