Thursday, January 1, 2015

ASM - Asmlib

uname -a


rpm -qa | grep oracleasm


oracleasm-2.6.18-371.6.1.el5-2.0.5-1.el5
oracleasm-support-2.1.8-1.el5
oracleasm-2.6.18-371.el5-2.0.5-1.el5

$rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm\n" | grep asm

oracleasm-support-2.0.4-1.el5.x86_64.rpm
oracleasm-2.6.18-53.el5-2.0.4-1.el5.x86_64.rpm
oracleasmlib-2.0.3-1.el5.x86_64.rpm


modinfo oracleasm
lsmod <- shows the asmlib loaded


/etc/init.d/oracleasm listdisks


/etc/init.d/oracleasm status


/sbin/blkid | grep oracleasm


/etc/init.d/oracleasm listdisks | xargs /etc/init.d/oracleasm querydisk -d


/usr/sbin/oracleasm-discover


/usr/sbin/oracleasm-discover 'ORCL:*'


$GRID_HOME/bin/kfod asm_diskstring='ORCL:*' disks=all


$GRID_HOME/bin/kfod disks=all


$GRID_HOME/bin/kfod asm_diskstring='/dev/oracleasm/disks/*' disks=all


$GRID_HOME/bin/kfod asm_diskstring='ORCL:*' disks=all


$GRID_HOME/bin/kfod asm_diskstring='ORCL:*' disks=all verbose=true


cat /etc/sysconfig/oracleasm


cat /etc/sysconfig/oracleasm-_dev_oracleasm


cat /etc/*release


cat /proc/partitions


strace -aef -o /tmp/kfod.txt kfod asm_diskstring='ORCL:*' disks=all verbose=true


crsctl query css votedisk


ocrcheck


ls -l $GRID_HOME/cfgtoollogs/crsconfig/*


ls -l /app/oracle/cfgtoollogs/asmca/*


ls -ltr /dev/oracleasm/disks


ls -l /dev/oracleasm/disks


ls -l /dev/mpath/


ls -l /dev/mapper/


multipath -ll 


[root@$GRID_HOME/bin/kfed dev=/dev/oracleasm/disks/DATA001 op=READ | egrep "kfdhdb.vf|ausize"
[root@$GRID_HOME/bin/kfed dev=/dev/oracleasm/disks/DATA002 op=READ | egrep "kfdhdb.vf|ausize"
[root@$GRID_HOME/bin/kfed dev=/dev/oracleasm/disks/DATA003 op=READ | egrep "kfdhdb.vf|ausize"

Now that the ASMLib software is installed, a few steps have to be taken by the system administrator to make the ASM driver available.
The ASM driver needs to be loaded, and the driver filesystem needs to be mounted.
This is taken care of by the initialization script, /etc/init.d/oracleasm. 
Run the /etc/init.d/oracleasm script with the 'configure' option.
It will ask for the user and group that default to owning the ASM driver access point.
If the database was running as the 'oracle' user and the 'dba' group, the output would look like this:
                                          
[root@ca-test1 /]# /etc/init.d/oracleasm configure


Configuring the Oracle ASM library driver.

  This will configure the on-boot properties of the Oracle ASM library
  driver.  The following questions will determine whether the driver is
  loaded on boot and what permissions it will have.  The current values
  will be shown in brackets ('[]').  Hitting  without typing an
  answer will keep that current value.  Ctrl-C will abort.
  Default user to own the driver interface []: oracle
  Default group to own the driver interface []: dba
  Start Oracle ASM library driver on boot (y/n) [n]: y
  Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
  Writing Oracle ASM library driver configuration            [  OK  ]
  Creating /dev/oracleasm mount point                        [  OK  ]
  Loading module "oracleasm"                                 [  OK  ]
  Mounting ASMlib driver filesystem                          [  OK  ]
  Scanning system for ASM disks                              [  OK  ]

 [root@ca-test1 /]# /etc/init.d/oracleasm disable
  Writing Oracle ASM library driver configuration            [  OK  ]
  Unmounting ASMlib driver filesystem                        [  OK  ]
  Unloading module "oracleasm"                               [  OK  ]
  [root@ca-test1 /]# /etc/init.d/oracleasm enable
  Writing Oracle ASM library driver configuration            [  OK  ]
  Loading module "oracleasm"                                 [  OK  ]
  Mounting ASMlib driver filesystem                          [  OK  ]
  Scanning system for ASM disks                              [  OK  ]
Existing disks can be listed and queried:                                         

 [root@ca-test1 /]# /etc/init.d/oracleasm listdisks
  VOL1
  VOL2
  VOL3


  [root@ca-test1 /]# /etc/init.d/oracleasm querydisk VOL1
  Checking for ASM disk "VOL1"                               [  OK  ]
                                       
When a disk is added to a RAC setup, the other nodes need to be notified about it.
Run the 'createdisk' command on one node, and then run 'scandisks' on every other node:                                           
  [root@ca-test1 /]# /etc/init.d/oracleasm scandisks
  Scanning system for ASM disks                              [  OK  ]


Execute the ‘lsmod’ command (as root), to show the loaded oracleasm module.
==============================================================================




The oracleasm should be listed with a “Used by” column setting of ‘1’.


 [root@racnode2 root]# lsmod
 Module Size Used by Not tainted
 ide-cd 35296 0 (autoclean)
 cdrom 35520 0 (autoclean) [ide-cd]
 soundcore 7940 0 (autoclean)
 oracleasm 16384 1
 cpqfc 53376 1
 autofs 13796 0 (autoclean) (unused)
 ocfs 302088 3
 eepro100 21968 2
 ext3 70944 6
 jbd 55444 6 [ext3]
 cpqarray 26080 10
 sd_mod 13920 1
 scsi_mod 126812 2 [cpqfc sd_mod]