Thursday, January 22, 2009

How to create ASM instance

ASM instance is used to manage database files.If a node hosts multiple databases,single database,files can be managed using ASM.

Two possible ASM deployments are:

1) Seperate oracle home is there are multiple databases on a single node

2) No seperate oracle home if the node hosts a single database.

ASM instance needs to be created and started before the Oracle database instance is started.

css - cluster synchronization service daemon is used to establish connection between an ASM instance and oracle database instance.

To startup ASM instance alone and restrict the connection to Oracle database instance startup ASM instance as follows:

SQL>STARTUP RESTRICT;

Steps to startup an ASM instance are as follows:

1) Check is css is running using

ps -efgrep css

We can also use crsctl command to check if css appears healthy

crsctl check css

If css isn't up and running startup ASM as follows

1) Login as root user

2) export PATH=PATH:$ORACLE_HOME

3) localconfig addThe localconfig command creates /etc/oracle file,startsup css.The $ORACLE_HOME/css/admin has control script for css startup and shutdown.

It adds init.cssd to /etc/inittab file.

If we use DBCA to create an instance css is started automatically.

2) Create a initialization parameter file initasm+.ora with the following parameters set.

Instance_type=+ASM

ASM_POWER_Limit =Value from 1 to 11

ASM_Diskstring = '/dev/sda*',

ASM_DISKGROUPS=dg1,dg2

3) Startup the instance.ASM doesn't have a data dictionary.It is mandatory to login as a user with SYSDBA/SYSOPER privilege.For local authentication use Operating system(OS) authentication.For remote authentication use a password file.

4) Set ORACLE_SID=+ASM (ASM is the default value).The value set for instance_type is mapped internally to db_unique_name.

$sqlplus / nolog

SQL>connect / as sysdba

SQL> startup pfile='/asd/initasm+.ora'

This step creates an ASM instance.ASM cache is the SGA component specific to ASM.It takes as little as 25MB- 30MB space.Total spce needed for an ASM instance is 100MB as it doesnt have any datafiles.

5) Check is ASM instance is up and running using :

ps -efgrep asm

The step above lists background processes like:

asm_pmon_+asm

asm_smon_+asm

asm_lgwr_+asm

asm_ckpt_+asm

asm_dbw0_+asm

asm_mman_+asm

Few special is ASM like

asm_rbal_+asm

asm_psp0_+asm

asm_gmaon_+asm

No comments: