ASM后台进程。学习随笔

基于10g ASM

1:后台进程

Ora10gASM-> ps -ef | grep +ASM |grep asm_
oracle 5277 1 0 19:30 ? 00:00:03 asm_pmon_+ASM
oracle 5279 1 0 19:30 ? 00:00:02 asm_psp0_+ASM
oracle 5281 1 0 19:30 ? 00:00:02 asm_mman_+ASM
oracle 5283 1 0 19:30 ? 00:00:03 asm_dbw0_+ASM
oracle 5285 1 0 19:30 ? 00:00:03 asm_lgwr_+ASM
oracle 5287 1 0 19:30 ? 00:00:04 asm_ckpt_+ASM
oracle 5289 1 0 19:30 ? 00:00:02 asm_smon_+ASM
oracle 5291 1 0 19:30 ? 00:00:03 asm_rbal_+ASM
oracle 5293 1 0 19:30 ? 00:00:07 asm_gmon_+ASM

PMON:用于监控ASM实例中进程,主要用于处理失效的进程。
PSPn:用于产生Oracle进程,
MMAN:与自动SGA管理有关,负责自动管理SGA。
DBWn:管理ASM实例的SGA buffer cache,DBWR负责将脏数据(changed metadata buffers)从ASM buffer cache写回磁盘。
LGWR:LGWR The LGWR process maintains the ASM Active Change Directory (ACD) buffers from the ASM instance and flushes ACD change records to disk.
CKPT:The CKPT process manages cross-instance calls (in RAC).
SMON:This process is the system monitor and also acts as a liaison to the Cluster Synchronization Services (CSS) process (in Oracle Clusterware) for node monitoring.
RBAL:负责协调磁盘组的Rebalance操作,RBAL调用ARBn(ARB0-ARBA)进程实际执行操作。
ARBn:负责实际执行Rebalance。

2:初始化参数
Ora10gASM-> strings spfile+ASM.ora
*.asm_diskgroups='DATA','FRA'
+ASM.asm_diskgroups='DATA','FRA','DATA2'#Manual Mount
*.background_dump_dest='/oracle/admin/+ASM/bdump'
*.core_dump_dest='/oracle/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/oracle/admin/+ASM/udump'

INSTANCE_TYPE:ASM实例要求此参数为ASM,隐含着将DB_UNIQUE_NAME设置为+ASM.
ASM_DISKSTRING:指定在磁盘发现过程应当查找的位置,默认值是NULL。
ASM_DISKGROUPS:指定在实例启动时要自动装载的磁盘组的名称,默认值是NULL。

Ora10gASM-> sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Wed May 28 21:07:19 2008

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

SQL> set linesize 120
SQL> col name for a30
SQL> col value for a20
SQL> col describ for a60
SQL> SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc describ
2 FROM SYS.x$ksppi x, SYS.x$ksppcv y
3 WHERE x.inst_id = USERENV ('Instance')
4 AND y.inst_id = USERENV ('Instance')
5 AND x.indx = y.indx
6 AND x.ksppinm LIKE '%&par%'
7 /
Enter value for par: asm
old 6: AND x.ksppinm LIKE '%&par%'
new 6: AND x.ksppinm LIKE '%asm%'

NAME VALUE DESCRIB
------------------------------ -------------------- ------------------------------------------------------------
asm_diskstring disk set locations for discovery
_asm_disk_repair_time 14400 seconds to wait before dropping a failing disk
asm_diskgroups DATA, FRA, DATA2 disk groups to mount automatically
asm_power_limit 1 number of processes for disk rebalancing
_asm_ausize 1048576 allocation unit size
_asm_blksize 4096 metadata block size
_asm_acd_chunks 1 initial ACD chunks created
_asm_libraries ufs library search order for discovery
_asm_maxio 1048576 Maximum size of individual I/O request
_asm_allow_only_raw_disks TRUE Discovery only raw devices
_asmlib_test 0 Osmlib test event
_asm_allow_resilver_corruption FALSE Enable disk resilvering for external redundancy
_asmsid asm ASM instance id
_asm_wait_time 18 Max/imum time to wait before asmb exits
_asm_stripewidth 8 ASM file stripe width
_asm_stripesize 131072 ASM file stripe size
_asm_droptimeout 60 timeout before offlined disks get dropped (in 3s ticks)
_asm_emulmax 10000 max number of concurrent disks to emulate I/O errors
_asm_emultimeout 0 timeout before emulation begins (in 3s ticks)
_asm_kfdpevent 0 KFDP event

20 rows selected.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

3:V$视图

SQL> select * from v$fixed_table where name like 'V$ASM%';

NAME OBJECT_ID TYPE TABLE_NUM
------------------------------ ---------- ----- ----------
V$ASM_TEMPLATE 4294951862 VIEW 65537
V$ASM_ALIAS 4294951865 VIEW 65537
V$ASM_FILE 4294951868 VIEW 65537
V$ASM_CLIENT 4294951873 VIEW 65537
V$ASM_DISKGROUP 4294951878 VIEW 65537
V$ASM_DISKGROUP_STAT 4294952652 VIEW 65537
V$ASM_DISK 4294951881 VIEW 65537
V$ASM_DISK_STAT 4294952654 VIEW 65537
V$ASM_OPERATION 4294951968 VIEW 65537

9 rows selected.

查看视图的定义,可以清楚的看到基表:
SQL> select * from v$fixed_view_definition where view_name like 'GV$ASM_%';

VIEW_NAME
------------------------------
VIEW_DEFINITION
--------------------------------------------------------------------------------
GV$ASM_TEMPLATE
select inst_id, group_kftmta, entry_kftmta, decode(redundancy_kftmta, 17, 'UNP
ROT', 18, 'MIRROR', 19, 'HIGH', 35, 'PARITY', 36, 'PARITY', 37, 'PARITY
', 38, 'PARITY'), decode(bitand(flags_kftmta, 1), 1, 'FINE', 'COARSE'), deco
de(bitand(flags_kftmta, 4), 4, 'Y', 'N'), name_kftmta from x$kftmta

GV$ASM_ALIAS
select inst_id, name_kfals, group_kfals, number_kfals, incarn_kfals, entnum_kfa
ls, entinc_kfals, parent_kfals, refer_kfals, decode(bitand(entflg_kfals, 12)
, 4, 'Y', 8, 'Y', 'N'), decode(bitand(entflg_kfals, 15), 1, 'N', 2, 'Y', 4, 'Y'
, 8, 'N') from x$kfals where decode(bitand(entflg_kfals, 12), 4, 'Y', 8, 'Y',
'N') = 'Y' OR decode(bitand(entflg_kfals, 16), 16, 'Y', 'N') = 'Y'

GV$ASM_FILE
select inst_id, group_kffil, number_kffil, compound_kffil, incarn_kffil, blk
siz_kffil, blkcnt_kffil, filsiz_kffil, filspc_kffil, sftype_kffil, decode(redu
n_kffil, 17, 'UNPROT', 18, 'MIRROR', 19, 'HIGH', 35, 'PARITY', 36, 'PAR
ITY', 37, 'PARITY', 38, 'PARITY'), decode(bitand(fdflg_kffil, 2), 2, 'FINE', '
COARSE'), crdate_kffil, mddate_kffil, decode(thinned_kffil, 0, 'U', 4294967295
, 'N', 'Y') from x$kffil where incarn_kffil <> 0 and number_kffil > 255

GV$ASM_CLIENT
select inst_id, gn_kfncl, instname_kfncl, dbname_kfncl, decode(status_kfncl, 1
, 'CONNECTED', 2, 'DISCONNECTED', 3, 'BROKEN'), softver_kfncl, compver_kfncl
from x$kfncl

GV$ASM_DISKGROUP
select g.inst_id, g.number_kfgrp, g.name_kfgrp, g.sector_kfgrp, g.blksize_kf
grp, g.ausize_kfgrp, decode(g.state_kfgrp, 0, 'INVALID', 1, 'UNKNOWN', 2,
'DISMOUNTED', 3, 'CREATING', 4, 'MOUNTING', 5, 'MOUNTED', 6, 'DISMOUNTING',
7, 'CONNECTED', 8, 'BROKEN', 9, 'CONNECTING', 10, 'BREAKING', 11, 'DROPPING'
), decode(g.type_kfgrp, 1, 'EXTERN', 2, 'NORMAL', 3, 'HIGH'), g.totmb_kfgrp,
g.freemb_kfgrp, g.minspc_kfgrp, g.usable_kfgrp, g.offline_kfgrp, decode(g.u
nbal_kfgrp, 0, 'N', 'Y'), g.compat_kfgrp, g.dbcompat_kfgrp from x$kfgrp g wher
e state_kfgrp != 0

GV$ASM_DISKGROUP_STAT
select g.inst_id, g.number_kfgrp, g.name_kfgrp, g.sector_kfgrp, g.blksize_kf
grp, g.ausize_kfgrp, decode(g.state_kfgrp, 0, 'INVALID', 1, 'UNKNOWN', 2,
'DISMOUNTED', 3, 'CREATING', 4, 'MOUNTING', 5, 'MOUNTED', 6, 'DISMOUNTING',
7, 'CONNECTED', 8, 'BROKEN', 9, 'CONNECTING', 10, 'BREAKING', 11, 'DROPPING'
), decode(g.type_kfgrp, 1, 'EXTERN', 2, 'NORMAL', 3, 'HIGH'), g.totmb_kfgrp,
g.freemb_kfgrp, g.minspc_kfgrp, g.usable_kfgrp, g.offline_kfgrp, decode(g.u
nbal_kfgrp, 0, 'N', 'Y'), g.compat_kfgrp, g.dbcompat_kfgrp from x$kfgrp_stat g
where state_kfgrp != 0

GV$ASM_DISK
select d.inst_id, d.grpnum_kfdsk, d.number_kfdsk, d.compound_kfdsk, d.incarn
_kfdsk, decode(d.mntsts_kfdsk, 1, 'MISSING', 2, 'CLOSED', 3, 'OPENED', 4, '
CACHED', 5, 'IGNORED', 6, 'IGNORED', 7, 'CLOSING', 'INVALID'), decode(d.hdr
sts_kfdsk, 1, 'UNKNOWN', 2, 'CANDIDATE', 3, 'MEMBER', 4, 'FORMER', 5, 'CON
FLICT', 6, 'INCOMPATIBLE', 7, 'PROVISIONED', 8, 'FOREIGN', 'INVALID'), deco
de(d.mode_kfdsk, 0, 'UNKNOWN', 4, 'OFFLINE', 5, 'PROTECT', 6, 'PENDING', 7
, 'ONLINE', 'INVALID'), decode(d.state_kfdsk, 1, 'UNKNOWN', 2, 'NORMAL', 3,
'FAILING', 4, 'DROPPING', 5, 'HUNG', 6, 'FORCING', 7, 'DROPPED', 8, 'ADDING'
, 'INVALID'), decode(d.redun_kfdsk, 16, 'UNPROT', 17, 'UNPROT', 18, 'MIRROR
', 19, 'MIRROR', 20, 'MIRROR', 21, 'MIRROR', 22, 'MIRROR', 23, 'MIRROR', 3
2, 'PARITY', 33, 'PARITY', 34, 'PARITY', 35, 'PARITY', 36, 'PARITY', 37, 'PAR
ITY', 38, 'PARITY', 39, 'PARITY', 'UNKNOWN'), d.libnam_kfdsk, d.totmb_kfdsk
, d.totmb_kfdsk - d.usedmb_kfdsk, d.asmname_kfdsk, d.failname_kfdsk, d.label_k
fdsk, d.path_kfdsk, d.udid_kfdsk, d.product_kfdsk, d.crdate_kfdsk, d.mtdate_kf
dsk, d.timer_kfdsk, k.read_kfkid, k.write_kfkid, k.rerr_kfkid, k.werr_kfkid,
k.rtime_kfkid/1000000, k.wtime_kfkid/1000000, k.bytesr_kfkid, k.bytesw_kfki
d from x$kfdsk d, x$kfkid k where d.mntsts_kfdsk != 0 and d.kfkid_kfdsk = k.id
ptr_kfkid(+)

GV$ASM_DISK_STAT
select d.inst_id, d.grpnum_kfdsk, d.number_kfdsk, d.compound_kfdsk, d.incarn
_kfdsk, decode(d.mntsts_kfdsk, 1, 'MISSING', 2, 'CLOSED', 3, 'OPENED', 4, '
CACHED', 5, 'IGNORED', 6, 'IGNORED', 7, 'CLOSING', 'INVALID'), decode(d.hdr
sts_kfdsk, 1, 'UNKNOWN', 2, 'CANDIDATE', 3, 'MEMBER', 4, 'FORMER', 5, 'CON
FLICT', 6, 'INCOMPATIBLE', 7, 'PROVISIONED', 8, 'FOREIGN', 'INVALID'), deco
de(d.mode_kfdsk, 0, 'UNKNOWN', 4, 'OFFLINE', 5, 'PROTECT', 6, 'PENDING', 7
, 'ONLINE', 'INVALID'), decode(d.state_kfdsk, 1, 'UNKNOWN', 2, 'NORMAL', 3,
'FAILING', 4, 'DROPPING', 5, 'HUNG', 6, 'FORCING', 7, 'DROPPED', 8, 'ADDING'
, 'INVALID'), decode(d.redun_kfdsk, 16, 'UNPROT', 17, 'UNPROT', 18, 'MIRROR
', 19, 'MIRROR', 20, 'MIRROR', 21, 'MIRROR', 22, 'MIRROR', 23, 'MIRROR', 3
2, 'PARITY', 33, 'PARITY', 34, 'PARITY', 35, 'PARITY', 36, 'PARITY', 37, 'PAR
ITY', 38, 'PARITY', 39, 'PARITY', 'UNKNOWN'), d.libnam_kfdsk, d.totmb_kfdsk
, d.totmb_kfdsk - d.usedmb_kfdsk, d.asmname_kfdsk, d.failname_kfdsk, d.label_k
fdsk, d.path_kfdsk, d.udid_kfdsk, d.product_kfdsk, d.crdate_kfdsk, d.mtdate_kf
dsk, d.timer_kfdsk, k.read_kfkid, k.write_kfkid, k.rerr_kfkid, k.werr_kfkid,
k.rtime_kfkid/1000000, k.wtime_kfkid/1000000, k.bytesr_kfkid, k.bytesw_kfki
d from x$kfdsk_stat d, x$kfkid k where d.mntsts_kfdsk != 0 and d.kfkid_kfdsk =
k.idptr_kfkid(+)

GV$ASM_OPERATION
select inst_id, number_kfgmg, decode(bitand(op_kfgmg, 64), 64, 'EXPEL', d
ecode(bitand(op_kfgmg, 32), 32, 'RFRSH', decode(bitand(op_kfgmg, 16), 16, 'A
CD', decode(bitand(op_kfgmg, 8), 8, 'DSCV', decode(bitand(op_kfgmg,
4), 4, 'SYNC', decode(bitand(op_kfgmg, 2), 2, 'COD', decode(
bitand(op_kfgmg, 1), 1, 'REBAL', 'NONE'))))))), decode(state_kfgmg,
1, 'WAIT', 2, 'RUN', 3, 'REAP', 4, 'WAIT', 5, 'HALT', 6, 'ERRS'), power_kfgmg
, actual_kfgmg, sofar_kfgmg, work_kfgmg, rate_kfgmg, time_kfgmg from x$kfgmg


9 rows selected.

1G在后台有了较多的改变,新增后台进程。

ACMS (atomic controlfile to memory service),每个势力都有的代理进程,在RAC环境下,对控制进程事务的提交和回退起到辅助作用。

DBRM(database resource manager),用于资源管理和资源计划相关的任务。

DIA0(diagnosbility process 0),目前只有0,没有其他进程,用于数据库挂起检测和死锁处理。

DLAG(diagnosability)进行诊断DUMP,执行全局oradebug命令。

EMNC(event monitor coordinator),用于数据库时间管理和发布进程。

FBDA(flashback data archiver process)闪回归档管理进程,用于将跟踪表的历史记录写入归档日志,管理闪回数据区空间。

GTX0-j(global transaction)在RAC环境中为XA全局事务提供透明的服务,只在RAC环境中出现。系统会根据XA事务的负载情况确定启动几个这种进程。

KATE,当磁盘离线时代理ASM metadat的I/O.

MARK,当写入一个离线磁盘出错时记录这个ALLOCATION UNIT为过期状态。

SMCO(space management coordinator)执行空间管理有关的作业,比如空间预分配和空间回收。可以动态生成Wnnn slave进程。

VKTM(virtual keeper of time )每秒更新一次时间,在高优先级情况下可以提供20毫秒的基准时间计算。

DSKM(slave diskmon)用于RDBMS和ASM实例之间的联系通道。MASTER diskmon守护进程处理I/O隔离信息,I/O资源管理计划将transaction commit cache信息传输SAGE存储,也用来在节点和sage存储服务器之间实现skgxp ant歇息。如果没有配置sage存储,diskmon slave进程会在实例启动后自动关闭

你可能感兴趣的:(ASM后台进程。学习随笔)