oracleasm启动命令,Oracle单实例+ASM启动与关闭启动关闭注意顺序
启动顺序: CSS,HAS => ASM => DB
停⽌顺序:
DB
=
>
ASM  =>
CSS,HAS
启动:
⼀ 启动ASM 之前应该确保css,has 服务已经启动
检查CSS 服务是否启动:
[grid@node1 ~]$ crsctl check css
检查HAS 服务是否启动:
[grid@
node1~]$ crsctl check has
ora.cssd和ora.diskmon这2个服务是依赖于HAS维护的.
进⼀步查看各资源的状态
[grid@
node1~]$ crsctl stat res -t
检查ora.cssd 和ora.diskmon 的属性
[grid@
node1~]$ crs_stat -p ora.cssd
.
..
AUTO_START=never
...
[grid@
node1~]$ crs_stat -p ora.diskmon
...
AUTO_START=never
...
可以看到这两个资源的AUTO_START属性默认都设置为never,
也就是说他们不会随着HAS服务的启动⽽⾃动启动的,尽管默认情况下HAS服务是开机⾃动启动的.
⼿动启动
node1~]$ crsctl start resource ora.cssd
注:ora.cssd和ora.diskmon这两个服务是有依赖关系的,启动哪个都会把两个都起来.
其他操作
1)默认情况下HAS(High Availability Service)是⾃动启动的.
通过如下命令可以取消和启⽤⾃动启动
取消⾃启动:crsctl disable has
启⽤⾃启动:crsctl enable has
2)HAS⼿动启动和停⽌
crsctl start has
crsctl stop has
3)查看HAS的状态
crsctl check has
4)如果想让ora.css和ora.diskmon服务随着HAS的启动⽽⾃动启动,可以这两个服务的AUTO_START属性#crsctl modify resource "ora.cssd" -attr "AUTO_START=1"
或者
#crsctl modify resource "ora.diskmon" -attr "AUTO_START=1"
5)如果想取消ora.css和ora.diskmon的Auto start
#crsctl modify resource "ora.cssd" -attr "AUTO_START=never"
#crsctl modify resource "ora.diskmon" -attr "AUTO_START=never"
启动ASM 实例
[grid@
node1
~]$echo $ORACLE_SID
+ASM
[grid@
node1~]$ sqlplus / as sysasm
oracle登录命令SQL>  startup;
SQL>  select instance_name,status from v$instance;
INSTANCE_NAME      STATUS
---------------------  ---------------
+ASM                            STARTED
最后,启动数据库
[oracle@
~]$ echo $ORACLE_SID
prod1
[oracle@
node1~]$ sqlplus / as sysdba
SQL>  startup;
SQL>  select instance_name,status from v$instance; INSTANCE_NAME      STATUS
--------------------    ---------------
prod1                            OPEN
关闭顺序:
关闭数据库
[oracle@
node1~]$ sqlplus / as sysdba
SQL> shutdown immediate
关闭ASM
[root@
node1~]# su - grid
[grid@
node1~]$ sqlplus / as sysasm
SQL> shutdown immediate
关闭HAS
crsctl stop has
>>>>>>>
如果顺序反了,
关闭ASM,会报错
例如:
1 关闭ASM
[root@
node1~]# su - grid
[grid@
node1~]$ sqlplus / as sysasm
SQL> shutdown immediate
ORA-15097: cannot SHUTDOWN ASM instance with connected client (process 7322)⼀ 启动时,如果顺序有问题,没有启动ASM就打开数据库,
会报错
[oracle@node1 ~]$ sqlplus / as sysdba
SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+CRS/a'
ORA-17503: ksfdopn:2 Failed to open file +CRS/a
ORA-15077: could not locate ASM instance serving a required diskgroup
SQL> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown
2 启动数据库报错
[oracle@ogg1 ~]$ sqlplus / as sysdba
SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+SYSTEDG/a'
ORA-17503: ksfdopn:2 Failed to open file +SYSTEDG/a
ORA-15077: could not locate ASM instance serving a required diskgroup
正确的顺序是

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。

发表评论