技术源于专注

专注于数据库技术

博客园 首页 新随笔 联系 订阅 管理
  42 随笔 :: 0 文章 :: 7 评论

无备份恢复表空间前提是归档存在
[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;

 
posted on 2015-06-14 11:08  NETDATA  阅读(144)  评论(0编辑  收藏