Migration ASM, the ARC diskgroup to the new storage

I'm new on Orafaq, this is my first blog. Thank you Sir John Watson promoted and supported me, and I'm sorry, I usually wrote bad English language.

Migration ASM, the ARC diskgroup to the new storage

1- Create and make the new disk to ASM
  Device Boot      Start         End      Blocks   Id  System
/dev/sdf1              10        2610    20892532+  83  Linux

Disk /dev/sdg: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdg doesn't contain a valid partition table
[root@anhttRHEL ~]# fdisk /dev/sdg
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 6527.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-6527, default 1): 10
Last cylinder or +size or +sizeM or +sizeK (10-6527, default 6527): 
Using default value 6527

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@anhttRHEL ~]# oracleasm listdisks
ARC
BKP
DATA
DATAVOL1

2. Backup Database
2.2. Backup full database

[root@anhttRHEL ~]# su - oracle
[oracle@anhttRHEL ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Tue Dec 1 09:16:59 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ANHTT (DBID=386671821)

RMAN> crosscheck backup;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=588 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=11 device type=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+BKP/arc_48qlauoq_1_1 RECID=124 STAMP=894794522
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+BKP/arc_47qlauoq_1_1 RECID=125 STAMP=894794522
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+BKP/full_4aqlauot_1_1 RECID=126 STAMP=894794530
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+BKP/full_49qlauot_1_1 RECID=127 STAMP=894794525
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+BKP/full_4cqlauqb_1_1 RECID=128 STAMP=894794571
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+BKP/full_4bqlauqb_1_1 RECID=129 STAMP=894794574
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+BKP/arc_4dqlauqg_1_1 RECID=130 STAMP=894794576
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+BKP/ctl_4eqlauqh_1_1 RECID=131 STAMP=894794578
Crosschecked 8 objects


RMAN> delete noprompt backup;

using channel ORA_DISK_1
using channel ORA_DISK_2

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
124     124     1   1   AVAILABLE   DISK        +BKP/arc_48qlauoq_1_1
125     125     1   1   AVAILABLE   DISK        +BKP/arc_47qlauoq_1_1
126     126     1   1   AVAILABLE   DISK        +BKP/full_4aqlauot_1_1
127     127     1   1   AVAILABLE   DISK        +BKP/full_49qlauot_1_1
128     128     1   1   AVAILABLE   DISK        +BKP/full_4cqlauqb_1_1
129     129     1   1   AVAILABLE   DISK        +BKP/full_4bqlauqb_1_1
130     130     1   1   AVAILABLE   DISK        +BKP/arc_4dqlauqg_1_1
131     131     1   1   AVAILABLE   DISK        +BKP/ctl_4eqlauqh_1_1
deleted backup piece
backup piece handle=+BKP/arc_48qlauoq_1_1 RECID=124 STAMP=894794522
deleted backup piece
backup piece handle=+BKP/arc_47qlauoq_1_1 RECID=125 STAMP=894794522
deleted backup piece
backup piece handle=+BKP/full_4aqlauot_1_1 RECID=126 STAMP=894794530
deleted backup piece
backup piece handle=+BKP/full_49qlauot_1_1 RECID=127 STAMP=894794525
deleted backup piece
backup piece handle=+BKP/full_4cqlauqb_1_1 RECID=128 STAMP=894794571
deleted backup piece
backup piece handle=+BKP/full_4bqlauqb_1_1 RECID=129 STAMP=894794574
deleted backup piece
backup piece handle=+BKP/arc_4dqlauqg_1_1 RECID=130 STAMP=894794576
deleted backup piece
backup piece handle=+BKP/ctl_4eqlauqh_1_1 RECID=131 STAMP=894794578
Deleted 8 objects


RMAN> run{
2> backup as compressed backupset incremental level 0 database
3> format '+BKP/full_%U'
4> plus archivelog delete input
5> format '+BKP/arc_%U'
6> filesperset 2;
7> backup current controlfile 
8> format '+BKP/ctl_%U';
9> }


Starting backup at 01-DEC-2015 09:18:05
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=51 RECID=91 STAMP=897296759
channel ORA_DISK_1: starting piece 1 at 01-DEC-2015 09:18:06
channel ORA_DISK_2: starting compressed archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=52 RECID=92 STAMP=897297485
channel ORA_DISK_2: starting piece 1 at 01-DEC-2015 09:18:06
channel ORA_DISK_1: finished piece 1 at 01-DEC-2015 09:18:13
piece handle=+BKP/arc_4fqnnb2e_1_1 tag=TAG20151201T091805 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+ARC/anhtt/archivelog/2015_12_01/thread_1_seq_51.256.897296753 RECID=91 STAMP=897296759
channel ORA_DISK_2: finished piece 1 at 01-DEC-2015 09:18:13
piece handle=+BKP/arc_4gqnnb2e_1_1 tag=TAG20151201T091805 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_2: deleting archived log(s)
archived log file name=+ARC/anhtt/archivelog/2015_12_01/thread_1_seq_52.258.897297485 RECID=92 STAMP=897297485
Finished backup at 01-DEC-2015 09:18:14

Starting backup at 01-DEC-2015 09:18:14
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATAVOL1/anhtt/datafile/system.258.892497941
input datafile file number=00003 name=+DATAVOL1/anhtt/datafile/undotbs1.262.892498031
input datafile file number=00006 name=+DATAVOL1/anhtt/datafile/admin.256.891959225
input datafile file number=00004 name=+DATA/anhtt/datafile/users.273.889993453
channel ORA_DISK_1: starting piece 1 at 01-DEC-2015 09:18:14
channel ORA_DISK_2: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATAVOL1/anhtt/datafile/sysaux.261.892497987
input datafile file number=00005 name=+DATA/anhtt/datafile/example.257.889993453
input datafile file number=00008 name=+DATA/anhtt/datafile/logmnrts.261.890144385
channel ORA_DISK_2: starting piece 1 at 01-DEC-2015 09:18:15
...
Starting backup at 01-DEC-2015 09:19:06
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 01-DEC-2015 09:19:07
channel ORA_DISK_1: finished piece 1 at 01-DEC-2015 09:19:08
piece handle=+BKP/ctl_4mqnnb4a_1_1 tag=TAG20151201T091906 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 01-DEC-2015 09:19:08

RMAN>

2.3. Validate backup
RMAN> report need backup;

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
Report of files that must be backed up to satisfy 7 days recovery window
File Days  Name
---- ----- -----------------------------------------------------

RMAN> restore database validate;

Starting restore at 01-DEC-2015 09:19:49
using channel ORA_DISK_1
using channel ORA_DISK_2

channel ORA_DISK_1: starting validation of datafile backup set
channel ORA_DISK_2: starting validation of datafile backup set
channel ORA_DISK_1: reading from backup piece +BKP/full_4iqnnb2m_1_1
channel ORA_DISK_2: reading from backup piece +BKP/full_4hqnnb2m_1_1
channel ORA_DISK_1: piece handle=+BKP/full_4iqnnb2m_1_1 tag=TAG20151201T091814
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: validation complete, elapsed time: 00:00:26
channel ORA_DISK_2: piece handle=+BKP/full_4hqnnb2m_1_1 tag=TAG20151201T091814
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: validation complete, elapsed time: 00:00:36
Finished restore at 01-DEC-2015 09:20:25

RMAN>

3- Add the new disk to ASM diskgroup ARC
3.1. Query the disk in ARC diskgroup exists

[root@anhttRHEL ~]# oracleasm querydisk -p ARC
Disk "ARC" is a valid ASM disk
/dev/sdf1: LABEL="ARC" TYPE="oracleasm"

3.2. Label the new disk

[root@anhttRHEL ~]# oracleasm createdisk ARCVOL1 /dev/sdg1
Writing disk header: done
Instantiating disk: done
[root@anhttRHEL ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...

[root@anhttRHEL ~]# oracleasm listdisks
ARC
ARCVOL1
BKP
DATA
DATAVOL1
FRA
[root@anhttRHEL ~]#

3.4. Query the disk string

grid@anhttRHEL ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 1 09:24:39 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Automatic Storage Management option

idle> show parameter asm_disk

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string      FRA, BKP, DATAVOL1, ARC
asm_diskstring                       string
idle> exit
...

rw-rw-rw- 1 root tty      5,    2 Dec  1 09:39 ptmx
[root@anhttRHEL ~]# ls -ll /dev/oracleasm
total 0
drwxr-xr-x 1 root root     0 Dec  1 09:08 disks
drwxrwx--- 1 grid asmadmin 0 Dec  1 09:03 iid
[root@anhttRHEL ~]# ls -ll /dev/oracleasm/disks
total 0
brw-rw---- 1 grid asmadmin 8, 81 Dec  1 09:03 ARC
brw-rw---- 1 grid asmadmin 8, 97 Dec  1 09:29 ARCVOL1
brw-rw---- 1 grid asmadmin 8, 49 Dec  1 09:03 BKP
brw-rw---- 1 grid asmadmin 8, 17 Dec  1 09:03 DATA
brw-rw---- 1 grid asmadmin 8, 65 Dec  1 09:03 DATAVOL1
brw-rw---- 1 grid asmadmin 8, 33 Dec  1 09:03 FRA

grid@anhttRHEL ~]$ dd if=/dev/oracleasm/disks/ARCVOL1 of=/dev/null count=100 bs=8192
100+0 records in
100+0 records out
819200 bytes (819 kB) copied, 0.068321 seconds, 12.0 MB/s

[grid@anhttRHEL ~]$ kfed /dev/oracleasm/disks/ARCVOL1
as/mlib         ASM Library [asmlib='lib']
aun/um          AU number to examine or update [AUNUM=number]
aus/z           Allocation Unit size in bytes [AUSZ=number]
blkn/um         Block number to examine or update [BLKNUM=number]
blks/z          Metadata block size in bytes [BLKSZ=number]
ch/ksum         Update checksum before each write [CHKSUM=YES/NO]
cn/t            Count of AUs to process [CNT=number]
de/v            ASM device to examine or update [DEV=string]
dm/pall         Don't suppress repeated lines when dumping corrupt blocks [DMPALL=YES/NO]
o/p             KFED operation type [OP=READ/WRITE/MERGE/REPAIR/NEW/FORM/FIND/STRUCT]
p/rovnm         Name for provisioning purposes [PROVNM=string]
s/eek           AU number to seek to [SEEK=number]
te/xt           File name for translated block text [TEXT=string]
ty/pe           ASM metadata block type number [TYPE=number]
KFED-00101: LRM error [102] while parsing command line arguments

3.5. Add the new disk in disk string

idle> set lines 270 pages 10000
idle> col diskgroup for a10
idle> col DISKNAME for a30
idle> select dg.NAME diskgroup, dg.TYPE, dg.VOTING_FILES,
  2  ds.NAME diskname, ds.TOTAL_MB, ds.FREE_MB, dg.USABLE_FILE_MB
  3  from V$ASM_DISKGROUP dg, V$asm_disk_stat ds
  4  where dg.GROUP_NUMBER = ds.GROUP_NUMBER
  5  order by diskgroup, diskname;

DISKGROUP  Type   V DISKNAME                       Total Size (MB)    FREE_MB USABLE_FILE_MB
---------- ------ - ------------------------------ --------------- ---------- --------------
ARC        EXTERN N ARC                                     20,402      20343          20343
BKP        EXTERN N BKP                                     20,402      19991          19991
DATA       EXTERN N DATA                                    40,884      36217          36217
DATAVOL1   EXTERN N DATAVOL1                                51,128      46933          46933
FRA        EXTERN N FRA                                     20,402      18821          18821
                                                   ---------------
Grand Tota                                                 153,218

idle> alter diskgroup arc add disk 'ORCL:ARCVOL1';

Diskgroup altered.

idle> select dg.NAME diskgroup, dg.TYPE, dg.VOTING_FILES,
  2  ds.NAME diskname, ds.TOTAL_MB, ds.FREE_MB, dg.USABLE_FILE_MB
  3  from V$ASM_DISKGROUP dg, V$asm_disk_stat ds
  4  where dg.GROUP_NUMBER = ds.GROUP_NUMBER
  5  order by diskgroup, diskname;

DISKGROUP  Type   V DISKNAME                       Total Size (MB)    FREE_MB USABLE_FILE_MB
---------- ------ - ------------------------------ --------------- ---------- --------------
ARC        EXTERN N ARC                                     20,402      20383          71469
ARC        EXTERN N ARCVOL1                                 51,128      51086          71469
BKP        EXTERN N BKP                                     20,402      19991          19991
DATA       EXTERN N DATA                                    40,884      36217          36217
DATAVOL1   EXTERN N DATAVOL1                                51,128      46933          46933
FRA        EXTERN N FRA                                     20,402      18821          18821
                                                   ---------------
Grand Tota                                                 204,346

6 rows selected.

3.6 Balance the disks

idle> alter diskgroup arc rebalance power 11;

Diskgroup altered.

3.7. Verify the balance processing

idle> select * from v$asm_operation; 

GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE
------------ ----- ---- ---------- ---------- ---------- ---------- ---------- ----------- --------------------------------------------
           4 REBAL RUN          11         11       5161       5161          0           0

idle> select * from v$asm_operation; 

no rows selected  <<-- Dones

3.8. Drop the disk

idle> alter diskgroup arc drop disk ARC;

Diskgroup altered.

3.9. Verify the disk in diskgroup

idle> @asmd

DISKGROUP  Type   V DISKNAME                       Total Size (MB)    FREE_MB USABLE_FILE_MB
---------- ------ - ------------------------------ --------------- ---------- --------------
ARC        EXTERN N ARCVOL1                                 51,128      51069          51069
BKP        EXTERN N BKP                                     20,402      19991          19991
DATA       EXTERN N DATA                                    40,884      36217          36217
DATAVOL1   EXTERN N DATAVOL1                                51,128      46933          46933
FRA        EXTERN N FRA                                     20,402      18821          18821
                                                   ---------------
Grand Tota                                                 183,944

4. Verify in database

Log file
Thread 1 advanced to log sequence 54 (LGWR switch)
  Current log# 3 seq# 54 mem# 0: +DATA/anhtt/onlinelog/group_3.265.889993739
  Current log# 3 seq# 54 mem# 1: +FRA/anhtt/onlinelog/group_3.283.889993749
Archived Log entry 93 added for thread 1 sequence 53 ID 0x170ec428 dest 1:
Tue Dec 01 10:02:51 2015
SUCCESS: disk ARCVOL1 (1.3915942127) added to diskgroup ARC
Tue Dec 01 10:31:07 2015
NOTE: disk 0 (ARC) in group 1 (ARC) is offline for reads
NOTE: disk 0 (ARC) in group 1 (ARC) is offline for writes
SUCCESS: disk ARC (0.3915942117) dropped from diskgroup ARC

Switch log file to check

sys@ANHTT> alter system switch logfile;

System altered.

-- Logfile
Tue Dec 01 10:34:10 2015
Thread 1 advanced to log sequence 55 (LGWR switch)
  Current log# 1 seq# 55 mem# 0: +DATA/anhtt/onlinelog/group_1.258.889993701
  Current log# 1 seq# 55 mem# 1: +FRA/anhtt/onlinelog/group_1.284.889993711
Tue Dec 01 10:34:12 2015
Archived Log entry 94 added for thread 1 sequence 54 ID 0x170ec428 dest 1:

Hope this article useful to you.

TAT