Search This Blog

Monday, August 2, 2010

ASM



What is the ASM (Automatic Storage Management)

- Intrgrated file system and volume manager expressly build for oracle database files.

- ASM Provide performance of raw I/O with easy management of file system.

ASM – Extends the power of oracle managed files. ASM files created and managed automatically by YOU.

One additional feature Mirroring and Striping.


ASM Mirroring more flexible than operating system mirrored disks because ASM mirroring enables the redundancy level.


ASM Mirroring Options

Mirroring Option Description

2-way mirroring Each extent has 1 mirrored copy.

3-way mirroring Each extent has 2 mirrored copies.

Unprotected ASM provides no mirroring. Used when mirroring is provided by the disk subsystem itself.

Dynamic Storage Configuration

- ASM enable you have to change storage configuration without having to take the database offline.

- It’s Automatically rebalance

- If disk failure error occur; ASM automatically rebalance to restore full redundancy

Failure Groups

Failure Groups determine ASM disk that share common potential failure mechanism.



 Errors in ASM
 
ORA-29701: Unable to connect to Cluster Manager

ORA-29701: Unable to connect to Cluster Manager

Every time I would try to start an ASM instance I would get this error:

Today In my ASM environment; When I try to start asm instance i got the below error message.

ORA-29701: Unable to connect to Cluster Manager



This is error releated to cluster manager goes down. We need to start manager using "localconfig add/delete"



1/ Log in as roor user

2/ Set your ORACLE_HOME

3/ execute the below command



$ORACLE_HOME/bin/localconfig delete

$ORACLE_HOME/bin/localconfig add



In Windows



C:\Documents and Settings\Baskar>SET ORACLE_SID=+ASM

C:\Documents and Settings\Baskar>set ORACLE_HOME=f:\oracle\product\10.2.0\db_1

C:\Documents and Settings\Baskar>%ORACLE_HOME%\bin\localconfig delete

Step 1: stopping local CSS stack

Step 2: deleting OCR repository

successfully deleted local CSS setup

C:\Documents and Settings\Baskar>

C:\Documents and Settings\Baskar>%ORACLE_HOME%\bin\localconfig add

Step 1: creating new OCR repository

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'baskar', privgrp ''..

Operation successful.

Step 2: creating new CSS service

successfully created local CSS service

successfully added CSS to home







Feel free post your comments.





ORA-12547: TNS:lost contact During ASM Instance Creation


Hi,



Using RHEL 4 & 10.2.0.4; I was trying to configure two node RAC Cluster. When i try configure ASM instance creation using DBCA I got the below error message.



ORA-12547: TNS:lost contact



Cluster Services & LISTENER working fine. But still not able to create ASM instance.



Work Around I:



1. Close your DBCA Session

2. Stop your cluster listener in your all the nodes

3. $ORACLE_HOME/bin



relink all



Once i relink my oracle home; it's should be work; but in my case continuously getting TNS Lost contact error message.



Work Around II:



When I try to type sqlplus in my terminal window i got some RPM package issues



-bash-3.00$ sqlplus



SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 25 15:34:47 2010



Copyright (c) 1982, 2007, Oracle. All Rights Reserved.



Enter user-name:

oracleoracle: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

ERROR:

ORA-12547: TNS:lost contact



Current RPM Version:



The RPM package libaio-0.3.103-3.X86_64.RPM has not been installed.



$ rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH})\n"
grep libaio



libaio-0.3.105.2 (ia64)

libaio-0.3.105.2 (i386)



The output should show:



libaio-0.3.105.2 (x86_64)

libaio-0.3.105.2 (i386)





As per 394297.1; We upgraded this RPM package after it's working fine.



After Upgrade RPM Package:



rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH})\n"
grep libaio



libaio-devel-0.3.105.2 (x86_64)

libaio-0.3.105.2 (x86_64)

libaio-0.3.105.2 (i386)



SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 25 16:59:35 2010



Copyright (c) 1982, 2007, Oracle. All Rights Reserved.



Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied



Please share with your valuable comments & feedback. Thanks


"Marking disk "VOL1" as an ASM disk: [FAILED]"


Kernel : 2.6.9-42.EL-2.0.3



OS : Red Hat Enterprise Linux 4 AS



Database: 10.2.0.1





While doing ASM Configuraion, I got below error message



"Marking disk "VOL1" as an ASM disk: [FAILED]"



Not able to create ASM Disk's



[oracle@localhost ~]$ su - root



Password:



[root@localhost Desktop]# uname -r



2.6.9-42.0.0.0.1.ELhugemem



[root@localhost ~]#



[root@localhost ~]# cd Desktop/



[root@localhost Desktop]# ls -lrt



total 8



drwx------ 2 root root 4096 Mar 22 04:15 Trash



[root@localhost Desktop]# cd /home/oracle/Desktop/



[root@localhost Desktop]# ls -lrt



total 268



drwx------ 2 oracle oinstall 4096 Mar 22 14:20 Trash



-rw-r--r-- 1 oracle oinstall 4298 Mar 22 14:20 Home.desktop



-rw-r--r-- 1 oracle oinstall 82256 Mar 22 14:40 oracleasm-support-2.1.2-1.el4.i386.rpm



-rw-r--r-- 1 oracle oinstall 12948 Mar 22 14:40 oracleasmlib-2.0.2-1.i386.rpm



-rw-r--r-- 1 oracle oinstall 127412 Mar 22 14:41 oracleasm-2.6.9-42.EL-2.0.3-1.i686.rpm



[root@localhost Desktop]#



[root@localhost Desktop]# rpm -Uvh oracleasm-2.6.9-42.EL-2.0.3-1.i686.rpm \



> oracleasmlib-2.0.2-1.i386.rpm \



> oracleasm-support-2.1.2-1.el4.i386.rpm



Preparing... ########################################### [100%]



1:oracleasm-support ########################################### [ 33%]



2:oracleasm-2.6.9-42.EL ########################################### [ 67%]



3:oracleasmlib ########################################### [100%]



[root@localhost Desktop]#



[root@localhost Desktop]# /etc/init.d/oracleasm scandisks



Scanning the system for Oracle ASMLib disks: [ OK ]



[root@localhost Desktop]#



[root@localhost Desktop]# /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



Scan for Oracle ASM disks on boot (y/n) [y]: y



Writing Oracle ASM library driver configuration: done



Initializing the Oracle ASMLib driver: [ OK ]



Scanning the system for Oracle ASMLib disks: [ OK ]



[root@localhost Desktop]#



[root@localhost Desktop]# /etc/init.d/oracleasm start



Initializing the Oracle ASMLib driver: [ OK ]



Scanning the system for Oracle ASMLib disks:



^[[A



[ OK ]



[root@localhost Desktop]#



[root@localhost Desktop]# /etc/init.d/oracleasm start



Initializing the Oracle ASMLib driver: [ OK ]



Scanning the system for Oracle ASMLib disks: [ OK ]



[root@localhost Desktop]#



[root@localhost Desktop]# /etc/init.d/oracleasm enable



Writing Oracle ASM library driver configuration: done



Initializing the Oracle ASMLib driver: [ OK ]



Scanning the system for Oracle ASMLib disks: [ OK ]



[root@localhost Desktop]#



[root@localhost Desktop]# /etc/init.d/oracleasm createdisk /dev/sda6



Action "createdisk" requires two arguments



[root@localhost Desktop]#



[root@localhost Desktop]# /etc/init.d/oracleasm createdisk VOL1 /dev/sda6



Marking disk "VOL1" as an ASM disk: [FAILED]  
 
 
Loading module "oracleasm": Unable to load module "oracleasm"




OS: Red Hat Enterprise Linux 4



Kernel : 2.6.9-22.EL



Database Version: 10.2.0.1



When I try to configure ASM disk I got below error message.











"Loading module "oracleasm": Unable to load module "oracleasm"











As per metalink "Doc ID: 338770.1". Need to upgrade kernel version











Uname –r

2.6.9-22.EL







[root@localhost Desktop]# rpm -Uvh



oracleasm-2.6.9-11.EL-2.0.3-1.i686.rpm \ >



oracleasmlib-2.0.2-1.i386.rpm \



> oracleasm-support-2.0.3-1.i386.rpm



Preparing... ########################################### [100%]



1:oracleasm-support ########################################### [ 33%]

2:oracleasm-2.6.9-11.EL ########################################### [ 67%]

3:oracleasmlib ########################################### [100%]







[root@localhost ~]# /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) [y]: y

Fix permissions of Oracle ASM disks on boot (y/n) [y]: y

Writing Oracle ASM library driver configuration: [ OK ]

Loading module "oracleasm": Unable to load module "oracleasm"



[FAILED]



 
How to create ASM Instance




1. Before creating ASM instance you need to create asm disk using raw disk or using ASMLib disk.


1. Creating files using "dd" command




[oracle@localhost asmdisks]$ su - root

Password:

[root@localhost ~]# mkdir /dbbackup/asmdiks





[root@localhost ~]# chown oracle:oinstall /dbbackup/asmdiks/

[root@localhost ~]#

[root@localhost ~]# su - oracle







[oracle@localhost ~]$ dd if=/dev/zero of=/dbbackup/asmdiks/_file_disk1 bs=1k count=1000000

1000000+0 records in

1000000+0 records out



[oracle@localhost ~]$ dd if=/dev/zero of=/dbbackup/asmdiks/_file_disk2 bs=1k count=1000000

1000000+0 records in

1000000+0 records out



[oracle@localhost ~]$ dd if=/dev/zero of=/dbbackup/asmdiks/_file_disk3 bs=1k count=1000000

1000000+0 records in

1000000+0 records out



[oracle@localhost ~]$ cd /dbbackup/asmdiks/



[oracle@localhost asmdiks]$ ls -lrt

total 3002964

-rw-r--r-- 1 oracle oinstall 1024000000 Mar 27 04:45 _file_disk1

-rw-r--r-- 1 oracle oinstall 1024000000 Mar 27 04:48 _file_disk2

-rw-r--r-- 1 oracle oinstall 1024000000 Mar 27 04:52 _file_disk3









2. Makeing RAW disk using "losetup" command
[oracle@localhost asmdiks]$ su - root

Password:





[root@localhost ~]# losetup /dev/loop1 /dbbackup/asmdiks/_file_disk1



[root@localhost ~]# losetup /dev/loop2 /dbbackup/asmdiks/_file_disk2



[root@localhost ~]# losetup /dev/loop3 /dbbackup/asmdiks/_file_disk3



[root@localhost ~]## raw /dev/raw/raw1 /dev/loop1

/dev/raw/raw1: bound to major 7, minor 1



[root@localhost ~]## raw /dev/raw/raw2 /dev/loop2

/dev/raw/raw2: bound to major 7, minor 2



[root@localhost ~]## raw /dev/raw/raw3 /dev/loop3

/dev/raw/raw3: bound to major 7, minor 3





4. Change Ownership of RAW Devices





Finally, let's change the ownership of all four RAW devices:



# chown oracle:dba /dev/raw/raw1

# chown oracle:dba /dev/raw/raw2

# chown oracle:dba /dev/raw/raw3

# chown oracle:dba /dev/raw/raw4



# chmod 775 /dev/raw/raw1

# chmod 775 /dev/raw/raw2

# chmod 775 /dev/raw/raw3

# chmod 775 /dev/raw/raw4









5. Startup Script









Before restarting your OS you need to write small script for enable your raw disk in /etc/init.d/









/sbin/losetup /dev/loop1 /asmdisks/_file_disk1; sleep 2

/sbin/losetup /dev/loop2 /asmdisks/_file_disk2; sleep 2

/sbin/losetup /dev/loop3 /asmdisks/_file_disk3; sleep 2

/sbin/losetup /dev/loop4 /asmdisks/_file_disk4; sleep 2



/usr/bin/raw /dev/raw/raw1 /dev/loop1; sleep 2

/usr/bin/raw /dev/raw/raw2 /dev/loop2; sleep 2

/usr/bin/raw /dev/raw/raw3 /dev/loop3; sleep 2

/usr/bin/raw /dev/raw/raw4 /dev/loop4; sleep 2



/bin/chown oracle:dba /dev/raw/raw1

/bin/chown oracle:dba /dev/raw/raw2

/bin/chown oracle:dba /dev/raw/raw3

/bin/chown oracle:dba /dev/raw/raw4



/bin/chmod 660 /dev/raw/raw1

/bin/chmod 660 /dev/raw/raw2

/bin/chmod 660 /dev/raw/raw3

/bin/chmod 660 /dev/raw/raw4



sleep 120



su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart"



su - $ORACLE_OWNER -c "lsnrctl start listener"

No comments:

Post a Comment