正德厚生,臻于至善

ASM扩容之asmlib

华为存储Linux平台命令如下
upadmin show vlun
upadmin show path
华为存储AIX平台命令如下
upadm show vlun
upadm show path
EMC存储命令如下:
powermt display
powermt display dev=all

ls -l /dev/disk/by-id|grep

Disk /dev/sdaq: 1099.5 GB, 1099511627776 bytes
Disk /dev/sdar: 1099.5 GB, 1099511627776 byte

1. 根据系统组反馈,扩容存储为sdaq/sdar
sudo fdisk -l | grep sd --确认sdaq/sdar是否未分区

fdisk -l|egrep 'sdaq|sdar'

blkid|egrep 'sdaq|sdar'

2. sudo fdisk /dev/sdaq 依次选择n?p?1?回车?回车?w (只需在一个节点执行)
sudo fdisk /dev/sdar 依次选择n?p?1?回车?回车?w (只需在一个节点执行)

3. 查看已经存在的asmdisk
[root@dryserpvdrd08 ~]# sudo /etc/init.d/oracleasm listdisks
DATA01
DATA05
DATA34
DATA43
DATA45
DATA46
DATA47
OCR_VOTE01
[root@dryserpvdrd08 ~]#

4. 创建asmdisk,只需在一个节点执行
sudo /etc/init.d/oracleasm createdisk DATA48 /dev/sdaq1
sudo /etc/init.d/oracleasm createdisk DATA49 /dev/sdar1

5. 在另一个节点执行scan并list,确认步骤4创建的asmdisk在节点二正常显示
sudo /etc/init.d/oracleasm scandisks
sudo /etc/init.d/oracleasm listdisks

6. 确认新创建的asmdisk在两个节点都正常显示后,用grid用户在一个节点执行
asmca
在需要扩容的ASM磁盘上右击,选择”Add Disks”

弹出框里选择步骤4新增的盘,DATA48/DATA49,点击”OK”确认

至此,磁盘添加完成,点击”Exit”退出

7. select name,path,library from v$asm_disk; 确认添加的磁盘在ASM中是否正确显示。

alter diskgroup DATA add disk 'ORCL:DATA25';
alter diskgroup DATA add disk 'ORCL:DATA26';

set lines 200 pages 50000
col name for a25
col path for a55
select group_number,disk_number,name,path,total_mb/1024 total_G,path,mode_status,repair_timer from v$asm_disk order by group_number,disk_number;

select name, path, group_number from v$asm_disk_stat;

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

set lines 200 pages 50000
col path for a50
select GROUP_NUMBER,DISK_NUMBER, MODE_STATUS,HEADER_STATUS, MODE_STATUS,state,TOTAL_MB,FREE_MB,name,PATH from v$asm_disk;

-----------------------------------------删除硬盘
alter diskgroup DATA drop disk 'DATA04';

sudo /etc/init.d/oracleasm querydisk -p DATA04

# sudo /etc/init.d/oracleasm querydisk -p DATA04
Disk "DATA04" is a valid ASM disk
/dev/sdl1: LABEL="DATA04" TYPE="oracleasm"

# sudo /etc/init.d/oracleasm querydisk -p DATA04
Disk "DATA04" is a valid ASM disk
/dev/sdl1: LABEL="DATA04" TYPE="oracleasm"

# sudo /etc/init.d/oracleasm deletedisk DATA04
Removing ASM disk "DATA04":                                [  OK  ]


# sudo /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:
                                                           [  OK  ]
# sudo /etc/init.d/oracleasm listdisks
ARCH01
DATA01
DATA02
DATA03
DATA05
DATA06
DATA07
OGG01
VOTE01
VOTE02
VOTE03
# sudo /etc/init.d/oracleasm createdisk ARCH02 /dev/sdl1

alter diskgroup ARCH add disk 'ORCL:ARCH02';

set lines 200 pages 50000
col path for a50
select GROUP_NUMBER,DISK_NUMBER, MODE_STATUS,HEADER_STATUS, MODE_STATUS,state,TOTAL_MB,FREE_MB,name,PATH from v$asm_disk;

select * from v$asm_operation;

GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE
------------ ----- ---- ---------- ---------- ---------- ---------- ---------- ----------- ------------
           2 REBAL RUN           1          1      15514      70150       4640          11
		   
SOFAR:就是目前为止挪动的AU数量
EST_WORK:估计要挪动的AU数量
EST_RATE:估计每分钟挪动的AU数量
EST_MINUTES:估计挪动多少分钟
重平衡的过程就是从其他的磁盘向新磁盘挪动数据的过程,如果数据量很大,这个时间会很长,可以更改power值加快速度,默认power值为1,可根据存储性能将此值设置大一些(power取值0-11),数据平衡完毕复原power值即可
SQL> show parameter asm_power_limit
SQL> alter diskgroup DATA rebalance power 11;
注:power=0是停止rebalance操作

run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
allocate channel c6 type disk;
allocate channel c7 type disk;
allocate channel c8 type disk;
allocate channel c9 type disk;
allocate channel c10 type disk;
allocate channel c11 type disk;
allocate channel c12 type disk;
allocate channel c13 type disk;
allocate channel c14 type disk;
allocate channel c15 type disk;
allocate channel c16 type disk;
validate database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
release channel c9;
release channel c10;
release channel c11;
release channel c12;
release channel c13;
release channel c14;
release channel c15;
release channel c16;
}

select count(*) from v$database_block_corruption;
select count(*) from gv$database_block_corruption;


select 'alter database datafile '||file_id||' autoextend off;' from dba_data_files;

set lines 200 pages 50000
col file_name for a60
col TABLESPACE_NAME for a30
select file_id,file_name,tablespace_name,autoextensible,BYTES/1024/1024,MAXBYTES/1024/1024,status from dba_data_files order by 1;
select file_id,file_name,tablespace_name,autoextensible,BYTES/1024/1024,MAXBYTES/1024/1024,status from dba_temp_files order by 1;

set pages 999
select 'alter database datafile '||file_id||' resize 20G;' from dba_data_files where tablespace_name='APPS_TS_TX_DATA';
赞(0) 打赏
未经允许不得转载:徐万新之路 » ASM扩容之asmlib
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏