现在的位置: 首页 > 综合 > 正文

归档模式下,恢复一个误删除的数据文件

2018年04月28日 ⁄ 综合 ⁄ 共 1233字 ⁄ 字号 评论关闭

前提:在归档模式下,且有该数据文件创建以来的所有日志

 

 

[oracle@localhost localhost]$cd $ORACLE_BASE/oradata/orcl/
[oracle@localhost orcl]$ mv temp_tablespace1.dbf temp_tablespace1.dbf.mv
[oracle@localhost orcl]$ ls
archive           control02.ctl     control03.ctl.mv  lijie_temp1.dbf  redo02_3.log   redo03.log    system01.dbf             undo01.dbf     users01.dbf
control01.ctl     control02.ctl.mv  example01.dbf     redo01.log       redo02.log     redo04.rdo    temp01.dbf               undo02.dbf
control01.ctl.mv  control03.ctl     lijie.dbf         redo02_2.log     redo02.log.mv  sysaux01.dbf  temp_tablespace1.dbf.mv  undotbs01.dbf
[oracle@localhost orcl]$ sqlplus / as sysdba;

SQL> startup;
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size                  1218316 bytes
Variable Size              79694068 bytes
Database Buffers           83886080 bytes
Redo Buffers                2973696 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 10 - see DBWR trace file
ORA-01110: data file 10: '/oracle/app/oracle/oradata/orcl/temp_tablespace1.dbf'

SQL> alter database create datafile 10 as '/oracle/app/oracle/oradata/orcl/temp_tablespace1.dbf';

Database altered.

SQL> recover datafile 10;
Media recovery complete.
SQL> alter database open;

Database altered.

 

 

抱歉!评论已关闭.