Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: HSJF (DBID=1052178311)
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
using target database controlfile instead of recovery catalog old RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP OFF; new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP ON; new RMAN configuration parameters are successfully stored
RMAN> exit
这个设置可以在数据库中通过如下方式查询得到:
[oracle@jumper bdump]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.3.0 - Production on Sat Jan 17 01:08:05 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.3.0 - Production
SQL> select * from v$rman_configuration; CONF# NAME VALUE ---------- ------------------------- ---------- 1 CONTROLFILE AUTOBACKUP ON
Sat Jan 17 00:55:57 2004 Starting control autobackup Control autobackup written to DISK device handle '/opt/oracle/product/9.2.0/dbs/c-1052178311-20040117-00' Completed: create tablespace eygle datafile '/data1/oracle/oradata/eygle01.dbf’
如果使用rman进行备份,在提示中你可以看到如下信息:
RMAN> configure controlfile autobackup on;
old RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP OFF; new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP ON; new RMAN configuration parameters are successfully stored
RMAN> run 2> { 3> allocate channel ch1 type disk format='e:/oracle/orabak/penny%t.arc'; 4> backup archivelog all delete all input; 5> release channel ch1; 6> }
Starting Control File and SPFILE Autobackup at 02-DEC-03 piece handle=E:/ORACLE/ORA92/DATABASE/C-3627775766-20031202-01 comment=NONE Finished Control File and SPFILE Autobackup at 02-DEC-03
released channel: ch1
我们简单看一下自动备份的控制文件及spfile文件的格式及命名规则: c-IIIIIIIIII-YYYYMMDD-QQ c ------------------------控制文件 IIIIIIIIII---------DBID YYYYMMDD------------时间戳 QQ----------------------序号00-FF,16进制表示
c. 使用自动备份恢复spfile文件
[oracle@jumper bdump]$ rman target /
Recovery Manager: Release 9.2.0.3.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: HSJF (DBID=1052178311)
RMAN> restore spfile to '/tmp/spfileeygle.ora' from autobackup;
Starting restore at 17-JAN-04
using target database controlfile instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=18 devtype=DISK channel ORA_DISK_1: looking for autobackup on day: 20040117 channel ORA_DISK_1: autobackup found: c-1052178311-20040117-01 channel ORA_DISK_1: SPFILE restore from autobackup complete Finished restore at 17-JAN-04