自动方式启停
crsctl stat res -t 查看ASM服务的状态,it's ok that ora.ons和ora.diskmon是OFFLINE
[[email protected]:/home/grid]$crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG.dg
ONLINE ONLINE centos7-19c STABLE
ora.LISTENER.lsnr
ONLINE ONLINE centos7-19c STABLE
ora.asm
ONLINE ONLINE centos7-19c Started,STABLE
ora.ons
OFFLINE OFFLINE centos7-19c STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE centos7-19c STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE centos7-19c STABLE
ora.orcl.db
1 ONLINE ONLINE centos7-19c Open,HOME=/u01/app/o
racle/product/19c/db
_1,STABLE
--------------------------------------------------------------------------------
停止ASM服务
crsctl stop has
has = High Availability Service
[[email protected]:/home/grid]$crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'centos7-19c'
CRS-2673: Attempting to stop 'ora.orcl.db' on 'centos7-19c'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'centos7-19c'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'centos7-19c' succeeded
CRS-2677: Stop of 'ora.orcl.db' on 'centos7-19c' succeeded
CRS-2673: Attempting to stop 'ora.DATADG.dg' on 'centos7-19c'
CRS-2677: Stop of 'ora.DATADG.dg' on 'centos7-19c' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'centos7-19c'
CRS-2673: Attempting to stop 'ora.asm' on 'centos7-19c'
CRS-2677: Stop of 'ora.evmd' on 'centos7-19c' succeeded
CRS-2677: Stop of 'ora.asm' on 'centos7-19c' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'centos7-19c'
CRS-2677: Stop of 'ora.cssd' on 'centos7-19c' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'centos7-19c' has completed
CRS-4133: Oracle High Availability Services has been stopped.
开启ASM服务
crsctl start has
[[email protected]:/home/grid]$crsctl start has
CRS-4123: Oracle High Availability Services has been started.
手动方式启停ASM
grid用户下关闭监听,因为监听只是运行在grid用户,和oracle用户没有关系
lsnrctl stop
[[email protected]:/home/grid]$lsnrctl stop
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 13-FEB-2023 21:06:47
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=centos7-19c)(PORT=1521)))
The command completed successfully
这时查看crsctl stat res -t , 可以看到listener已经OFFLINE。
[[email protected]:/home/grid]$crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG.dg
ONLINE ONLINE centos7-19c STABLE
ora.LISTENER.lsnr
OFFLINE OFFLINE centos7-19c STABLE
ora.asm
ONLINE ONLINE centos7-19c Started,STABLE
ora.ons
OFFLINE OFFLINE centos7-19c STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE centos7-19c STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE centos7-19c STABLE
ora.orcl.db
1 ONLINE ONLINE centos7-19c Open,HOME=/u01/app/o
racle/product/19c/db
_1,STABLE
--------------------------------------------------------------------------------
进入Oracle用户停止数据库
[[email protected]:/home/oracle]$sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Feb 13 21:08:28 2023
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> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
切换回grid用户,可以看到数据库已经停止
[[email protected]:/home/grid]$crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG.dg
ONLINE ONLINE centos7-19c STABLE
ora.LISTENER.lsnr
OFFLINE OFFLINE centos7-19c STABLE
ora.asm
ONLINE ONLINE centos7-19c Started,STABLE
ora.ons
OFFLINE OFFLINE centos7-19c STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE centos7-19c STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE centos7-19c STABLE
ora.orcl.db
1 OFFLINE OFFLINE STABLE
--------------------------------------------------------------------------------
在grid用户下, 使用sqlplus / as sysasm 链接, 使用shutdown immediate关闭ASM服务
[[email protected]:/home/grid]$sqlplus / as sysasm
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Feb 13 21:11:55 2023
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> shutdown immediate;
ASM diskgroups dismounted
ASM instance shutdown
目前只剩ora.cssd, ora.evmd是开启状态的。使用crsctl stop has关闭他们
[[email protected]:/home/grid]$crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'centos7-19c'
CRS-2673: Attempting to stop 'ora.evmd' on 'centos7-19c'
CRS-2677: Stop of 'ora.evmd' on 'centos7-19c' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'centos7-19c'
CRS-2677: Stop of 'ora.cssd' on 'centos7-19c' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'centos7-19c' has completed
CRS-4133: Oracle High Availability Services has been stopped.
手工启动ASM
手工关闭ASM后,grid用户使用crsctl start has 启动。
[[email protected]:/home/grid]$crsctl start has
CRS-4123: Oracle High Availability Services has been started.
切换到oracle用户启动数据库服务,
[[email protected]:/home/grid]$su - oracle
Password:
Last login: Mon Feb 13 21:08:22 CST 2023 on pts/0
[[email protected]:/home/oracle]$sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Feb 13 21:23:16 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 838858176 bytes
Fixed Size 8902080 bytes
Variable Size 222298112 bytes
Database Buffers 599785472 bytes
Redo Buffers 7872512 bytes
Database mounted.
Database opened.
然后切回grid,crsctl stat res -t 可以看到所有服务都已启动。
[[email protected]:/home/grid]$crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG.dg
ONLINE ONLINE centos7-19c STABLE
ora.LISTENER.lsnr
ONLINE ONLINE centos7-19c STABLE
ora.asm
ONLINE ONLINE centos7-19c Started,STABLE
ora.ons
OFFLINE OFFLINE centos7-19c STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE centos7-19c STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE centos7-19c STABLE
ora.orcl.db
1 ONLINE ONLINE centos7-19c Open,HOME=/u01/app/o
racle/product/19c/db
_1,STABLE
--------------------------------------------------------------------------------
标签:Oracle19C,STABLE,centos7,启停,grid,ASM,ONLINE,19c,ora
From: https://www.cnblogs.com/slqleozhang/p/17117850.html