Saturday, August 22, 2015

RHEL5 - ASM Disk creation

ASM Disk creation - ASM disk is used for Oracle RAC.

# fdisk /dev/sdb

n
p
1
enter
t
8e
w

# fdisk -l

Disk /dev/sdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       13054   104856223+  8e  Linux LVM


# /etc/init.d/oracleasm
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
# /etc/init.d/oracleasm listdisks
ASMDISK1
ASMDISK2
# /etc/init.d/oracleasm createdisk ASMDISK3 /dev/sdb1
Marking disk "ASMDISK3" as an ASM disk:                    [  OK  ]
# /etc/init.d/oracleasm listdisks
ASMDISK1
ASMDISK2
ASMDISK3
#

Find ASM disk size

# lvs
# fdisk -l
# multipath -ll | more
# multipath -ll | grep -A 1 ASMDISK
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}'
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}'
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}' | sed -e 's/[features=1//'
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}' | sed -e 's/[features=1//'
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}' | sed -e 's/\[features=1//'
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}' | sed -e 's/\[features=1//' | grep ASM
# multipath -ll | grep -A 1 ASMDISK | awk '{l1=$0;getline;print l1 " " $0}' | awk '{print $1 " " $5}' | sed -e 's/\[features=1//' | grep ASM
ASMDISK18 [size=101G]
ASMDISK20 [size=101G]
ASMDISK17 [size=101G]
ASMDISK16 [size=101G]
ASMDISK14 [size=101G]
ASMDISK12 [size=101G]
ASMDISK11 [size=101G]
ASMDISK10 [size=101G]
ASMDISK06 [size=101G]
ASMDISK05 [size=101G]
ASMDISK19 [size=101G]
ASMDISK21 [size=101G]
#

1. Got following error
Discovered disk: ORCL:ASMSYS02 [4224000 blocks (2162688000 bytes), maxio 256]
Discovered disk: ORCL:ASMSYS03 [4224000 blocks (2162688000 bytes), maxio 256]

2. Oracle requested to generate some report
# cd /opt/oracle/diag/asm/+asm/+ASM2/trace
# . oraenv
ORACLE_SID = [root] ?

# ps -ef | grep -i pmon
oracle    1726     1  0 10:01 ?        00:00:00 asm_pmon_+ASM2
root      3437 28388  0 12:06 pts/11   00:00:00 grep -i pmon
oracle   12197     1  0 10:16 ?        00:00:02 ora_pmon_ERPPDB2
oracle   15498     1  0 10:18 ?        00:00:02 ora_pmon_SDPPDB2
oracle   16272     1  0 10:19 ?        00:00:01 ora_pmon_RPNNERP2
# . oraenv
ORACLE_SID = [root] ? +ASM2


Here is a request from DBA guy

Sam,
We need the output of the following commands for priority 1 case with oracle, please send me the output.

As a root user, run the following commands

1. Login to Database server and run the commands below
$ ssh rtfsdbv25
$ sudo su -
#
# script /tmp/asm_details.txt
# hostname
-- rtfsdbv25:/opt/oracle/diag/asm/+asm/+ASM2/trace>fgrep + /etc/oratab
+ASM2:/opt/grid:N

# . oraenv
-- Type ASM2 depending on the following output
# lsmod|grep oracleasm
# modinfo oracleasm
# /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
# exit

-- Email the script file generated in /tmp/asm_details.txt


No comments:

Post a Comment