无备份恢复表空间前提是归档存在
[[email protected] ~]$ 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 [email protected] > alter database archivelog;
Database altered.
--创建表空间
10:04:57 [email protected] > create tablespace test datafile ‘/u01/app/oracle/oradata/NETDATA/test01.dbf‘ size 20m autoextend on next 20M maxsize 5G;
Tablespace created.
--
10:13:39 [email protected] > create user testdel identified by testdel default tablespace test;
User created.
10:14:30 [email protected] > create table test (id int,name varchar(10));
Table created.
Elapsed: 00:00:00.10
10:14:47 [email protected] > insert into test values(1,‘22‘);
1 row created.
Elapsed: 00:00:00.03
10:14:57 [email protected] > insert into test values(2,‘33‘);
1 row created.
Elapsed: 00:00:00.01
10:15:02 [email protected] > commit;
Commit complete.
[[email protected] NETDATA]$ rm -rf test01.dbf
[[email protected] NETDATA]$
13:12:43 [email protected] > 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 [email protected] > 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 [email protected] > recover datafile 6;
Media recovery complete.
13:30:25 [email protected] > alter database open;