1、检查control file配置。
SQL> select value control_files from v$parameter where name = 'control_files';
CONTROL_FILES
--------------------------------------------------------------------------------
+DATADG/shinfo/control01.ctl, +DATADG/shinfo/control02.ctl
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
+DATADG/shinfo/control01.ctl
+DATADG/shinfo/control02.ctl
SQL> show parameter cluster;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
cluster_interconnects string
1、关闭两个节点
oracle@shdb1:/home/oracle> srvctl stop database -d shinfo
srvctl stop database -d racdb -o immediate
2、在其中一个节点上启动rman
[oracle@node1 ~]$ rman target /
3、将数据库启动到nomount状态下
RMAN> startup nomount;
4、采用restore拷贝一份controlfile到新路径
RMAN> restore controlfile to '+DATADG/shinfo/control03.ctl' from '+DATADG/shinfo/control01.ctl';
Starting restore at 2022-01-0614:03:25
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=29 instance=shinfo1 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 2022-01-0614:03:26
RMAN>
说明:'+DATADG/shinfo/control03.ctl'是拷贝的新的控制文件,
如果asm自动管理的,可能名字不会按照你的命名,需要确定下新的文件名字。
root@shdb1:/root>su - grid
grid@shdb1:/home/grid>asmcmd
ASMCMD> cd +DATADG/SHINFO
ASMCMD> ls
control01.ctl
control02.ctl
control03.ctl
5、sqlplus中修改控制文件路径,修改完成后,关闭数据库
root@shdb1:/root>su - oracle
oracle@shdb1:/home/oracle>sqlplus / as sysdba
SQL> alter system set control_files='+DATADG/shinfo/control01.ctl','+DATADG/shinfo/control02.ctl','+DATADG/shinfo/control03.ctl' scope=spfile sid='*';
SQL> shutdown immediate;
6、启动数据库
oracle@shdb1:/home/oracle> srvctl start database -d shinfo
7、验证
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
+DATADG/shinfo/control01.ctl
+DATADG/shinfo/control02.ctl
+DATADG/shinfo/control03.ctl