ORACLE_OCP之ASM启停
一、ASM停止
-
在oracle用户下,以sysdba
[oracle@localhost.localdomain:/u01/database]$sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Thu Jan 7 10:53:04 2021
Copyright © 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> -
在grid用户下,以asm身份
[grid@localhost.localdomain:/home/grid]$sqlplus / as sysasm
SQL*Plus: Release 12.2.0.1.0 Production on Thu Jan 7 10:58:45 2021
Copyright © 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> -
关闭侦听
[grid@localhost.localdomain:/home/grid]$lsnrctl stop
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 07-JAN-2021 11:01:39
Copyright © 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The command completed successfully -
彻底的将asm关闭
[grid@localhost.localdomain:/home/grid]$crsctl stop has
二、ASM启动
-
打开asm
[grid@localhost.localdomain:/home/grid]$crsctl start has
CRS-4123: Oracle High Availability Services has been started. -
打开数据库
[oracle@localhost.localdomain:/u01/database]$sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Thu Jan 7 10:50:51 2021
Copyright © 1982, 2016, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 838860800 bytes
Fixed Size 8626240 bytes
Variable Size 352325568 bytes
Database Buffers 469762048 bytes
Redo Buffers 8146944 bytes
Database mounted.
Database opened.
SQL> -
启动侦听
[grid@localhost.localdomain:/home/grid]$lsnrctl start
-
已经打开
[grid@localhost.localdomain:/home/grid]$crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG.dg
ONLINE ONLINE localhost STABLE
ora.FRADG.dg
ONLINE ONLINE localhost STABLE
ora.LISTENER.lsnr
ONLINE ONLINE localhost STABLE
ora.asm
ONLINE ONLINE localhost Started,STABLE
ora.ons
OFFLINE OFFLINE localhost STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE localhost STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE localhost STABLE
ora.orcl.db
1 ONLINE ONLINE localhost Open,HOME=/u01/app/o
racle/product/12.2.0
/db_1,STABLE
--------------------------------------------------------------------------------
[grid@localhost.localdomain:/home/grid]$