控制文件对于数据库来说至关重要,在数据库的恢复过程中,首先需要恢复初始化参数文件,然后就是控制文件的恢复。
RMAN采用CATALOG方式还是NOCATALOG方式,以及是否启用了AUTOBACKUP,决定了控制文件的恢复方法。
RMAN备份恢复之控制文件的恢复(一):http://yangtingkun.itpub.net/post/468/305766
这篇文章介绍NOCATALOG方式下通过CONTROLFILE AUTOBACKUP来恢复控制文件。
在NOCATALOG方式下,如果控制文件的自动备份是打开的,那么控制文件丢失后,也可以方便的利用控制文件的自动备份进行恢复。
F:>sqlplus "/@test1 as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on 星期一 7月 23 21:37:28 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> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> host move F:oracleoradata est1control01.ctl F:oracleoradata est1control01.bak
SQL> host move F:oracleoradata est1control02.ctl F:oracleoradata est1control02.bak
SQL> host move F:oracleoradata est1control03.ctl F:oracleoradata est1control03.bak
SQL> exit
从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中断开
F:>
上面删除了控制文件,这个时候数据库已经无法打开了:
F:>sqlplus "/@test1 as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on 星期一 7月 23 21:44:02 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
已连接到空闲例程。
SQL> startup
ORACLE 例程已经启动。
Total System Global Area 110173900 bytes
Fixed Size 454348 bytes
Variable Size 83886080 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
ORA-00205: ?????????????????????
SQL> shutdown
IXDBA.NET社区论坛
ORA-01507: ??????
ORACLE 例程已经关闭。
SQL>
SQL> exit
从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中断开
下面尝试使用RMAN恢复控制文件:
F:>rman target /@test1
恢复管理器: 版本9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
已连接到目标数据库 (未启动)
RMAN> startup nomount
Oracle 例程已启动
系统全局区域总计 110173900 字节
Fixed Size 454348 字节
Variable Size 83886080 字节
Database Buffers 25165824 字节
Redo Buffers 667648 字节
RMAN> restore controlfile from autobackup;
启动 restore 于 23-7月 -07
正在使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=11 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 07/23/2007 22:04:17
RMAN-06495: must explicitly specify DBID with SET DBID command