User Rating: 1 / 5

Star ActiveStar InactiveStar InactiveStar InactiveStar Inactive
 

This article will show how to configure Oracle ASM in command line with silent option (for non cluster environement).

ASM Configuration Assistant (ASMCA) is use to create and manage ASM instance, ASM disk group and ASM Cluster File System (ACFS).
It can be used in GUI or in command line.

From Oracle 12c ...
You may want to check ASMFD instead (check asmfd install part in Oracle Grid Infrastructure Install and ASMFD Filtering Test).

Before starting, you need ...
... Oracle Grid Infrastructure installed (here)
... Disks to be presented by ASMLib or UDEV
... SELinux disabled (here)

Install Oracle ASM in command line

Commands bellow will create a special oracle repository instance called +ASM with DATA and FRA diskgroup without software redundancy.

# Configure ASM instance with DATA diskgroup
[grid]$ asmca -silent -configureASM \
  -sysAsmPassword asmpwd12345 \
  -asmsnmpPassword asmpwd54321 \
  -diskString '/dev/oracleasm/disks/*' \
  -diskGroupName DATA \
  -diskList '/dev/oracleasm/disks/ORADAT*' \
  -redundancy EXTERNAL

    ASM created and started successfully.

    Disk Group DATA created successfully.

# Add ASM diskgroup
[grid]$ asmca -silent -createDiskGroup \
  -diskString '/dev/oracleasm/disks/*' \
  -diskGroupName FRA \
  -diskList '/dev/oracleasm/disks/ORAFRA*' \
  -redundancy EXTERNAL  
  
    Disk Group FRA created successfully.

Others

Remove ASM

Be careful
This command may cause you data loss, so use it with caution.

You may want for some reason to remove ASM from your server. Use the following command to properly deinstall current ASM from host:

# Deinstall ASM
[grid]$ asmca -silent -deleteASM -force -dropDiskGroups
    ASM with SID +ASM deleted successfully. Check /u01/app/grid/base/cfgtoollogs/asmca/asmca-150713AM012406.log for details.

Reusing ASM disks

Be careful
This command may cause you data loss, so use it with caution.

You may have some issue if you are reusing a disk which has been already used by ASM.
First, double check this is the right disk you want to recycle (all data will be lost)
Then execute the following command to delete its header:

# Delete disk header
[root]$ dd if=/dev/zero of=/dev/oracleasm/disks/ORADATVOL1 bs=4096 count=1
    1+0 records in
    1+0 records out
    4096 bytes (4.1 kB) copied, 0.000288247 s, 14.2 MB/s

Read headers

In case of you need to get asm disk header metadata:

# Get disk header metadata
[grid]$ kfed read /dev/oracleasm/disks/ORADATVOL1 | head -20
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                            1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt:                          1 ; 0x003: 0x01
kfbh.block.blk:                       0 ; 0x004: T=0 NUMB=0x0
kfbh.block.obj:              2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
kfbh.check:                   144282584 ; 0x00c: 0x089993d8
kfbh.fcn.base:                        0 ; 0x010: 0x00000000
kfbh.fcn.wrap:                        0 ; 0x014: 0x00000000
kfbh.spare1:                          0 ; 0x018: 0x00000000
kfbh.spare2:                          0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr:ORCLDISKORADATVOL1 ; 0x000: length=18
kfdhdb.driver.reserved[0]:   1145131599 ; 0x008: 0x4441524f
kfdhdb.driver.reserved[1]:   1331057729 ; 0x00c: 0x4f565441
kfdhdb.driver.reserved[2]:        12620 ; 0x010: 0x0000314c
kfdhdb.driver.reserved[3]:            0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]:            0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]:            0 ; 0x01c: 0x00000000
kfdhdb.compat:                202375168 ; 0x020: 0x0c100000
kfdhdb.dsknum:                        0 ; 0x024: 0x0000

Please leave comments and suggestions,
Michel.

Reference
Automatic Storage Management Administrator's Guide (oracle.com)

Enjoyed this article? Please like it or share it.

Add comment

Please connect with one of social login below (or fill up name and email)

     


Security code
Refresh