【备份】RMAN中对控制文件的几种备份方法
发表于:2025-12-03 作者:千家信息网编辑
千家信息网最后更新 2025年12月03日,控制文件对于Oracle数据库来说是至关重要的,这里简单的介绍几种在RMAN中对控制文件的备份方法。1.进入RMAN命令行界面secooler@secDB /oracle/oradata$ rman
千家信息网最后更新 2025年12月03日【备份】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 2009
Copyright (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 stored
3.确认参数是否修改成功,成功。
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 stored
5.确认一下备份文件备份位置参数是否修改成功。成功。
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:21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=146 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/secooler/system01.dbf
input datafile fno=00002 name=/oracle/oradata/secooler/undotbs01.dbf
input datafile fno=00003 name=/oracle/oradata/secooler/sysaux01.dbf
input datafile fno=00004 name=/oracle/oradata/secooler/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2009-12-16 16:54:22
channel ORA_DISK_1: finished piece 1 at 2009-12-16 16:54:25
piece handle=/oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_nnndf_TAG20091216T165421_5lk81y4j_.bkp tag=TAG20091216T165421 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2009-12-16 16:54:25
Starting Control File and SPFILE Autobackup at 2009-12-16 16:54:25
piece handle=/orabackup/c-21803462-20091216-00 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 16:54:26
7.在RMAN中使用"backup current controlfile"亦可完成控制文件的备份。
RMAN> backup current controlfile;
Starting backup at 2009-12-16 22:34:31
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 2009-12-16 22:34:31
channel ORA_DISK_1: finished piece 1 at 2009-12-16 22:34:32
piece handle=/oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_ncnnf_TAG20091216T223431_5lkvzqp6_.bkp tag=TAG20091216T223431 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2009-12-16 22:34:32
Starting Control File and SPFILE Autobackup at 2009-12-16 22:34:32
piece handle=/orabackup/c-21803462-20091216-01 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 22:34:33
8.在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:25
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20091216T165425
Piece Name: /orabackup/c-21803462-20091216-00
Control File Included: Ckp SCN: 742397 Ckp time: 2009-12-16 16:54:25
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
3 Full 6.77M DISK 00:00:00 2009-12-16 22:34:31
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20091216T223431
Piece Name: /oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_ncnnf_TAG20091216T223431_5lkvzqp6_.bkp
Control File Included: Ckp SCN: 763491 Ckp time: 2009-12-16 22:34:31
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
4 Full 6.80M DISK 00:00:00 2009-12-16 22:34:32
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20091216T223432
Piece Name: /orabackup/c-21803462-20091216-01
Control File Included: Ckp SCN: 763495 Ckp time: 2009-12-16 22:34:32
9.使用RMAN的copy命令亦完成可对控制文件的备份任务
RMAN> copy current controlfile to '/orabackup/rman_copy_controlfile.ctl';
Starting backup at 2009-12-16 22:42:47
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output filename=/orabackup/rman_copy_controlfile.ctl tag=TAG20091216T224247 recid=1 stamp=705796967
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2009-12-16 22:42:48
Starting Control File and SPFILE Autobackup at 2009-12-16 22:42:48
piece handle=/orabackup/c-21803462-20091216-02 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 22:42:50
10.小结
以上仅是罗列了几种在RMAN中备份控制文件的方法,途径很多,适用就好,具体环境下使用顺手的备份方法便可。诚然,备份的根本目的是为恢复,任何一种备份方法在紧要关头只要可用便是王道。
Good luck.
secooler
10.01.26
-- The End --
1.进入RMAN命令行界面
secooler@secDB /oracle/oradata$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Wed Dec 16 16:39:15 2009
Copyright (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 stored
3.确认参数是否修改成功,成功。
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 stored
5.确认一下备份文件备份位置参数是否修改成功。成功。
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:21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=146 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/secooler/system01.dbf
input datafile fno=00002 name=/oracle/oradata/secooler/undotbs01.dbf
input datafile fno=00003 name=/oracle/oradata/secooler/sysaux01.dbf
input datafile fno=00004 name=/oracle/oradata/secooler/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2009-12-16 16:54:22
channel ORA_DISK_1: finished piece 1 at 2009-12-16 16:54:25
piece handle=/oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_nnndf_TAG20091216T165421_5lk81y4j_.bkp tag=TAG20091216T165421 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2009-12-16 16:54:25
Starting Control File and SPFILE Autobackup at 2009-12-16 16:54:25
piece handle=/orabackup/c-21803462-20091216-00 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 16:54:26
7.在RMAN中使用"backup current controlfile"亦可完成控制文件的备份。
RMAN> backup current controlfile;
Starting backup at 2009-12-16 22:34:31
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 2009-12-16 22:34:31
channel ORA_DISK_1: finished piece 1 at 2009-12-16 22:34:32
piece handle=/oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_ncnnf_TAG20091216T223431_5lkvzqp6_.bkp tag=TAG20091216T223431 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2009-12-16 22:34:32
Starting Control File and SPFILE Autobackup at 2009-12-16 22:34:32
piece handle=/orabackup/c-21803462-20091216-01 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 22:34:33
8.在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:25
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20091216T165425
Piece Name: /orabackup/c-21803462-20091216-00
Control File Included: Ckp SCN: 742397 Ckp time: 2009-12-16 16:54:25
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
3 Full 6.77M DISK 00:00:00 2009-12-16 22:34:31
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20091216T223431
Piece Name: /oracle/app/oracle/flash_recovery_area/SECOOLER/backupset/2009_12_16/o1_mf_ncnnf_TAG20091216T223431_5lkvzqp6_.bkp
Control File Included: Ckp SCN: 763491 Ckp time: 2009-12-16 22:34:31
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
4 Full 6.80M DISK 00:00:00 2009-12-16 22:34:32
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20091216T223432
Piece Name: /orabackup/c-21803462-20091216-01
Control File Included: Ckp SCN: 763495 Ckp time: 2009-12-16 22:34:32
9.使用RMAN的copy命令亦完成可对控制文件的备份任务
RMAN> copy current controlfile to '/orabackup/rman_copy_controlfile.ctl';
Starting backup at 2009-12-16 22:42:47
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output filename=/orabackup/rman_copy_controlfile.ctl tag=TAG20091216T224247 recid=1 stamp=705796967
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2009-12-16 22:42:48
Starting Control File and SPFILE Autobackup at 2009-12-16 22:42:48
piece handle=/orabackup/c-21803462-20091216-02 comment=NONE
Finished Control File and SPFILE Autobackup at 2009-12-16 22:42:50
10.小结
以上仅是罗列了几种在RMAN中备份控制文件的方法,途径很多,适用就好,具体环境下使用顺手的备份方法便可。诚然,备份的根本目的是为恢复,任何一种备份方法在紧要关头只要可用便是王道。
Good luck.
secooler
10.01.26
-- The End --
备份
文件
控制
方法
成功
命令
位置
参数
紧要
重要
不可或缺
任务
信息
关头
小结
数据
数据库
方式
根本
王道
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
软件开发学徒有真的吗
jmeter对数据库压力
公共信息网络安全监察简称
四会定制软件开发
710服务器改风扇
2021青岛网络安全竞赛
金昌市网络安全支队
更新数据库锁表
网络安全试卷1答案
连接开放网络安全性
如何成为企业微信服务器
有网络安全法的绘画
pfam数据库中数据格式
现在网吧用什么配置的服务器
数据库乐观锁避免超卖
菜鸟网络技术 上海办公
软件开发的素养
宝安服务器机箱机柜
江西昌圣网络技术有限公司
数据库控件怎么安装
亚马逊用哪个服务器
全国微课大赛网络安全
网安工作大数据库
物种分类数据库名称
张店化工软件开发报价
27岁转网络安全方向
租用国外服务器搭建网页
上海先进网络技术销售公司
软件开发的素养
校园出去信息管理系统数据库