asm磁盘组,asm磁盘状态学习
Posted lvcha001
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了asm磁盘组,asm磁盘状态学习相关的知识,希望对你有一定的参考价值。
说明:在数据库中巡检,发现,数据库某个磁盘组状态为mount,其余磁盘组均为CONNECTED状态,排除是否异常
文档流程:
1.实际环境查询校验
2.官方文档视图中对磁盘组,磁盘状态的解释说明
3.对于asm磁盘组相关的维护命令学习
1.实际环境查询校验
$uname -a AIX P570_2_1 1 6 00C7B8B64C00 $ifconfig -a 查询发现某个ASM磁盘组,状态为mount,而非connected SQL> select group_number,name,total_mb/1024 TOTAL_GB, free_mb/1024 FREE_GB,free_mb/total_mb*100 free_percent,state,TYPE, (case when free_mb/total_mb*100 < 15 then ‘*‘ else ‘‘ end ) care from v$ASM_DISKGROUP; GROUP_NUMBER NAME TOTAL_GB FREE_GB FREE_PERCENT STATE TYPE C ------------ ------------------------------ ---------- ---------- ------------ --------------- ------ - 1 DG15 1700.00 246.29 14.49 CONNECTED EXTERN * 2 DG16 1700.00 169.05 9.94 MOUNTED EXTERN * -- 3 DG1 6953.13 173.87 2.50 CONNECTED EXTERN * 4 DG2 1738.28 149.64 8.61 CONNECTED EXTERN * 查询ASM磁盘对应的块设备名称,检查mount状态对应的磁盘状态,正常现象 SQL> select DISK_NUMBER,B.NAME GROUP_NAME,a.name diskname,a.free_MB/1024 FREE_GB,a.TOTAL_MB/1024 TOTAL_GB, a.free_mb/a.total_mb*100 free_percentage ,a.path,A.STATE FROM V$ASM_DISK A,V$ASM_DISKGROUP B WHERE A.GROUP_NUMBER=B.GROUP_NUMBER order by b.name,DISK_NUMBER; DISK_NUMBER GROUP_NAME DISKNAME FREE_GB TOTAL_GB FREE_PERCENTAGE PATH STATE ----------- -------------------- -------------------- ---------- -------------- --------------------- -------------------- ---------------- 0 DG1 DG1_0000 43.4648438 1738 3 /dev/rhdiskpower10 NORMAL 1 DG1 DG1_0001 43.4658203 1738 3 /dev/rhdiskpower11 NORMAL 2 DG1 DG1_0002 43.4746094 1738 3 /dev/rhdiskpower12 NORMAL 3 DG1 DG1_0003 43.46875 1738 3 /dev/rhdiskpower13 NORMAL 0 DG15 DG15_0000 246.001953 1700 14 /dev/rhdiskpower15 NORMAL 0 DG16 DG16_0000 122.675781 1700 7 /dev/rhdiskpower16 NORMAL -- 0 DG2 DG2_0000 149.051758 1738 9 /dev/rhdiskpower14 NORMAL 7 rows selected. 根据ASM——Alert日志进行查询,截取如下部分信息。 Fri Jan 25 19:29:03 GMT+08:00 2019NOTE: start heartbeating (grp 2) NOTE: cache opening disk 0 of grp 2: DG16_0000 path:/dev/rhdiskpower16 Fri Jan 25 19:29:03 GMT+08:00 2019NOTE: F1X0 found on disk 0 fcn 0.0 NOTE: cache mounting (first) group 2/0x9866E885 (DG16) * allocate domain 2, invalid = TRUE Fri Jan 25 19:29:04 GMT+08:00 2019NOTE: attached to recovery domain 2 Fri Jan 25 19:29:04 GMT+08:00 2019NOTE: starting recovery of thread=1 ckpt=1908.956 group=2 NOTE: advancing ckpt for thread=1 ckpt=1908.956 NOTE: cache recovered group 2 to fcn 0.172316046 Fri Jan 25 19:29:04 GMT+08:00 2019NOTE: LGWR attempting to mount thread 1 for disk group 2 NOTE: LGWR mounted thread 1 for disk group 2 NOTE: opening chunk 1 at fcn 0.172316046 ABA NOTE: seq=1909 blk=957 Fri Jan 25 19:29:04 GMT+08:00 2019NOTE: cache mounting group 2/0x9866E885 (DG16) succeeded SUCCESS: diskgroup DG16 was mounted ASM磁盘组成功挂载
--查询oracle文件是否存储该磁盘组上 SQL> show parameter control NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ control_file_record_keep_time integer 70 control_files string +DG1/wgdb/controlfile/current. 256.871326685, +DG2/wgdb/contr olfile/current.256.871326685 SQL> show parameter spfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string +DG1/wgdb/spfilewgdb.ora
--发现归档目录存储路径 SQL> select member from v$Logfile; node1: SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination +DG16 Oldest online log sequence 264927 Next log sequence to archive 264934 Current log sequence 264934 SQL>select name from v$archived_log where thread#=1 and sequence#=264927; NAME ---------------------------------------------------------------------- /nxxx/archive_147_148_1_264927_871326679.arc +DG16/xxx/thread_1_seq_264927.4364.998636625 node2: SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination +DG16 Oldest online log sequence 351469 Next log sequence to archive 351476 Current log sequence 351476 手工切换当前实例所在的日志组,进行切换。 SQL> alter system switch logfile; System altered. SQL> select group_number,name,total_mb/1024 TOTAL_GB, free_mb/1024 FREE_GB,free_mb/total_mb*100 free_percent,state,TYPE, (case when free_mb/total_mb*100 < 15 then ‘*‘ else ‘‘ end ) care from v$ASM_DISKGROUP GROUP_NUMBER NAME TOTAL_GB FREE_GB FREE_PERCENT STATE TYPE C ------------ ---------------------------------------- -------------- --------- ------------ --------------- ------ - 1 DG15 1700 246.00 14.47 CONNECTED EXTERN * 2 DG16 1700 122.47 7.20 CONNECTED EXTERN *
3 DG1 6953 173.87 2.50 CONNECTED EXTERN *
4 DG2 1738 149.05 8.57 CONNECTED EXTERN *
结论,oracle 磁盘组,mount状态即可,而connected代表磁盘组正在活动,因此Mount or connected状态均为正常现象。
2.官方文档视图中对磁盘组,磁盘状态的解释说明
V$ASM_DISKGROUP
GROUP_NUMBER 集群指定的磁盘组编号
name 磁盘组名称
sector_size 物理设备块大小512字节
block_size Automatic Storage Management metadata ASM元数据存储大小4096,4K
ALLOCATION_UNIT_SIZE oracle asm存储分配的一个单位,1M大小(AUsize)
state --
-
CONNECTED
- Disk group is in use by the database instance 正在被实例使用,正在处理数据 MOUNTED
- Instance is successfully serving the disk group to its database clients 磁盘组成功的挂载在数据库上,可以使用-
BROKEN
- Database instance lost connectivity to the Automatic Storage Management instance that mounted the disk group ASM与磁盘组的连接是失败的,无法连接 -
UNKNOWN
- Automatic Storage Management instance has never attempted to mount the disk group ASM实例根本不知道有这个东西,从来不尝试Mount挂载该磁盘组 -
DISMOUNTED
- Disk group was cleanly dismounted by the Automatic Storage Management instance following a successful mount 磁盘组被干净利落的,断开与asm实例的连接,一般情况下关闭asm实例等情况
type 冗余类型EXTERN/NORMAL/HIGH 一份数据,存储一份;一份数据,存储两份;一份数据,存储三份。
total_mb 磁盘组总大小 mb
free_mb 磁盘组剩余可用大小 mb
required_mirror_free_mb
Amount of space that is required to be available in a given disk group in order to restore redundancy after one or more disk failures. The amount of space displayed in this column takes mirroring effects into account. |
USABLE_FILE_MB 在考虑镜像的情况下,可以安全使用的空闲空间量,并且能够在磁盘故障后恢复冗余
offline_disks 磁盘中offline状态的数量
UNBALANCED 磁盘组是否需要重新平衡y or n
COMPATIBILITY ASM实例ASM磁盘组允许mount挂载,所支持的最低版本 (10.2.0.5 生产环境,显示数值10.1.0.0.0)DATABASE_COMPATIBILITY 数据库实例ASM磁盘组允许mount挂载,所支持的最低版本 (10.2.0.5 生产环境,显示数值10.1.0.0.0)(oracle 升级时,11g asm可用存储10g db的数据涉及asm自带的版本参数,本次参数涉及到的与asm磁盘组能否挂载有关)
v$asm_disk group_number 磁盘所在磁盘组的编号,从1开始递增
disk_number 磁盘在磁盘组中的编号,第一块磁盘从0号开始
compound_index A 32-bit number consisting of a disk group number in the high-order 8 bits and a disk number in the low-order 24 bits (for efficient access to the view)
不理解, --https://wenku.baidu.com/view/343fde214a7302768e9939f1.html
MOUNT_STATUS
-
MISSING
- Automatic Storage Management metadata indicates that the disk is known to be part of the Automatic Storage Management disk group, but no disk in the storage system was found with the indicated name -
---ASM磁盘组认为是一部分,但是操作系统并未找到该磁盘
-
CLOSED
- Disk is present in the storage system but is not being accessed by Automatic Storage Management - ---存储系统中存在磁盘,但自动存储管理无法访问磁盘
-
OPENED
- Disk is present in the storage system and is being accessed by Automatic Storage Management. This is the normal state for disks in a database instance which are part of a Disk Group being actively used by the instance. - ---正常访问状态,opened
-
CACHED
- Disk is present in the storage system, and is part of a disk group being accessed by the Automatic Storage Management instance. This is the normal state for disks in an Automatic Storage Management instance which are part of a mounted disk group. - ---正在使用,cache交互存在
-
IGNORED
- Disk is present in the system, but is ignored by ASM because of one of the following:- The disk is detected by the system library, but is ignored because an ASM library discovered the same disk
- ASM has determined that the membership claimed by the disk header is no longer valid
- ---已废弃的磁盘,无法再次使用,检测到磁盘,但是无法使用
-
CLOSING
- ASM is in the process of closing this disk - --ASM实例正在关闭磁盘
Header_status
-
UNKNOWN
- 尚未读取自动存储管理磁盘标头 -
CANDIDATE
- 磁盘不是磁盘组的一部分,可以使用该ALTER DISKGROUP
语句添加到磁盘组 空闲磁盘,新增加的磁盘正常状态 -
INCOMPATIBLE
- 磁盘标头中的版本号与自动存储管理软件版本不兼容。 -
PROVISIONED
- 磁盘不是磁盘组的一部分,可以使用该ALTER DISKGROUP
语句添加到磁盘组。该PROVISIONED
头状态是从不同的CANDIDATE
标题状态在PROVISIONED
暗示一个额外的特定于平台的行动已经采取的管理员,以供自动存储管理磁盘。 -
MEMBER
- 磁盘是现有磁盘组的成员。不应尝试将磁盘添加到其他磁盘组。ALTER DISKGROUP
除非被FORCE
选项覆盖,否则该声明将拒绝此类添加 -
FORMER
- 磁盘曾经是磁盘组的一部分,但已从组中干净地丢弃。可以使用该ALTER DISKGROUP
语句将其添加到新磁盘组。 -
CONFLICT
- 由于冲突未安装自动存储管理磁盘 -
FOREIGN
- 磁盘包含由ASM以外的Oracle产品创建的数据。这包括数据文件,日志文件和OCR磁盘。【以前生产环境遇到过一次,存储将一个旧的asm磁盘划分到需要扩容的db时,添加失败,发现磁盘状态为已使用,dd清空后再次添加】
STATE
-
UNKNOWN
- 自动存储管理磁盘状态未知(通常未安装磁盘) -
NORMAL
- 磁盘在线并正常运行 -
ADDING
- 磁盘正被添加到磁盘组,并且正在等待已安装磁盘组的所有实例的验证 -
DROPPING
- 磁盘已手动脱机,磁盘的空间分配或数据访问停止。重新平衡将开始将数据从磁盘重定位到磁盘组中的其他磁盘。完成重新平衡后,磁盘将从组中排出。 -
HUNG
- 磁盘丢弃操作无法继续,因为没有足够的空间从被删除的磁盘重新定位数据 -
FORCING
- 磁盘正在从磁盘组中删除,而不尝试卸载其数据。在可能的情况下,将从冗余副本中恢复数据。 -
DROPPED
- 磁盘已完全从磁盘组中驱逐
MODE_STATUS
online 可以使用,可正常读写
offline 无法使用
3.对于asm磁盘组相关的维护命令学习
SQL> alter diskgroup data_dg rebalance power 11;
SQL> alter diskgroup data_dg add disk ‘/dev/asm-diskh‘ rebalance power 8;
SQL> alter diskgroup data_dg drop disk ‘DATA_DG_0002‘; --按照name来删除
或:SQL> alter diskgroup data_dg drop disk ‘DATA_DG_0002‘ rebalance power 8;
以上是关于asm磁盘组,asm磁盘状态学习的主要内容,如果未能解决你的问题,请参考以下文章
Oracle11g添加asm磁盘到asm磁盘组,发现添加错误如何删除新添加到磁盘?
oracle 11g 从+DATA迁移到+newdata ASM 磁盘组迁移