SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
SQL> show parameter cluster;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
cluster_interconnects string
11.2.0.4部署在centos6.5的2节点oracle rac。默认情况下,数据库仅有一组control file文件,需要添加一组,保证一组文件损坏或者丢失导致数据库宕机。
SQL> show parameter control;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 30
control_files string +CRS/orcl/controlfile/current.
260.931276463
control_management_pack_access string DIAGNOSTIC+TUNING
1、关闭两个节点
[grid@db-foc-node01 oracle]$ srvctl stop database -d orcl
2、在其中一个节点上启动rman
[oracle@db-foc-node01 ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Dec 27 16:59:10 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
3、将数据库启动到nomount状态下
RMAN> startup nomount;
Oracle instance started
Total System Global Area 4275781632 bytes
Fixed Size 2260088 bytes
Variable Size 989856648 bytes
Database Buffers 3271557120 bytes
Redo Buffers 12107776 bytes
4、采用restore拷贝一份controlfile到新路径
RMAN> restore controlfile to '+DATA/ORCL/CONTROLFILE/Current.261.931276464' from '+CRS/ORCL/CONTROLFILE/Current.260.931276463';
Starting restore at 27-DEC-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=50 instance=orcl1 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 27-DEC-16
注:’+DATA/ORCL/CONTROLFILE/Current.261.931276464’是拷贝的新的控制文件,如果asm自动管理的,可能名字不会按照你的命名,需要确定下新的文件名字。
ASMCMD> pwd
+DATA/ORCL/CONTROLFILE
ASMCMD> ls
current.299.931771447
果然不一样。
5、修改spfile文件
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +CRS/orcl/spfileorcl.ora
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> create pfile='/oracle/init.ora' from spfile='+CRS/orcl/spfileorcl.ora';
File created.
vi /oracle/init.ora
--修改
*.control_files='+CRS/orcl/controlfile/current.260.931276463','+DATA/ORCL/CONTROLFILE/current.299.931771447'
SQL> create spfile='+CRS/orcl/spfileorcl.ora' from pfile='/oracle/init.ora';
File created.
6、启动数据库
[grid@db-foc-node01 oracle]$ srvctl start database -d orcl
7、验证
SQL> show parameter control;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 30
control_files string +CRS/orcl/controlfile/current.
260.931276463, +DATA/orcl/cont
rolfile/current.299.931771447
control_management_pack_access string DIAGNOSTIC+TUNING