暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

使用Oracle9i的自动控制文件备份功能

原创 eygle 2005-03-09
457
1.启用控制文件自动备份


[oracle@standby oracle]$ rman target /
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: PRIMARY (DBID=1367687269)
--注意记录这里的DBID,在此后的恢复中,你可能需要用到。
RMAN> configure controlfile autobackup on;
using target database controlfile instead of recovery catalog
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> exit
Recovery Manager complete.


在启用了自动备份以后,在数据库发生文件变化或备份等任务时,数据库会自动备份控制文件。

如果丢失了所有的控制文件及数据文件,我们可以尝试从自动备份中恢复控制文件及spfile文件。

2.丢失所有所有的控制文件的恢复尝试


[oracle@standby oradata]$ rman target /
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database (not started)
首先启动数据库到nomount状态
RMAN> startup nomount;
Oracle instance started
Total System Global Area 135337420 bytes
Fixed Size 452044 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
尝试从自动备份中恢复控制文件
RMAN> restore controlfile to '/opt/oracle/oradata/control01.ctl' from autobackup;
Starting restore at 09-MAR-05
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=11 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/09/2005 10:15:05
RMAN-06495: must explicitly specify DBID with SET DBID command
此时提示,必须显示的指定DBID,Oracle才能正确定位备份文件
RMAN> set DBID=1367687269
executing command: SET DBID
RMAN> restore controlfile to '/opt/oracle/oradata/control01.ctl' from autobackup;
Starting restore at 09-MAR-05
using channel ORA_DISK_1
channel ORA_DISK_1: looking for autobackup on day: 20050309
channel ORA_DISK_1: autobackup found: c-1367687269-20050309-00
channel ORA_DISK_1: controlfile restore from autobackup complete
Finished restore at 09-MAR-05


指定DBID之后,控制文件可以恢复。
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论