CENTOS Linux Oracle 19.3 RAC 停止和启动 步骤
Oracle 19C RAC的停止:
1.使用oracle用户(在Oracle 19C RAC集群的其中一个节点操作):
[oracle@rac01 19.3.0]$ cd /u01/app/oracle/product/19.3.0/db_1/bin/
[oracle@rac01 bin]$ ./srvctl stop database -d cxmtdb
[root@rac01 ~]# /u01/app/19.3.0/grid/bin/crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac01'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac01'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server 'rac01'
CRS-2673: Attempting to stop 'ora.chad' on 'rac01'
CRS-33673: Attempting to stop resource group 'ora.asmgroup' on server 'rac01'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'rac01'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac01'
CRS-2673: Attempting to stop 'ora.MGMT.dg' on 'rac01'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac01'
CRS-2677: Stop of 'ora.DATA.dg' on 'rac01' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'rac01' succeeded
CRS-2677: Stop of 'ora.MGMT.dg' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac01'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.rac01.vip' on 'rac01'
CRS-2677: Stop of 'ora.asm' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac01'
CRS-2677: Stop of 'ora.rac01.vip' on 'rac01' succeeded
CRS-2677: Stop of 'ora.chad' on 'rac01' succeeded
CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.asmnet1.asmnetwork' on 'rac01'
CRS-2677: Stop of 'ora.asmnet1.asmnetwork' on 'rac01' succeeded
CRS-33677: Stop of resource group 'ora.asmgroup' on server 'rac01' succeeded.
CRS-2672: Attempting to start 'ora.rac01.vip' on 'rac02'
CRS-2676: Start of 'ora.rac01.vip' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'rac01'
CRS-2677: Stop of 'ora.ons' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'rac01'
CRS-2677: Stop of 'ora.net1.network' on 'rac01' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac01' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac01'
CRS-2673: Attempting to stop 'ora.crf' on 'rac01'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac01'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac01'
CRS-2677: Stop of 'ora.drivers.acfs' on 'rac01' succeeded
CRS-2677: Stop of 'ora.crf' on 'rac01' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'rac01' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac01'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac01'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac01'
CRS-2677: Stop of 'ora.evmd' on 'rac01' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac01'
CRS-2677: Stop of 'ora.cssd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.driver.afd' on 'rac01'
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac01'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac01'
CRS-2677: Stop of 'ora.driver.afd' on 'rac01' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'rac01' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'rac01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac01' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@rac02 /]# /u01/app/19.3.0/grid/bin/crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac02'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac02'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server 'rac02'
CRS-2673: Attempting to stop 'ora.qosmserver' on 'rac02'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac02'
CRS-2673: Attempting to stop 'ora.chad' on 'rac02'
CRS-33673: Attempting to stop resource group 'ora.asmgroup' on server 'rac02'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'rac02'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac02'
CRS-2673: Attempting to stop 'ora.MGMT.dg' on 'rac02'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac02'
CRS-2673: Attempting to stop 'ora.cvu' on 'rac02'
CRS-2673: Attempting to stop 'ora.rac02.vip' on 'rac02'
CRS-2677: Stop of 'ora.rac02.vip' on 'rac02' succeeded
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac02'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac02' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'rac02' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'rac02' succeeded
CRS-2677: Stop of 'ora.MGMT.dg' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac02'
CRS-2673: Attempting to stop 'ora.rac01.vip' on 'rac02'
CRS-2677: Stop of 'ora.scan1.vip' on 'rac02' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac02'
CRS-2677: Stop of 'ora.rac01.vip' on 'rac02' succeeded
CRS-2677: Stop of 'ora.cvu' on 'rac02' succeeded
CRS-2677: Stop of 'ora.qosmserver' on 'rac02' succeeded
CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.asmnet1.asmnetwork' on 'rac02'
CRS-2677: Stop of 'ora.asmnet1.asmnetwork' on 'rac02' succeeded
CRS-33677: Stop of resource group 'ora.asmgroup' on server 'rac02' succeeded.
CRS-2677: Stop of 'ora.chad' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'rac02'
CRS-2677: Stop of 'ora.ons' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'rac02'
CRS-2677: Stop of 'ora.net1.network' on 'rac02' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac02' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.storage' on 'rac02'
CRS-2673: Attempting to stop 'ora.crf' on 'rac02'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac02'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac02'
CRS-2677: Stop of 'ora.drivers.acfs' on 'rac02' succeeded
CRS-2677: Stop of 'ora.crf' on 'rac02' succeeded
CRS-2677: Stop of 'ora.storage' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac02'
CRS-2677: Stop of 'ora.mdnsd' on 'rac02' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac02'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac02'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac02'
CRS-2677: Stop of 'ora.ctssd' on 'rac02' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac02'
CRS-2677: Stop of 'ora.cssd' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.driver.afd' on 'rac02'
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac02'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac02'
CRS-2677: Stop of 'ora.driver.afd' on 'rac02' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'rac02' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'rac02' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac02' has completed
CRS-4133: Oracle High Availability Services has been stopped.
2.crsctl验证
[root@rac01 ~]# /u01/app/19.3.0/grid/bin/crsctl stat res -t
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.
[root@rac02 /]# /u01/app/19.3.0/grid/bin/crsctl stat res -t
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.
3.使用root用户关闭操作系统(在Oracle 19C RAC集群中的2个节点都需要做操作):
[root@rac01 /]# init 0
[root@rac02 /]# init 0
4.关闭共享存储
Oracle 19C RAC的启动:
1.启动共享存储的操作系统
2.打开操作系统(在Oracle 19C RAC集群中的2个节点都需要做操作)
3.使用root用户(在Oracle 19C RAC集群中的2个节点都需要做操作):
[root@rac01 ~]# /u01/app/19.3.0/grid/bin/crsctl start crs
[root@rac02 ~]# /u01/app/19.3.0/grid/bin/crsctl start crs
查看集群服务的启动状态:
[root@rac01 ~]# /u01/app/19.3.0/grid/bin/crsctl stat res -t
[root@rac02 ~]# /u01/app/19.3.0/grid/bin/crsctl stat res -t
4.使用oracle用户(在Oracle 19C RAC集群的其中一个节点操作):
[root@rac01 ~]# su - oracle
[oracle@rac01 ~]$ /u01/app/oracle/product/19.3.0/db_1/bin/srvctl start database -d cxmtdb
5.使用Oracle用户进行登录测试:
[oracle@rac01 ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Sep 21 09:37:41 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select inst_id, name, open_mode from gv$database;
INST_ID NAME OPEN_MODE
---------- ------------------ ----------------------------------------
2 CXMTDB READ WRITE
1 CXMTDB READ WRITE
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 HBHE MOUNTED
SQL> alter session set container = hbhe;
Session altered.
SQL> alter pluggable database open;
Pluggable database altered.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 HBHE READ WRITE NO
SQL> select inst_id, name, open_mode from gv$database;
INST_ID NAME OPEN_MODE
---------- ------------------ ----------------------------------------
1 CXMTDB READ WRITE
2 CXMTDB MOUNTED
SQL> select inst_id, name, open_mode from gv$database;
INST_ID NAME OPEN_MODE
---------- ------------------ ----------------------------------------
1 CXMTDB READ WRITE
2 CXMTDB READ WRITE
查看结果要保证数据库及实例处于READ WRITE可读写状态。