欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

asminstnaceASMB

程序员文章站 2022-05-20 17:22:17
...

oracle 11g 2 如何停止ASM [oracle@rac1 ~]$ ps -ef|grep asm oracle 6089 1 0 15:39 ? 00:00:00 asm_pmon_+ASM --15 oracle 6093 1 0 15:39 ? 00:00:00 asm_vktm_+ASM oracle 6099 1 0 15:39 ? 00:00:00 asm_gen0_+ASM oracle 6103 1 0 15:39 ? 00:00:00 as

oracle 11g 2 如何停止ASM

[oracle@rac1 ~]$ ps -ef|grep asm

oracle 6089 1 0 15:39 ? 00:00:00 asm_pmon_+ASM --15
oracle 6093 1 0 15:39 ? 00:00:00 asm_vktm_+ASM
oracle 6099 1 0 15:39 ? 00:00:00 asm_gen0_+ASM
oracle 6103 1 0 15:39 ? 00:00:00 asm_diag_+ASM
oracle 6107 1 0 15:39 ? 00:00:00 asm_psp0_+ASM
oracle 6111 1 0 15:39 ? 00:00:00 asm_dia0_+ASM
oracle 6115 1 0 15:39 ? 00:00:00 asm_mman_+ASM
oracle 6119 1 0 15:39 ? 00:00:00 asm_dbw0_+ASM
oracle 6123 1 0 15:39 ? 00:00:00 asm_lgwr_+ASM
oracle 6127 1 0 15:39 ? 00:00:00 asm_ckpt_+ASM
oracle 6131 1 0 15:39 ? 00:00:00 asm_smon_+ASM
oracle 6135 1 0 15:39 ? 00:00:00 asm_rbal_+ASM
oracle 6139 1 0 15:39 ? 00:00:00 asm_gmon_+ASM
oracle 6143 1 0 15:39 ? 00:00:00 asm_mmon_+ASM
oracle 6147 1 0 15:39 ? 00:00:00 asm_mmnl_+ASM
oracle 6190 5782 0 15:40 pts/3 00:00:00 grep asm
[oracle@rac1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 31 15:46:03 2014

Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL> conn / as sysdba
Connected.
SQL> show parameter local

NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
local_listener string 【和数据库交互】【如果rac也没有配置 会有怎样的隐患呢】 【无】]

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option
[oracle@rac1 ~]$ srvctl start database -d asmdb
[oracle@rac1 ~]$ ps -ef|grep asm_
oracle 6089 1 0 15:39 ? 00:00:00 asm_pmon_+ASM
oracle 6093 1 0 15:39 ? 00:00:01 asm_vktm_+ASM
oracle 6099 1 0 15:39 ? 00:00:00 asm_gen0_+ASM
oracle 6103 1 0 15:39 ? 00:00:00 asm_diag_+ASM
oracle 6107 1 0 15:39 ? 00:00:00 asm_psp0_+ASM
oracle 6111 1 0 15:39 ? 00:00:00 asm_dia0_+ASM
oracle 6115 1 0 15:39 ? 00:00:00 asm_mman_+ASM
oracle 6119 1 0 15:39 ? 00:00:00 asm_dbw0_+ASM
oracle 6123 1 0 15:39 ? 00:00:00 asm_lgwr_+ASM
oracle 6127 1 0 15:39 ? 00:00:00 asm_ckpt_+ASM
oracle 6131 1 0 15:39 ? 00:00:00 asm_smon_+ASM
oracle 6135 1 0 15:39 ? 00:00:00 asm_rbal_+ASM
oracle 6139 1 0 15:39 ? 00:00:00 asm_gmon_+ASM
oracle 6143 1 0 15:39 ? 00:00:00 asm_mmon_+ASM
oracle 6147 1 0 15:39 ? 00:00:00 asm_mmnl_+ASM
oracle 6444 1 0 15:46 ? 00:00:00 asm_asmb_+ASM ---------------- 集群中 该进程不可以被随便杀了
oracle 6452 1 0 15:46 ? 00:00:00 asm_o000_+ASM ----------------
oracle 6448 1 0 15:46 ? 00:00:00 oracle+ASM_asmb_+asm (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 6452 1 0 15:46 ? 00:00:00 asm_o000_+ASM
oracle 6456 1 0 15:46 ? 00:00:00 oracle+ASM_o000_+asm (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 6577 1 0 15:46 ? 00:00:00 oracle+ASM_asmb_asmdb (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 6647 1 0 15:47 ? 00:00:00 oracle+ASM_o000_asmdb (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 6721 5782 0 15:47 pts/3 00:00:00 grep asm
[oracle@rac1 ~]$

ASM 实例比RDBMS 实例多2个进程: RBAL 和 ABRn。
RBAL: 这个进程也叫Rebalancer进程, 负责规划ASM 磁盘组的Reblance活动。
ABRn:是RBAL进程的子进程,这个进程在数量上可以有多个, n从1~9, 这组进程负责真正完成Reblance活动。

使用ASM 作为存储的RDBMS 实例也会多出2个进程: RBAL 和 ASMB
RBAL: 这个进程的主要功能是打开每个磁盘的所有磁盘和数据的Rebalance。
ASMB: 这个进程作为ASM 实例和数据库实例之间的信息通道。 这个进程负责与ASM 实例的通信,
它先利用Diskgroup Name 从CSS 获得管理该Diskgroup 的ASM 实例的连接串, 然后建立到ASM 的持久连接,
两个实例之间通过这条连接定期交换信息,同时也是一种心跳机制。

RDBMS 实例要想使用ASM 作为存储, RDBMS 实例必须在启动时从ASM 实例获得Extent Map,
以后发生磁盘组的维护操作, ASM 实例还要把Extent Map的更新信息通知给RDBMS 实例,
这2个实例间的信息交换就是他你哦刚过ASMB 进程完成的。 这也就为什么: ASM 实例必须要先于数据库实例启动,
和数据库实例同步运行,迟于数据库实例关闭。

rac2-> ps -ef|grep ASM
grid 5153 1 0 08:57 ? 00:00:00 asm_pmon_+ASM2
grid 5157 1 0 08:57 ? 00:00:02 asm_vktm_+ASM2
grid 5163 1 0 08:57 ? 00:00:00 asm_gen0_+ASM2
grid 5167 1 0 08:57 ? 00:00:01 asm_diag_+ASM2
grid 5171 1 0 08:57 ? 00:00:00 asm_ping_+ASM2
grid 5175 1 0 08:57 ? 00:00:00 asm_psp0_+ASM2
grid 5179 1 0 08:57 ? 00:00:03 asm_dia0_+ASM2
grid 5184 1 0 08:57 ? 00:00:02 asm_lmon_+ASM2
grid 5188 1 0 08:57 ? 00:00:01 asm_lmd0_+ASM2
grid 5194 1 0 08:57 ? 00:00:01 asm_lms0_+ASM2
grid 5200 1 0 08:57 ? 00:00:00 asm_lmhb_+ASM2
grid 5204 1 0 08:57 ? 00:00:00 asm_mman_+ASM2
grid 5208 1 0 08:57 ? 00:00:00 asm_dbw0_+ASM2
grid 5212 1 0 08:57 ? 00:00:00 asm_lgwr_+ASM2
grid 5216 1 0 08:57 ? 00:00:00 asm_ckpt_+ASM2
grid 5220 1 0 08:57 ? 00:00:00 asm_smon_+ASM2
grid 5224 1 0 08:57 ? 00:00:00 asm_rbal_+ASM2
grid 5228 1 0 08:57 ? 00:00:00 asm_gmon_+ASM2
grid 5232 1 0 08:57 ? 00:00:00 asm_mmon_+ASM2
grid 5236 1 0 08:57 ? 00:00:00 asm_mmnl_+ASM2
grid 5245 1 0 08:57 ? 00:00:00 asm_lck0_+ASM2
grid 5299 1 0 08:58 ? 00:00:00 asm_asmb_+ASM2
grid 5304 1 0 08:58 ? 00:00:00 oracle+ASM2_asmb_+asm2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
grid 5334 1 0 08:58 ? 00:00:00 oracle+ASM2_ocr (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))--DG关闭后关闭
grid 6428 6177 0 09:11 pts/2 00:00:00 grep ASM
rac2-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac1
ora....N2.lsnr ora....er.type ONLINE ONLINE rac2
ora....N3.lsnr ora....er.type ONLINE ONLINE rac2
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.eons ora.eons.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type ONLINE ONLINE rac1
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type OFFLINE OFFLINE
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.racdb.db ora....se.type ONLINE ONLINE rac1
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
ora.scan2.vip ora....ip.type ONLINE ONLINE rac2
ora.scan3.vip ora....ip.type ONLINE ONLINE rac2
rac2-> srvctl stop diskgroup -h

Stops the diskgroup.

Usage: srvctl stop diskgroup -g [-n ""] [-f]
-g Disk Group name
-n "" Comma separated node names
-f Force stop
-h Print usage
rac2-> srvctl stop diskgroup -g data -n rac2
rac2->
rac2->
rac2-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac1
ora....N2.lsnr ora....er.type ONLINE ONLINE rac2
ora....N3.lsnr ora....er.type ONLINE ONLINE rac2
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.eons ora.eons.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type ONLINE ONLINE rac1
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type OFFLINE OFFLINE
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.racdb.db ora....se.type ONLINE ONLINE rac1
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
ora.scan2.vip ora....ip.type ONLINE ONLINE rac2
ora.scan3.vip ora....ip.type ONLINE ONLINE rac2
rac2-> srvctl status diskgroup -g data
Disk Group data is running on rac1
rac2-> ps -ef|grep asm
grid 5153 1 0 08:57 ? 00:00:00 asm_pmon_+ASM2
grid 5157 1 0 08:57 ? 00:00:02 asm_vktm_+ASM2
grid 5163 1 0 08:57 ? 00:00:00 asm_gen0_+ASM2
grid 5167 1 0 08:57 ? 00:00:01 asm_diag_+ASM2
grid 5171 1 0 08:57 ? 00:00:00 asm_ping_+ASM2
grid 5175 1 0 08:57 ? 00:00:00 asm_psp0_+ASM2
grid 5179 1 0 08:57 ? 00:00:04 asm_dia0_+ASM2
grid 5184 1 0 08:57 ? 00:00:02 asm_lmon_+ASM2
grid 5188 1 0 08:57 ? 00:00:01 asm_lmd0_+ASM2
grid 5194 1 0 08:57 ? 00:00:01 asm_lms0_+ASM2
grid 5200 1 0 08:57 ? 00:00:00 asm_lmhb_+ASM2
grid 5204 1 0 08:57 ? 00:00:00 asm_mman_+ASM2
grid 5208 1 0 08:57 ? 00:00:00 asm_dbw0_+ASM2
grid 5212 1 0 08:57 ? 00:00:00 asm_lgwr_+ASM2
grid 5216 1 0 08:57 ? 00:00:00 asm_ckpt_+ASM2
grid 5220 1 0 08:57 ? 00:00:00 asm_smon_+ASM2
grid 5224 1 0 08:57 ? 00:00:00 asm_rbal_+ASM2
grid 5228 1 0 08:57 ? 00:00:00 asm_gmon_+ASM2
grid 5232 1 0 08:57 ? 00:00:00 asm_mmon_+ASM2
grid 5236 1 0 08:57 ? 00:00:00 asm_mmnl_+ASM2
grid 5245 1 0 08:57 ? 00:00:00 asm_lck0_+ASM2
grid 5299 1 0 08:58 ? 00:00:00 asm_asmb_+ASM2
grid 5304 1 0 08:58 ? 00:00:00 oracle+ASM2_asmb_+asm2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
grid 6584 6177 0 09:13 pts/2 00:00:00 grep asm

ORA-15097: cannot SHUTDOWN ASM instance with connected client

srvctl stop asm -n enode1 -f
PRCR-1014 : Failed to stop resource ora.asm
PRCR-1065 : Failed to stop resource ora.asm
CRS-2673: Attempting to stop 'ora.asm' on 'enode1'
ORA-15097: cannot SHUTDOWN ASM instance with connected client
CRS-2675: Stop of 'ora.asm' on 'enode1' failed
CRS-2675: Stop of 'ora.asm' on 'enode1' failed

RAC 环境是Oracle 11gR2。 在Metalink上搜了一下,明白咋回事了。 还是习惯的问题。

在Oracle 10g 环境下,我们停RAC的顺序是:
(1)数据库
(2)ASM
(3)CRS
但是在Oracle 11gR2下,如果是用OUI来安装的话,除了数据文件之外,OCR 也是放在ASM里的。 11gR2是支持RAW设备的,但是需要手动的安装。
所以这里就遇到了问题。 OCR也是放在ASM里的,这样CRSD 就会成为ASM的客户端。 如果我们像Oracle 10g里那样直接停ASM的时候,就会报上面的错误。 所以,在11gR2下面,要停ASM实例的话,只能和CRS一起停。
在root用户下执行:crsctl stop crs

注意:不要直接kill 掉ASM 进程,或者用shutdown abort 来关闭ASM 实例。 这样CRS 也会被挂掉。

[root@rac2 ~]# crsctl stop cluster -n rac2
CRS-2673: Attempting to stop 'ora.crsd' on 'rac2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac2'
CRS-2673: Attempting to stop 'ora.asm' on 'rac2'
CRS-2677: Stop of 'ora.asm' on 'rac2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac2' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac2'
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac2'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac2'
CRS-2673: Attempting to stop 'ora.asm' on 'rac2'
CRS-2677: Stop of 'ora.cssdmonitor' on 'rac2' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rac2' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac2' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac2'
CRS-2677: Stop of 'ora.cssd' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on 'rac2'
CRS-2677: Stop of 'ora.diskmon' on 'rac2' succeeded
[root@rac2 ~]# crsctl start cluster -n rac2
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac2'
CRS-2676: Start of 'ora.cssdmonitor' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac2'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac2'
CRS-2676: Start of 'ora.diskmon' on 'rac2' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'rac2'
CRS-2676: Start of 'ora.ctssd' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rac2'
CRS-2672: Attempting to start 'ora.evmd' on 'rac2'
CRS-2676: Start of 'ora.evmd' on 'rac2' succeeded
CRS-2676: Start of 'ora.asm' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'rac2'
CRS-2676: Start of 'ora.crsd' on 'rac2' succeeded
[root@rac2 ~]# ps -ef|grep pmon
grid 7946 1 0 09:31 ? 00:00:00 asm_pmon_+ASM2

root 8477 4642 0 09:32 pts/2 00:00:00 grep pmon

rac2-> srvctl modify listener -p 1522
rac2-> srvctl stop listener -n rac2
rac2-> srvctl start listener -n rac2

SQL> conn / as sysdba
Connected.
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip)(PORT=1521))))' sid='+ASM2';

System altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Real Application Clusters and Automatic Storage Management options
rac2-> srvctl modify listener -p 1521
rac2-> lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 01-AUG-2014 10:02:32

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 01-AUG-2014 09:57:21
Uptime 0 days 0 hr. 5 min. 11 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/rac2/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.32)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.52)(PORT=1522)))
The listener supports no services
The command completed successfully
rac2-> srvctl stop listener -n rac2
rac2-> srvctl start listener -n rac2