环境介绍:11g RAC 使用 ASM 磁盘组,控制文件只有一个,需要进行添加
- 参照 MOS 文档
How to Multiplex Control File In RAC Database (文档 ID 1642374.1)
- 1) 查看数据库版本
SQL> select * from v$version;BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionPL/SQL Release 11.2.0.4.0 - ProductionCORE 11.2.0.4.0 ProductionTNS for Linux: Version 11.2.0.4.0 - ProductionNLSRTL Version 11.2.0.4.0 - Production
- 2) 查看控制文件
SQL> select name from v$controlfile;NAME--------------------------------------------------------------------------------+DATA01/rac/controlfile/current.256.955886921
- 3) 修改控制文件参数,添加新的磁盘组
SQL> alter system set control_files='+DATA01/rac/controlfile/current.256.955886921', '+FRA' scope=spfile sid='*;
- 4) 关闭 RAC 数据库实例,然后启动到 nomount 状态
[grid@rac1 ~]$ srvctl stop database -d rac[grid@rac1 ~]$ srvctl start database -d rac -o nomount
- 5) 检查 control_files 参数
SQL> show parameter control_filesNAME TYPE VALUE-------------- ------------ -------------------------------------------------control_files string +DATA01/rac/controlfile/current.256.955886921,+FRA
- 6) 在其中一个节点上启动 RMAN,使用 restore 命令复制一份控制文件
[oracle@rac1 ~]$ rman target /Recovery Manager: Release 11.2.0.4.0 - Production on Fri Sep 29 17:11:09 2017Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.connected to target database: rac (not mounted)RMAN> restore controlfile from '+DATA01/rac/controlfile/current.256.955886921';Starting restore at 2017-09-29 17:16:00using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=1123 instance=rac1 device type=DISKchannel ORA_DISK_1: copied control file copyoutput file name=+DATA01/rac/controlfile/current.256.955886921output file name=+FRA/rac/controlfile/current.266.955991761Finished restore at 2017-09-29 17:16:01
- 7) 修改 control_files 参数
SQL> alter system set control_files='+DATA01/rac/controlfile/current.256.955886921','+FRA/rac/controlfile/current.266.955991761' scope=spfile sid='*';
- 8) 关闭数据库,然后正常启动
[grid@rac1 ~]$ srvctl stop database -d rac[grid@rac1 ~]$ srvctl start database -d rac
- 9) 验证是否添加成功
SQL> show parameter control_filesNAME TYPE VALUE-------------- ------------ -------------------------------------------------control_files string +DATA01/rac/controlfile/current.256.955886921,+FRA/rac/controlfile/current.266.955991761SQL> select name from v$controlfile;NAME--------------------------------------------------------------------------------+DATA01/rac/controlfile/current.256.955886921+FRA/rac/controlfile/current.266.955991761