ORACLE RAC环境下复制多个control file
本文在11gr2 rac + ASM环境下实现,总体思路是通过rman复制多个控制文件,然后修改参数文件的control_file参数即可,操作需要nomount状态下;多个控制文件增加数据库安全性
1,查看当前control file设置,只有一个控制文件
sys@LISDB1(dtydb3)>show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATA/lisdb/controlfile/curren
t.352.826293519
control_management_pack_access string DIAGNOSTIC+TUNING
sys@LISDB1(dtydb3)>select name from v$controlfile;
NAME
--------------------------------------------------
+DATA/lisdb/controlfile/current.352.826293519
2,关闭rac集群中的数据库,并启动一个实例到nomount状态
-bash-3.2$ srvctl stop database -d lisdb
lisdb1>startup nomount;
ORACLE 例程已经启动。
Total System Global Area 6263357440 bytes
Fixed Size 2238104 bytes
Variable Size 1392511336 bytes
Database Buffers 4848615424 bytes
Redo Buffers 19992576 bytes
3,使用rman命令复制三个control文件
RMAN> restore controlfile to '+DATA/lisdb/controlfile/control01.ctl' from '+DATA/lisdb/controlfile/current.352.826293519' ;
启动 restore 于 2013-10-09 14:38:53
使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=1345 实例=lisdb1 设备类型=DISK
通道 ORA_DISK_1: 已复制控制文件副本
完成 restore 于 2013-10-09 14:38:59
RMAN> restore controlfile to '+DATA/lisdb/controlfile/control02.ctl' from '+DATA/lisdb/controlfile/current.352.826293519' ;
RMAN> restore controlfile to '+DATA/lisdb/controlfile/control03.ctl' from '+DATA/lisdb/controlfile/current.352.826293519' ;
通过asmcmd查看,多了三个控制文件,注意,我起的名字实际上是链接
ASMCMD> ls -l
Type Redund Striped Time Sys Name
CONTROLFILE UNPROT FINE OCT 09 14:00:00 Y Current.352.826293519
N control01.ctl => +DATA/LISDB/CONTROLFILE/current.468.828369539
N control02.ctl => +DATA/LISDB/CONTROLFILE/current.470.828369591
N control03.ctl => +DATA/LISDB/CONTROLFILE/current.459.828369601
CONTROLFILE UNPROT FINE OCT 09 14:00:00 Y current.459.828369601
CONTROLFILE UNPROT FINE OCT 09 14:00:00 Y current.468.828369539
CONTROLFILE UNPROT FINE OCT 09 14:00:00 Y current.470.828369591
4,修改参数control_files
alter system set control_files='+DATA/lisdb/controlfile/control01.ctl','+DATA/lisdb/controlfile/control02.ctl','+DATA/lisdb/controlfile/control03.ctl' scope=spfile sid='*';
5,关闭实例1,重启所有节点的实例
sys@LISDB1(dtydb3)>shutdown immediate;
ORA-01507: 未装载数据库
ORACLE 例程已经关闭
srvctl start database -d lisdb
6,验证结果
sys@LISDB1(dtydb3)>show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATA/lisdb/controlfile/contro
l01.ctl, +DATA/lisdb/controlfi
le/control02.ctl, +DATA/lisdb/
controlfile/control03.ctl
control_management_pack_access string DIAGNOSTIC+TUNING