oracle RAC控制文件多路复用

2022/2/9 19:29:09

本文主要是介绍oracle RAC控制文件多路复用,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

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

 



这篇关于oracle RAC控制文件多路复用的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程