asm 健康检查 乱入-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3502525
  • 博文数量: 718
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7790
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(718)

文章存档

2024年(4)

2023年(74)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客
相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: oracle

2022-03-17 10:44:48

通过一些脚本检查asm 磁盘状态

  1. -- check asm disk
  2. -- example :@ac.sql datadg

  3. set ver off
  4. set lin 200 pages 100
  5. col diskgroup for a12
  6. col name for a30
  7. col value for a15
  8. select substr(dg.name,1,12) as diskgroup, substr(a.name,1,24) as name,
  9.      substr(a.value,1,24) as value, read_only from v$asm_diskgroup dg,
  10.      v$asm_attribute a where dg.name = '&1' and dg.group_number = a.group_number
  11.      and a.name not like '%template%';

  12. col asm_compat for a20
  13. col db_compat for a20
  14. col failgroup for a20
  15. select name as diskgroup, substr(compatibility,1,12) as asm_compat,
  16.      substr(database_compatibility,1,12) as db_compat,allocation_unit_size/1024/1024 au_size_m,type,state,total_mb,free_mb,offline_disks,voting_files from v$asm_diskgroup;

  17. col path for a30
  18. col name for a20
  19. col mount_status for a10
  20. col header_status for a12
  21. select group_number,name,path,mount_status,header_status,state,voting_file,total_mb,free_mb from v$asm_disk order by 1,2;

  22. col disk_name for a20
  23. select substr(dg.name,1,16) as diskgroup, substr(d.name,1,16) as disk_name,
  24.      d.mount_status, d.state, substr(d.failgroup,1,16) as failgroup
  25.      from v$asm_diskgroup dg, v$asm_disk d where dg.group_number = d.group_number;
  26.      
  27.  select substr(dgs.name,1,10) as diskgroup, substr(ds.name,1,10) as asmdisk,
  28.        ds.mount_status, ds.state, ds.reads, ds.writes, ds.read_time, ds.write_time,
  29.        bytes_read, bytes_written
  30.        from v$asm_diskgroup_stat dgs, v$asm_disk_stat ds
  31.        where dgs.group_number = ds.group_number and dgs.name = '&1';

  32. col instance for a15
  33. col dbname for a15
  34. col software for a20
  35. col compatible for a20
  36. select dg.name as diskgroup, substr(c.instance_name,1,12) as instance,
  37.     substr(c.db_name,1,12) as dbname, substr(c.software_version,1,12) as software,
  38.     substr(c.compatible_version,1,12) as compatible
  39.     from v$asm_diskgroup dg, v$asm_client c
  40.     where dg.group_number = c.group_number;
  41.     
  42. select dg.name as diskgroup, u.group_number, u.user_number, u.os_id, u.os_name
  43.      from v$asm_diskgroup dg, v$asm_user u
  44.      where dg.group_number = u.group_number and dg.name = '&1';
  45.      
  46. select dg.name as diskgroup, ug.group_number, ug.owner_number, u.os_name,
  47.      ug.usergroup_number, ug.name from v$asm_diskgroup dg, v$asm_user u, v$asm_usergroup ug
  48.      where dg.group_number = ug.group_number and dg.name = '&1'
  49.      and ug.owner_number = u.user_number;

  50. select dg.name as diskgroup, um.group_number, um.member_number, u.os_name,
  51.      um.usergroup_number, ug.name from v$asm_diskgroup dg, v$asm_user u, v$asm_usergroup_member um,
  52.      v$asm_usergroup ug where dg.group_number = um.group_number and
  53.      dg.group_number = ug.group_number and dg.group_number = u.group_number and dg.name = '&1'
  54.      and um.member_number = u.user_number and um.usergroup_number = ug.usergroup_number;

  55. select dg.name as diskgroup, a.name, f.permissions, f.user_number, u.os_name,
  56.        f.usergroup_number, ug.name
  57.      from v$asm_diskgroup dg, v$asm_user u, v$asm_usergroup ug, v$asm_file f, v$asm_alias a
  58.      where dg.name = '&1' and dg.group_number = u.group_number and
  59.        u.group_number = ug.group_number and ug.group_number = f.group_number and
  60.        f.group_number = a.group_number and
  61.        f.usergroup_number = ug.usergroup_number and f.user_number = u.user_number and
  62.        f.file_number = a.file_number;

  63. col error_code for a10
  64. select * from v$asm_operation;
  65.        
  66. --自动扩展是否合理(每次扩512m)
  67. col file_name for a60
  68. select distinct df.file_name from dba_data_files df, v$asm_alias a,
  69. (select ad.group_number, count(*) dg_num_disks, att.value, (count(*) * att.value) ext_size
  70. from v$asm_disk ad, v$asm_attribute att
  71. where ad.group_number=att.group_number
  72. and att.name = 'au_size'
  73. group by ad.group_number,att.value) v
  74. where autoextensible = 'yes'
  75. and status = 'available'
  76. and a.group_number=v.group_number
  77. and upper (df.file_name) in
  78. (select concat(' '||gname,sys_connect_by_path(aname, '/'))
  79. from (select vg.name gname, va.parent_index pindex, upper(va.name) aname, va.reference_index rindex, va.group_number gnum,va.file_number filnum
  80. from v$asm_alias va,v$asm_diskgroup vg
  81. where va.group_number = vg.group_number)
  82. start with (mod(pindex, power(2, 24))) = 0
  83. connect by prior rindex = pindex)
  84. and mod((df.increment_by * (select value from v$parameter where name = 'db_block_size')), v.ext_size) > 0;


以上方法不太完整,如果想获取所有asm相关信息需要以下脚本

调用示例:
su - grid
sqlplus / as sysasm @asm_meta
然后下载当前路径下的文件asm_metadata.html,用浏览器查看


调用示例:
su - grid
sh ./asmcmd_script.sh
然后查看 /tmp/asmcmd_script.out

参考:
怎样格式化收集以及备份 10.1,10.2,11.1,11.2 , 12.1和12.2 的 asm、acfs 元数据? (doc id 2226530.1)
阅读(555) | 评论(0) | 转发(0) |
0

上一篇:ocr 恢复

下一篇:诊断gridsetup.sh

给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图