無備份恢復(歸檔模式)已刪除資料檔案

shawnloong發表於2017-01-22
無備份恢復表空間前提是歸檔存在
[oracle@NetData-ora10g-118 ~]$ rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Tue Aug 5 10:02:46 2014

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

connected to target database: NETDATA (DBID=348346524)

RMAN> list backup of database;

using target database control file instead of recovery catalog

RMAN>
開啟歸檔
10:04:33 SYS@NETDATA > alter database archivelog;

Database altered.


--建立表空間
10:04:57 SYS@NETDATA > create tablespace test datafile '/u01/app/oracle/oradata/NETDATA/test01.dbf' size 20m autoextend on next 20M maxsize 5G;

Tablespace created.

--
10:13:39 SYS@NETDATA > create user testdel identified by testdel default tablespace test;

User created.

10:14:30 TESTDEL@NETDATA > create table test (id int,name varchar(10));

Table created.

Elapsed: 00:00:00.10
10:14:47 TESTDEL@NETDATA > insert into test values(1,'22');

1 row created.

Elapsed: 00:00:00.03
10:14:57 TESTDEL@NETDATA > insert into test values(2,'33');

1 row created.

Elapsed: 00:00:00.01
10:15:02 TESTDEL@NETDATA > commit;

Commit complete.

[oracle@NetData-ora10g-118 NETDATA]$ rm -rf test01.dbf
[oracle@NetData-ora10g-118 NETDATA]$

13:12:43 TESTDEL@NETDATA > create table test2 (id int,name varchar2(20));
create table test2 (id int,name varchar2(20))
*
ERROR at line 1:
ORA-01116: error in opening database file 6
ORA-01110: data file 6: '/u01/app/oracle/oradata/NETDATA/test01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3


Elapsed: 00:00:00.12
重建資料檔案,利用現有控制檔案,現在有歸檔,恢復

13:30:11 SYS@NETDATA > alter database create datafile '/u01/app/oracle/oradata/NETDATA/test01.dbf' as '/u01/app/oracle/oradata/NETDATA/test01.dbf';

Database altered.

Elapsed: 00:00:00.30
13:30:14 SYS@NETDATA > recover datafile 6;
Media recovery complete.
13:30:25 SYS@NETDATA > alter database open;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24486203/viewspace-2132818/,如需轉載,請註明出處,否則將追究法律責任。

相關文章