C:\Documents and Settings\Paul Yi>sqlplus "/as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on 星期五 5月 18 16:23:48 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
连接到:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining optio
JServer Release 9.2.0.4.0 - Production
SQL> create table paul (a int) tablespace tools;
表已创建。
SQL> insert into paul values(1);
已创建 1 行。
SQL> commit;
提交完成。
SQL> shutdown abort;
ORACLE 例程已经关闭。
SQL> host;
在操作系统上删除toolso1.dbf文件
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\Paul Yi>del D:\oracle\oradata\test\TOOLS01.DBF
C:\Documents and Settings\Paul Yi>sqlplus "/as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on 星期五 5月 18 16:26:22 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
已连接到空闲例程。
SQL> startup mount;
ORACLE 例程已经启动。
Total System Global Area 101785252 bytes
Fixed Size 454308 bytes
Variable Size 75497472 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
数据库装载完毕。
SQL> alter database open;
alter database open
*
ERROR 位于第 1 行:
ORA-01157: 无法标识/锁定数据文件 4 - 请参阅 DBWR 跟踪文件
ORA-01110: 数据文件 4: 'D:\ORACLE\ORADATA\TEST\TOOLS01.DBF'
进入rman开始恢复
C:\Documents and Settings\Paul Yi>rman
恢复管理器: 版本9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
RMAN> connect target /
连接到目标数据库: TEST (DBID=1915869886)
RMAN> show all;
正在使用目标数据库控制文件替代恢复目录
RMAN 配置参数为:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'd:\backup\%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\ORA92\DATABASE\SNCFTEST.ORA'; # default
RMAN> restore datafile 4;
启动 restore 于 18-5月 -07
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=12 devtype=DISK
通道 ORA_DISK_1: 正在开始恢复数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集恢复的数据文件
正将数据文件00004恢复到D:\ORACLE\ORADATA\TEST\TOOLS01.DBF
通道 ORA_DISK_1: 已恢复备份段 1
段 handle=D:\BACKUP\BAK_T20070518_S%S tag=TAG20070518T174942 params=NULL
通道 ORA_DISK_1: 恢复完成
完成 restore 于 18-5月 -07
RMAN> recover datafile 4;
启动 recover 于 18-5月 -07
使用通道 ORA_DISK_1
正在开始介质的恢复
完成介质的恢复
完成 recover 于 18-5月 -07
RMAN> alter database open;
数据库已打开
RMAN> exit
恢复管理器完成。
C:\Documents and Settings\Paul Yi>sqlplus "/as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on 星期五 5月 18 17:56:02 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
连接到:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL> select * from paul;
A
----------
1
至此完全恢复