Home > ASM > Examples to use oracleasm

Examples to use oracleasm

Example 1. Check oracleasm if it is load
[root@vmrac1 ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

Example 2. When you have create new asmdisk on one of cluster node, you need to scan disks on other nodes
At Node 1
=========
[root@vmrac1 ~]# oracleasm createdisk DATA1 /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@vmrac1 ~]#  oracleasm createdisk DATA2 /dev/sde1
Writing disk header: done
Instantiating disk: done
[root@vmrac1 ~]# oracleasm listdisks
DATA1
DATA2

At Node 2
=========
[root@vmrac2 ~]# oracleasm listdisks
(There are no ASM disks)

[root@vmrac2 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks…
Scanning system for ASM disks…
Instantiating disk “DATA1”
Instantiating disk “DATA2”

Example 3. Determine if a disk belongs to Oracle ASMlib
[root@vmrac1 ~]# oracleasm querydisk /dev/sde1
Device “/dev/sde1” is marked an ASM disk with the label “DATA2” <– this belongs to ASMLIB
[root@vmrac1 ~]# oracleasm querydisk /dev/sdb1
Device “/dev/sdb1” is not marked as an ASM disk <– this does’nt belong to ASMLIB

Example 4. Check ASM Disk Group device path name

[root@wcsvmuatdb01 oracle]# oracleasm querydisk -p VOTEDISK1
Disk “VOTEDISK1″ is a valid ASM disk
/dev/sdc1: LABEL=”VOTEDISK1″ TYPE=”oracleasm”

 

Example 5. Rename ASM Disk

[root@wcsvmuatdb01 oracle]# oracleasm renamedisk -f VOTEDISK1 OCRVOTEDISK1
Instantiating disk “OCRVOTEDISK1”: done
Writing disk header: done
Removing old ASM disk “VOTEDISK1”: done
[root@wcsvmuatdb01 oracle]# oracleasm renamedisk -f VOTEDISK2 OCRVOTEDISK2
Instantiating disk “OCRVOTEDISK2”: done
Writing disk header: done
Removing old ASM disk “VOTEDISK2”: done
[root@wcsvmuatdb01 oracle]# oracleasm renamedisk -f VOTEDISK3 OCRVOTEDISK3
Instantiating disk “OCRVOTEDISK3”: done
Writing disk header: done
Removing old ASM disk “VOTEDISK3”: done
[root@wcsvmuatdb01 oracle]# oracleasm renamedisk -f DATADISK1 DBDATADISK1
Instantiating disk “DBDATADISK1”: done
Writing disk header: done
Removing old ASM disk “DATADISK1”: done
[root@wcsvmuatdb01 oracle]# oracleasm listdisks
DBDATADISK1
OCRVOTEDISK1
OCRVOTEDISK2
OCRVOTEDISK3

 

Example 5. Re-instantiating ASM Disks at another of RAC nodes after renaming disks

[root@wcsvmuatdb02 opt]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks…
Cleaning disk “DATADISK1”
Cleaning disk “VOTEDISK1”
Cleaning disk “VOTEDISK2”
Cleaning disk “VOTEDISK3”
Scanning system for ASM disks…
Instantiating disk “DBDATADISK1”
Instantiating disk “OCRVOTEDISK1”
Instantiating disk “OCRVOTEDISK2”
Instantiating disk “OCRVOTEDISK3”

 

Advertisements
Categories: ASM
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: