这篇文章将为大家详细讲解有关asm如何添加和删除磁盘,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
OS:solaris
oracle: 10G R2和11G R2
11G添加删除磁盘
##磁盘变更属组和权限
-bash-3.2# bash format.sh | awk -F. ‘{if(($1>=1)&&($1
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d0s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d1s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d2s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d3s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d4s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d5s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d6s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d7s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d8s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d9s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d10s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d11s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d12s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d13s6
chown grid:asmadmin /dev/rdsk/c9t50060E8012612D00d14s6
-bash-3.2# bash format.sh | awk -F. ‘{if(($1>=1)&&($1
chmod 660 /dev/rdsk/c9t50060E8012612D00d0s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d1s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d2s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d3s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d4s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d5s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d6s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d7s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d8s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d9s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d10s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d11s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d12s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d13s6
chmod 660 /dev/rdsk/c9t50060E8012612D00d14s6
##查看当前的磁盘组和磁盘信息
SQL> set linesize 300
SQL> set pages 1000
SQL> col name for a15
SQL> col path for a60
SQL> select adg.name,adg.TOTAL_MB group_TOTAL_MB,adg.free_mb group_free_mb,ad.path,ad.TOTAL_MB disk_totle_mb,ad.free_mb disk_free_mb from v$asm_diskgroup adg,v$asm_disk ad where adg.GROUP_NUMBER=ad.GROUP_NUMBER;
NAMEGROUP_TOTAL_MB GROUP_FREE_MB PATHDISK_TOTLE_MB DISK_FREE_MB
————— ————– ————- ———————————————————— ————- ————
ARCH_DG011095562923066 /dev/rdsk/c9t50060E80103511A0d10s6547781461538
ARCH_DG011095562923066 /dev/rdsk/c9t50060E80103511A0d0s6547781461528
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d14s6547781245046
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d1s6547781245050
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d2s6547781245050
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d3s6547781245048
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d4s6547781245061
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d5s6547781245066
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d6s6547781245047
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d7s6547781245051
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d8s6547781245066
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d12s6547781245055
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d11s6547781245053
DATA_DG0165733722940641 /dev/rdsk/c9t50060E80103511A0d13s6547781245048
FLASH_DG01547781547725 /dev/rdsk/c9t50060E80103511A0d9s6547781547725
15 rows selected.
##形成添加磁盘语句
-bash-3.2# bash format.sh | awk -F. ‘{if(($1>=1)&&($1
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d0s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d1s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d2s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d3s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d4s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d5s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d6s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d7s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d8s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d9s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d10s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d11s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d12s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d13s6’;
alter diskgroupadd disk ‘/dev/rdsk/c9t50060E8012612D00d14s6’;
##添加磁盘
oracle@cdb0cmsmcc01:~ $> su – grid
oracle@cdb0cmsmcc01:~ $> sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jan 22 10:25:08 2018
Copyright (c) 1982, 2011, Oracle.All rights reserved.
SQL> conn / as sysasm
SQL> alter diskgroup ARCH_DG01 add disk ‘/dev/rdsk/c9t50060E8012612D00d0s6′,’/dev/rdsk/c9t50060E8012612D00d1s6’;
SQL> alter diskgroup DATA_DG01 add disk
‘/dev/rdsk/c9t50060E8012612D00d2s6’,’/dev/rdsk/c9t50免费云主机域名060E8012612D00d3s6′,
‘/dev/rdsk/c9t50060E8012612D00d4s6′,’/dev/rdsk/c9t50060E8012612D00d5s6’,
‘/dev/rdsk/c9t50060E8012612D00d6s6′,’/dev/rdsk/c9t50060E8012612D00d7s6’,
‘/dev/rdsk/c9t50060E8012612D00d8s6′,’/dev/rdsk/c9t50060E8012612D00d9s6’,
‘/dev/rdsk/c9t50060E8012612D00d10s6′,’/dev/rdsk/c9t50060E8012612D00d11s6’,
‘/dev/rdsk/c9t50060E8012612D00d12s6′,’/dev/rdsk/c9t50060E8012612D00d13s6’;
SQL> alter diskgroup FLASH_DG01 add disk ‘/dev/rdsk/c9t50060E8012612D00d14s6’;
##删除磁盘
oracle@cdb0cmsmcc01:~ $> su – grid
oracle@cdb0cmsmcc01:~ $> sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jan 22 10:25:08 2018
Copyright (c) 1982, 2011, Oracle.All rights reserved.
SQL> conn / as sysasm
SQL> alter diskgroup ARCH_DG01 drop disk ‘ARCH_DG01_0000′,’ARCH_DG01_0001’;
Diskgroup altered.
SQL> select * from v$asm_operation;
GROUP_NUMBER OPERA STATPOWERACTUALSOFAREST_WORKEST_RATE EST_MINUTES ERROR_CODE
———— —– —- ———- ———- ———- ———- ———- ———– ——————————————–
1 REBAL RUN11197575298663315
SQL> alter diskgroup DATA_DG01 drop disk
2’DATA_DG01_0000′,
3’DATA_DG01_0001′,
4’DATA_DG01_0002′,
5’DATA_DG01_0003′,
6’DATA_DG01_0004′,
7’DATA_DG01_0005′,
8’DATA_DG01_0006′,
9’DATA_DG01_0007′,
10’DATA_DG01_0008′,
11’DATA_DG01_0009′,
12’DATA_DG01_0010′,
13’DATA_DG01_0011′ rebalance power 6;
SQL> select * from v$asm_operation;
GROUP_NUMBER OPERA STATPOWERACTUALSOFAREST_WORKEST_RATE EST_MINUTES ERROR_CODE
———— —– —- ———- ———- ———- ———- ———- ———– ——————————————–
2 REBAL RUN66148317907553137504
10G添加删除磁盘
##变更属组和权限
-bash-3.2# bash format.sh | awk -F. ‘{if(($1>=3)&&($1
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d0s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d1s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d2s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d3s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d4s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d5s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d6s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d7s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d8s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d9s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d10s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d11s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d12s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d13s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d14s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d15s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d16s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d17s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d18s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d19s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d20s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d21s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d22s6
chown oracle:oinstall /dev/rdsk/c12t50060E8012612D00d23s6
-bash-3.2# bash format.sh | awk -F. ‘{if(($1>=3)&&($1
chmod 640 /dev/rdsk/c12t50060E8012612D00d0s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d1s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d2s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d3s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d4s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d5s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d6s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d7s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d8s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d9s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d10s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d11s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d12s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d13s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d14s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d15s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d16s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d17s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d18s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d19s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d20s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d21s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d22s6
chmod 640 /dev/rdsk/c12t50060E8012612D00d23s6
##查看当前磁盘组和磁盘信息
set linesize 300
set pages 1000
col name for a15
col path for a60
select adg.name,adg.TOTAL_MB group_TOTAL_MB,adg.free_mb group_free_mb,ad.path,ad.TOTAL_MB disk_totle_mb,ad.free_mb disk_free_mb from v$asm_diskgroup adg,v$asm_disk ad where adg.GROUP_NUMBER=ad.GROUP_NUMBER;
NAMEGROUP_TOTAL_MB GROUP_FREE_MB PATHDISK_TOTLE_MB DISK_FREE_MB
————— ————– ————- ———————————————————— ————- ————
ARCH_DG0121911241863341 /dev/rdsk/c12t50060E80103511A0d21s65477810
ARCH_DG0121911241863341 /dev/rdsk/c12t50060E80103511A0d19s65477810
ARCH_DG0121911241863341 /dev/rdsk/c12t50060E80103511A0d20s65477810
ARCH_DG0121911241863341 /dev/rdsk/c12t50060E80103511A0d18s65477810
DATA_DG014930029946612 /dev/rdsk/c12t50060E80103511A0d1s65477810
DATA_DG014930029946612 /dev/rdsk/c12t50060E80103511A0d6s65477810
DATA_DG014930029946612 /dev/rdsk/c12t50060E80103511A0d7s65477810
DATA_DG014930029946612 /dev/rdsk/c12t50060E80103511A0d22s65477810
DATA_DG014930029946612 /dev/rdsk/c12t50060E80103511A0d2s65477810
DATA_DG014930029946612 /dev/rdsk/c12t50060E80103511A0d3s65477810
DATA_DG014930029946612 /dev/rdsk/c12t50060E80103511A0d4s65477810
DATA_DG014930029946612 /dev/rdsk/c12t50060E80103511A0d5s65477810
DATA_DG014930029946612 /dev/rdsk/c12t50060E80103511A0d0s65477810
DATA_DG024930029952264 /dev/rdsk/c12t50060E80103511A0d23s65477810
DATA_DG024930029952264 /dev/rdsk/c12t50060E80103511A0d9s65477810
DATA_DG024930029952264 /dev/rdsk/c12t50060E80103511A0d8s65477810
DATA_DG024930029952264 /dev/rdsk/c12t50060E80103511A0d15s65477810
DATA_DG024930029952264 /dev/rdsk/c12t50060E80103511A0d14s65477810
DATA_DG024930029952264 /dev/rdsk/c12t50060E80103511A0d13s65477810
DATA_DG024930029952264 /dev/rdsk/c12t50060E80103511A0d12s65477810
DATA_DG024930029952264 /dev/rdsk/c12t50060E80103511A0d11s65477810
DATA_DG024930029952264 /dev/rdsk/c12t50060E80103511A0d10s65477810
FLASH_DG011095562273752 /dev/rdsk/c12t50060E80103511A0d16s65477810
FLASH_DG011095562273752 /dev/rdsk/c12t50060E80103511A0d17s65477810
##添加磁盘
oracle@ofs0accmcc01:~ $> export ORACLE_SID=+ASM
oracle@ofs0accmcc01:~ $> sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 – Production on Mon Jan 22 10:59:38 2018
Copyright (c) 1982, 2007, Oracle.All Rights Reserved.
SQL> conn / as sysdba
Connected.
SQL> show parameter name
NAMETYPEVALUE
———————————— ———– ——————————
db_file_name_convertstring
db_namestring
db_unique_namestring+ASM
global_namesbooleanFALSE
instance_namestring+ASM
lock_name_spacestring
log_file_name_convertstring
service_names
SQL> alter diskgroup ARCH_DG01 add disk ‘/dev/rdsk/c12t50060E8012612D00d0s6′,’/dev/rdsk/c12t50060E8012612D00d1s6′,’/dev/rdsk/c12t50060E8012612D00d2s6′,’/dev/rdsk/c12t50060E8012612D00d3s6’;
SQL> alter diskgroup DATA_DG01 add disk
‘/dev/rdsk/c12t50060E8012612D00d4s6′,’/dev/rdsk/c12t50060E8012612D00d5s6’,
‘/dev/rdsk/c12t50060E8012612D00d6s6′,’/dev/rdsk/c12t50060E8012612D00d7s6’,
‘/dev/rdsk/c12t50060E8012612D00d8s6′,’/dev/rdsk/c12t50060E8012612D00d9s6’,
‘/dev/rdsk/c12t50060E8012612D00d10s6′,’/dev/rdsk/c12t50060E8012612D00d11s6’,
‘/dev/rdsk/c12t50060E8012612D00d12s6’;
SQL> alter diskgroup DATA_DG02 add disk
‘/dev/rdsk/c12t50060E8012612D00d13s6′,’/dev/rdsk/c12t50060E8012612D00d14s6’,
‘/dev/rdsk/c12t50060E8012612D00d15s6′,’/dev/rdsk/c12t50060E8012612D00d16s6’,
‘/dev/rdsk/c12t50060E8012612D00d17s6′,’/dev/rdsk/c12t50060E8012612D00d18s6’,
‘/dev/rdsk/c12t50060E8012612D00d19s6′,’/dev/rdsk/c12t50060E8012612D00d20s6’,
‘/dev/rdsk/c12t50060E8012612D00d21s6’;
SQL> alter diskgroup FLASH_DG01 add disk ‘/dev/rdsk/c12t50060E8012612D00d22s6’,’/dev/rdsk/c12t50060E8012612D00d23s6’;
##删除磁盘
oracle@ofs0accmcc01:~/admin/BEIMCCE/bdump $> export ORACLE_SID=+ASM
oracle@ofs0accmcc01:~ $> sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 – Production on Mon Jan 22 10:59:38 2018
Copyright (c) 1982, 2007, Oracle.All Rights Reserved.
SQL> conn / as sysdba
Connected.
SQL> show parameter name
NAMETYPEVALUE
———————————— ———– ——————————
db_file_name_convertstring
db_namestring
db_unique_namestring+ASM
global_namesbooleanFALSE
instance_namestring+ASM
lock_name_spacestring
log_file_name_convertstring
service_namesstring+ASM
SQL> alter diskgroup ARCH_DG01 drop disk
2’ARCH_DG01_0000′,
3’ARCH_DG01_0001′,
4’ARCH_DG01_0002′,
5’ARCH_DG01_0003′ rebalance power 6;
Diskgroup altered.
SQL> set linesize 300
SQL> select * from v$asm_operation;
GROUP_NUMBER OPERA STATPOWERACTUALSOFAREST_WORKEST_RATE EST_MINUTES
———— —– —- ———- ———- ———- ———- ———- ———–
1 REBAL RUN663471127806463326
SQL> alter diskgroup DATA_DG01 drop disk
2’DATA_DG01_0000′,
3’DATA_DG01_0001′,
4’DATA_DG01_0002′,
5’DATA_DG01_0003′,
6’DATA_DG01_0004′,
7’DATA_DG01_0005′,
8’DATA_DG01_0006′,
9’DATA_DG01_0007′,
10’DATA_DG01_0008′ rebalance power 6;
Diskgroup altered.
SQL> alter diskgroup DATA_DG02 drop disk
2’DATA_DG02_0000′,
3’DATA_DG02_0001′,
4’DATA_DG02_0002′,
5’DATA_DG02_0003′,
6’DATA_DG02_0004′,
7’DATA_DG02_0005′,
8’DATA_DG02_0006′,
9’DATA_DG02_0007′,
10’DATA_DG02_0008′ rebalance power 6;
Diskgroup altered.
SQL> select * from v$asm_operation;
GROUP_NUMBER OPERA STATPOWERACTUALSOFAREST_WORKEST_RATE EST_MINUTES
———— —– —- ———- ———- ———- ———- ———- ———–
2 REBAL RUN6614428619952424154445
3 REBAL WAIT60000445
SQL> alter diskgroup FLASH_DG01 drop disk ‘FLASH_DG01_0000′,’FLASH_DG01_0001’ rebalance power 6;
Diskgroup altered.
SQL> select * from v$asm_operation;
GROUP_NUMBER OPERA STATPOWERACTUALSOFAREST_WORKEST_RATE EST_MINUTES
———— —– —- ———- ———- ———- ———- ———- ———–
4 REBAL RUN662714055292539159 关于“asm如何添加和删除磁盘”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
相关推荐: PostgreSQL DBA常用SQL查询语句有哪些
本篇内容介绍了“PostgreSQL DBA常用SQL查询语句有哪些”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!查看帮助命令DB=# help –总的帮助D…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。