Friday, September 12, 2014

ASM Lun Migration

1. Please check the ASM status by running the below script and upload the resulting html.

SPOOL ASM_1.HTML
SET MARKUP HTML ON
set echo on
set pagesize 200
alter session set nls_date_format='DD-MON-YYYY HH24:MI:SS';
select 'THIS ASM REPORT WAS GENERATED AT: ==)> ' , sysdate " " from dual;
select 'HOSTNAME ASSOCIATED WITH THIS ASM INSTANCE: ==)> ' , MACHINE " " from v$session where program like '%SMON%';
select * from v$asm_diskgroup;
SELECT * FROM V$ASM_DISK ORDER BY GROUP_NUMBER,DISK_NUMBER;
SELECT * FROM V$ASM_CLIENT;
select * from V$ASM_ATTRIBUTE;
select * from v$asm_operation;
select * from gv$asm_operation;
select * from v$version;
show parameter asm
show parameter cluster
show parameter instance_type
show parameter instance_name
show parameter spfile
show sga
spool off
exit


ASM Lun Migration

while true
do
sqlplus -s "/as sysasm" @chk.sql
sleep 10
done


chk.sql
---------------------------------------------------------------------------------------
COL % FORMAT 100.0
SELECT name, free_mb, total_mb, free_mb/total_mb*100 "%", STATE FROM v$asm_diskgroup;
set linesize 300 pages 300;
col path for a30
column name format a20;
column G# format 99;
column D# format 99;
col state for a10
col HEADER_STATUS for a10
select a.group_number G#, a.disk_number D#, a.state, header_status,
a.redundancy, a.name,a.path, a.OS_MB/1024 size_GB,a.total_mb, a.free_mb, (a.total_mb - a.free_mb) used_mb
from v$asm_disk a order by a.name;
select * from v$asm_operations;
exit;
---------------------------------------------------------------------------------------
Pre-checks:
------------
1. Ensure all the databases associated with ASM are backedup with Full or Level0.
2. Take a MD backup for all the DGS.--> ASMCMD>md_backup mdbkup_10JUN2012 -G DATA1,ARCH1,FRA1
3. crs_stat -t
4. lsnrctl status
5. set the rebalance power to 0.


Main steps:
1. Create a DUMMY disk group.
2. Add all the CANDIDATE Luns to the Dummy disk group.
3. Check if all the Disk groups in MOUNTED status
4. Monitor the ASM alert log.
5. Remove all the added Luns from DUMMY disk group one by one (you may not be able to remove the last Lun) and rebalance for each Lun.
6. Now all the removed Luns (from DUMMY) will be in FORMER status and rebalance when required.
7. Add each FORMER Lun into FRA1, ARCH1 and DATA1 disk groups and rebalance when required.
8. Check if all the Disk groups in MOUNTED status
9. Monitor the ASM alert log and check for any erros
10. Run the below command to check the status of each Diskgroup:

SQL>ALTER DISKGROUP DATA1 CHECK ALL; --> check the output of this in the alert log.

create a diskgroup:
create diskgroup DUMMY external redundancy disk '/dev/rdsk/emcpower112g'; --> PATH from v$asm_disk

Add the other Luns:
ALTER DISKGROUP SUMMY ADD DISK '<LUN_NAME>';

Drop a disk from any diskgroup :
ALTER DISKGROUP DUMMY DROP DISK DUMMY_0000; --> NAME from v$asm_disk for the Lun -->/dev/rdsk/emcpower112g


Rebalance the diskgroup:
ALTER DISKGROUP DUMMY REBALANCE POWER 5 wait;


The following are the Luns to be migrated:
/dev/rdsk/emcpower112g
/dev/rdsk/emcpower116g
/dev/rdsk/emcpower120g
/dev/rdsk/emcpower12g
/dev/rdsk/emcpower16g
/dev/rdsk/emcpower20g
/dev/rdsk/emcpower24g
/dev/rdsk/emcpower28g
/dev/rdsk/emcpower32g
/dev/rdsk/emcpower36g
/dev/rdsk/emcpower40g
/dev/rdsk/emcpower42g
/dev/rdsk/emcpower45g
/dev/rdsk/emcpower49g
/dev/rdsk/emcpower58g
/dev/rdsk/emcpower63g
/dev/rdsk/emcpower66g
/dev/rdsk/emcpower72g
/dev/rdsk/emcpower78g
/dev/rdsk/emcpower80g
/dev/rdsk/emcpower88g
/dev/rdsk/emcpower92g

No comments:

Post a Comment