bkp文件oracle,【备份】RMAN中对控制文件的几种备份方法

控制文件对于Oracle数据库来说是至关重要的,这里简单的介绍几种在RMAN中对控制文件的备份方法。1.进入RMAN命令行界面secooler@secDB /oracle/oradata$ rman target /Recovery Manager: Release 10.2.0.3.0 - Production on Wed Dec 16 16:39:15 2009Copyright (c) 1982, 2005, Oracle.  All rights reserved.connected to target database: SECOOLER (DBID=21803462)RMAN>2.修改控制文件备份方式为自动备份RMAN> configure controlfile autobackup on;new RMAN configuration parameters:CONFIGURE CONTROLFILE AUTOBACKUP ON;new RMAN configuration parameters are successfully stored3.确认参数是否修改成功,成功。RMAN> show CONTROLFILE AUTOBACKUP;RMAN configuration parameters are:CONFIGURE CONTROLFILE AUTOBACKUP ON;4.修改控制文件的备份文件的存放位置,这里注意一下其中的“%F”不可或缺。RMAN> configure controlfile autobackup format for device type disk to '/orabackup/%F';new RMAN configuration parameters:CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/orabackup/%F';new RMAN configuration parameters are successfully stored5.确认一下备份文件备份位置参数是否修改成功。成功。RMAN> show controlfile autobackup format;RMAN configuration parameters are:CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/orabackup/%F';6.此时使用“backup database”命令可以出发控制文件的备份RMAN> backup database;Starting backup at 2009-12-16 16:54:21using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=146 devtype=DISKchannel ORA_DISK_1: starting full datafile backupsetchannel ORA_DISK_1: specifying datafile(s) in backupsetinput datafile fno=00001 name=/oracle/oradata/secooler/system01.dbfinput datafile fno=00002 name=/oracle/oradata/secooler/undotbs01.dbfinput datafile fno=00003 name=/oracle/oradata/secooler/sysaux01.dbfinput datafile fno=00004 name=/oracle/oradata/secooler/users01.dbfchannel ORA_DISK_1: starting piece 1 at 2009-12-16 16:54:22channel ORA_DISK_1: finished piece 1 at 2009-12-16 16:54:25piece handle=/oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_nnndf_TAG20091216T165421_5lk81y4j_.bkp tag=TAG20091216T165421 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:03Finished backup at 2009-12-16 16:54:25Starting Control File and SPFILE Autobackup at 2009-12-16 16:54:25piece handle=/orabackup/c-21803462-20091216-00 comment=NONEFinished Control File and SPFILE Autobackup at 2009-12-16 16:54:267.在RMAN中使用“backup current controlfile”亦可完成控制文件的备份。RMAN> backup current controlfile;Starting backup at 2009-12-16 22:34:31using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=141 devtype=DISKchannel ORA_DISK_1: starting full datafile backupsetchannel ORA_DISK_1: specifying datafile(s) in backupsetincluding current control file in backupsetchannel ORA_DISK_1: starting piece 1 at 2009-12-16 22:34:31channel ORA_DISK_1: finished piece 1 at 2009-12-16 22:34:32piece handle=/oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_ncnnf_TAG20091216T223431_5lkvzqp6_.bkp tag=TAG20091216T223431 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 2009-12-16 22:34:32Starting Control File and SPFILE Autobackup at 2009-12-16 22:34:32piece handle=/orabackup/c-21803462-20091216-01 comment=NONEFinished Control File and SPFILE Autobackup at 2009-12-16 22:34:338.在RMAN中得到曾经备份过的控制文件信息RMAN> list backup of controlfile;List of Backup Sets===================BS Key  Type LV Size       Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ -------------------2       Full    6.80M      DISK        00:00:00     2009-12-16 16:54:25BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20091216T165425Piece Name: /orabackup/c-21803462-20091216-00Control File Included: Ckp SCN: 742397       Ckp time: 2009-12-16 16:54:25BS Key  Type LV Size       Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ -------------------3       Full    6.77M      DISK        00:00:00     2009-12-16 22:34:31BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20091216T223431Piece Name: /oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_ncnnf_TAG20091216T223431_5lkvzqp6_.bkpControl File Included: Ckp SCN: 763491       Ckp time: 2009-12-16 22:34:31BS Key  Type LV Size       Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ -------------------4       Full    6.80M      DISK        00:00:00     2009-12-16 22:34:32BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: TAG20091216T223432Piece Name: /orabackup/c-21803462-20091216-01Control File Included: Ckp SCN: 763495       Ckp time: 2009-12-16 22:34:329.使用RMAN的copy命令亦完成可对控制文件的备份任务RMAN> copy current controlfile to '/orabackup/rman_copy_controlfile.ctl';Starting backup at 2009-12-16 22:42:47using channel ORA_DISK_1channel ORA_DISK_1: starting datafile copycopying current control fileoutput filename=/orabackup/rman_copy_controlfile.ctl tag=TAG20091216T224247 recid=1 stamp=705796967channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01Finished backup at 2009-12-16 22:42:48Starting Control File and SPFILE Autobackup at 2009-12-16 22:42:48piece handle=/orabackup/c-21803462-20091216-02 comment=NONEFinished Control File and SPFILE Autobackup at 2009-12-16 22:42:5010.小结以上仅是罗列了几种在RMAN中备份控制文件的方法,途径很多,适用就好,具体环境下使用顺手的备份方法便可。诚然,备份的根本目的是为恢复,任何一种备份方法在紧要关头只要可用便是王道。Good luck.secooler10.01.26-- The End --

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值