Thinking Out Loud

November 24, 2013

Playing with ASM Online Migration

Filed under: 11g,ASM — mdinh @ 3:14 pm

“Everything should be made as simple as possible, but not simpler.” – Albert Einstein

I am curious as to why anyone would use ASM for a standalone database as it introduce more complexity of having to install, maintain, and upgrade Grid Infrastructure.

I asked the DBAs and here are the some responses:

ASM always bypass the OS caching layer (direct IO) which can be difficult and inconsistent using traditional FS.
ASM allows move to another type of storage in the future.
ASM provides transparent balance and migration between any type of block storage.
ASM provides online operations like adding/removing/resizing disks/LUNs from one disk array to another.

I asked a former manager who knows EMC storage and Solaris and here are his responses:

1. OS Caching: this was solved a long time ago. As you know, even plain old UFS on Solaris has been able to do this for years with Oracle.
2. Moving to another type of storage. That’s a function of either the volume manager on the OS or the array itself (both are possible and depend on your setup).
Oracle isn’t bringing anything new to the table with ASM.
3. Balance and migration. Again, a function of the volume manager and/or the array. Nothing new being done by ASM.
4. Online operations and migrations. Again, a function of the volume manager and/or the array. ASM brings nothing new.

It seems to me that ASM does, really, one thing: it eliminates the OS volume manager but at the same time expands the scope of the DBA to now include storage problems. That sounds like a distraction to me.

I would love to see a live debate on this.

Still not 100% satisfied, I started to research and explore ASM online operations.

ASM disks VENDOR101,VENDOR102,VENDOR103 are mapped to /dev/sdb1,/dev/sdc1,/dev/sdd1

[root@looney ~]# ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 Nov 23 09:23 /dev/sda
brw-rw---- 1 root disk 8,  1 Nov 23 09:23 /dev/sda1
brw-rw---- 1 root disk 8,  2 Nov 23 09:23 /dev/sda2
brw-rw---- 1 root disk 8, 16 Nov 23 09:23 /dev/sdb
brw-rw---- 1 root disk 8, 17 Nov 23 09:25 /dev/sdb1
brw-rw---- 1 root disk 8, 32 Nov 23 09:23 /dev/sdc
brw-rw---- 1 root disk 8, 33 Nov 23 09:27 /dev/sdc1
brw-rw---- 1 root disk 8, 48 Nov 23 09:23 /dev/sdd
brw-rw---- 1 root disk 8, 49 Nov 23 09:27 /dev/sdd1
brw-rw---- 1 root disk 8, 64 Nov 23 09:23 /dev/sde
brw-rw---- 1 root disk 8, 65 Nov 23 09:23 /dev/sde1
brw-rw---- 1 root disk 8, 80 Nov 23 09:23 /dev/sdf
brw-rw---- 1 root disk 8, 81 Nov 23 09:23 /dev/sdf1
brw-rw---- 1 root disk 8, 96 Nov 23 09:23 /dev/sdg
brw-rw---- 1 root disk 8, 97 Nov 23 09:23 /dev/sdg1

[root@looney ~]# ls -l /dev/oracleasm/disks/
total 0
brw-rw---- 1 oracle dba 8, 17 Nov 23 09:25 VENDOR101
brw-rw---- 1 oracle dba 8, 33 Nov 23 09:27 VENDOR102
brw-rw---- 1 oracle dba 8, 49 Nov 23 09:27 VENDOR103

[root@looney ~]# /etc/init.d/oracleasm listdisks
VENDOR101
VENDOR102
VENDOR103

[root@looney ~]# /etc/init.d/oracleasm querydisk -p VENDOR101
Disk "VENDOR101" is a valid ASM disk
/dev/sdb1: LABEL="VENDOR101" TYPE="oracleasm"

[root@looney ~]# /etc/init.d/oracleasm querydisk -p VENDOR102
Disk "VENDOR102" is a valid ASM disk
/dev/sdc1: LABEL="VENDOR102" TYPE="oracleasm"

[root@looney ~]# /etc/init.d/oracleasm querydisk -p VENDOR103
Disk "VENDOR103" is a valid ASM disk
/dev/sdd1: LABEL="VENDOR103" TYPE="oracleasm"

Create ASM disks for VENDOR201,VENDOR202,VENDOR203 using /dev/sde1,/dev/sdf1,/dev/sdg1

[root@looney ~]# /etc/init.d/oracleasm createdisk 'vendor201' /dev/sde1
Marking disk "vendor201" as an ASM disk:                   [  OK  ]

[root@looney ~]# /etc/init.d/oracleasm createdisk 'vendor202' /dev/sdf1
Marking disk "vendor202" as an ASM disk:                   [  OK  ]

[root@looney ~]# /etc/init.d/oracleasm createdisk 'vendor203' /dev/sdg1
Marking disk "vendor203" as an ASM disk:                   [  OK  ]
[root@looney ~]#

Perform ASM ONLINE Migration

Query ASM disks:

SYS@+ASM> @asmdisk

   INST_ID PATH                 DISK_NAME       GROUP_NUMBER GROUP_NAME      STATE      TYPE         TOTAL_GB    FREE_GB
---------- -------------------- --------------- ------------ --------------- ---------- ---------- ---------- ----------
         1 ORCL:VENDOR101       VENDOR101                  1 DATA1           MOUNTED    EXTERN          14.98      13.27
         1 ORCL:VENDOR102       VENDOR102                  1 DATA1           MOUNTED    EXTERN          14.98      13.27
         1 ORCL:VENDOR103       VENDOR103                  1 DATA1           MOUNTED    EXTERN          14.98      13.27
         1 ORCL:VENDOR201
         1 ORCL:VENDOR202
         1 ORCL:VENDOR203

6 rows selected.

Add new disks / Drop old disks from ASM diskgroup:

ASM power limit ranges from 1-11.
In the demonstration, power limit 1 was used to be able to query progress from v$asm_operation

SYS@+ASM> alter diskgroup DATA1
add disk  'ORCL:VENDOR201','ORCL:VENDOR202','ORCL:VENDOR203'
drop disk 'VENDOR101','VENDOR102','VENDOR103'
rebalance power 1;
  2    3    4

Diskgroup altered.

SYS@+ASM> SYS@+ASM> @asmop

GROUP_NUMBER OPERA STATE           POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE
------------ ----- ---------- ---------- ---------- ---------- ---------- ---------- ----------- --------------------------------------------
           1 REBAL RUN                 1          1         58       1756         60          28

SYS@+ASM> r
  1* select * from v$asm_operation

GROUP_NUMBER OPERA STATE           POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE
------------ ----- ---------- ---------- ---------- ---------- ---------- ---------- ----------- --------------------------------------------
           1 REBAL RUN                 1          1        178       1758        677           2

SYS@+ASM> r
  1* select * from v$asm_operation

GROUP_NUMBER OPERA STATE           POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE
------------ ----- ---------- ---------- ---------- ---------- ---------- ---------- ----------- --------------------------------------------
           1 REBAL RUN                 1          1        298       1759        697           2

SYS@+ASM> r
  1* select * from v$asm_operation

no rows selected
SYS@+ASM> @asmdisk

   INST_ID PATH                 DISK_NAME       GROUP_NUMBER GROUP_NAME      STATE      TYPE         TOTAL_GB    FREE_GB
---------- -------------------- --------------- ------------ --------------- ---------- ---------- ---------- ----------
         1 ORCL:VENDOR101
         1 ORCL:VENDOR102
         1 ORCL:VENDOR103
         1 ORCL:VENDOR201       VENDOR201                  1 DATA1           MOUNTED    EXTERN          14.98      13.27
         1 ORCL:VENDOR202       VENDOR202                  1 DATA1           MOUNTED    EXTERN          14.98      13.27
         1 ORCL:VENDOR203       VENDOR203                  1 DATA1           MOUNTED    EXTERN          14.98      13.27

6 rows selected.

SYS@+ASM>

Delete ASM disks for /dev/sdb1, dev/sdd1, /dev/sdd1

[root@looney ~]# /etc/init.d/oracleasm deletedisk /dev/sdb1
Removing ASM disk "/dev/sdb1":                             [  OK  ]

[root@looney ~]# /etc/init.d/oracleasm deletedisk /dev/sdc1
Removing ASM disk "/dev/sdc1":                             [  OK  ]

[root@looney ~]# /etc/init.d/oracleasm deletedisk /dev/sdd1
Removing ASM disk "/dev/sdd1":                             [  OK  ]

[root@looney ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:               [  OK  ]

[root@looney ~]# /etc/init.d/oracleasm listdisks
VENDOR201
VENDOR202
VENDOR203

SYS@+ASM> @asmdisk

   INST_ID PATH                 DISK_NAME       GROUP_NUMBER GROUP_NAME      STATE      TYPE         TOTAL_GB    FREE_GB
---------- -------------------- --------------- ------------ --------------- ---------- ---------- ---------- ----------
         1 ORCL:VENDOR201       VENDOR201                  1 DATA1           MOUNTED    EXTERN          14.98      13.27
         1 ORCL:VENDOR202       VENDOR202                  1 DATA1           MOUNTED    EXTERN          14.98      13.27
         1 ORCL:VENDOR203       VENDOR203                  1 DATA1           MOUNTED    EXTERN          14.98      13.27

SYS@+ASM>

Would you used ASM for single instance database? Why or Why not?

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 300 other followers

%d bloggers like this: