Oracle ASM 經常使用命令

01, 查看磁盤路徑

select name,path,group_number from v$asm_disk_stat;

02, 查看磁盤組信息

select state,name,type,total_mb, free_mb from v$asm_diskgroup_stat ;  

磁盤組狀態爲Mounted說明磁盤組狀態正常;spa

磁盤組的total_mb,free_mb爲非0說明能夠讀取磁盤信息,獲取磁盤大小。code

03,查看磁盤組操做

select * from v$asm_operation;

 04,查看磁盤組屬性

SELECT dg.name AS diskgroup,SUBSTR(a.name,1,18) AS name,SUBSTR(a.value,1,24) AS value, read_only FROM v$ASM_DISKGROUP_STAT dg,
v$ASM_ATTRIBUTE a WHERE dg.name = 'DATA' AND dg.group_number = a.group_number;

 05, 查看磁盤組的兼容屬性

SELECT name,COMPATIBILITY,DATABASE_COMPATIBILITY FROM V$ASM_DISKGROUP_STAT;

 06, 查看磁盤狀態

SELECT SUBSTR(d.name,1,16) AS asmdisk,d.mount_status,HEADER_STATUS, d.state,dg.name AS diskgroup FROM V$ASM_DISKGROUP_STAT  dg,V$ASM_DISK_STAT d WHERE dg.group_number = d.group_number; 

07,查看磁盤客戶端信息

SELECT dg.name AS diskgroup,SUBSTR(c.instance_name,1,12) AS instance,SUBSTR(c.db_name,1,12) AS dbname,SUBSTR(c.SOFTWARE_VERSION,1,12) AS software, SUBSTR(c.COMPATIBLE_VERSION,1,12) AS compatible FROM V$ASM_DISKGROUP_STAT  dg, V$ASM_CLIENT c WHERE dg.group_number = c.group_number;

 08, 查看磁盤訪問控制用戶信息

SELECT dg.name AS diskgroup, u.group_number,u.user_number, u.os_id, u.os_name FROM V$ASM_DISKGROUP_STAT  dg, V$ASM_USER u WHERE dg.group_number = u.group_number AND dg.name ='DATA';

09,查看磁盤訪問控制組信息

SELECT dg.name AS diskgroup, ug.group_number,ug.owner_number, u.os_name,ug.usergroup_number, ug.name FROM V$ASM_DISKGROUP_STAT dg,V$ASM_USER u, V$ASM_USERGROUP ug WHERE dg.group_number = ug.group_number AND dg.name ='DATA' AND ug.owner_number = u.user_number;

10,查看智能數據分佈信息 

SELECT dg.name AS diskgroup, f.file_number, f.primary_region,f.mirror_region,f.hot_reads,f.hot_writes, f.cold_reads, f.cold_writes FROM V$ASM_DISKGROUP_STAT  dg, V$ASM_FILE f WHERE dg.group_number = f.group_number and dg.name ='DATA';
相關文章
相關標籤/搜索