ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 使用Oracle9i的自动控制文件备份功能

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

原创 Linux操作系统 作者:eygle 时间:2019-06-12 21:33:08 0 删除 编辑
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之后,控制文件可以恢复。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/764/viewspace-120514/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 圣诞快乐
请登录后发表评论 登录
全部评论

注册时间:2018-07-30

  • 博文量
    105
  • 访问量
    76911