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
这个设置可以在数据库中通过如下方式查询得到:
[[email protected] 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文件
[[email protected] 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