In this document we will see how we can install ASM (Automatic Storage Management) with an already installed non-asm database. We assume here that there is already an oracle database up and running with its data files on file system.

NOTE: This oracle 10g instance is running on a virtual machine on VMWare server having RHEL 5.4 installed on it.


$ sqlplus / as sysdba SQL> show parameter db_name NAME TYPE VALUE ------------------ ----------- --------------- db_name string ora10g SQL> exit /* We have a database running with a name ora10g */ $ lsnrctl status Copyright (c) 1991, 2005, Oracle. All rights reserved. . . . [output trimmed] Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "ora10g" has 1 instance(s). Instance "ora10g", status READY, has 1 handler(s) for this service... Service "ora10gXDB" has 1 instance(s). Instance "ora10g", status READY, has 1 handler(s) for this service... Service "ora10g_XPT" has 1 instance(s). Instance "ora10g", status READY, has 1 handler(s) for this service... The command completed successfully /* A listener process running and registered with our database "ora10g". */

The next step is to add and configure a few disks to the system for ASM.

Add/Configure ASM disks.

Allow oracle user to access the X server as it needs to run DBCA now for ASM instance creation.

# xhost +SI:localuserracle

Login as oracle and run dbca.

This is the welcome screen for DBCA.

Welcome Screen

Select "Configure Automatic Storage Management". Press Next.

Select Operation

If the existing database was created on file system then the CSS (Cluster Synchronization Service) is not installed on your system. You will get an error like this. Press Ok.

CSS Warning

Log in as root in another console and run the localconfig utility in your $ORACLE_HOME/bin directory like this:

# /u01/apps/oracle/product/10.2.0/db_1/bin/localconfig add /etc/oracle does not exist. Creating it now. Successfully accumulated necessary OCR keys. Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. Configuration for local CSS has been initialized Adding to inittab Startup will be queued to init within 90 seconds. Checking the status of new Oracle init process... Expecting the CRS daemons to be up within 600 seconds. CSS is active on these nodes. ora10 CSS is active on all nodes. Oracle CSS service is installed and running under init(1M)

Now come back to DBCA and press next. On the next screen you will be asked for a password of SYS user on the ASM instance.

Create ASM Instance

This is just a confirmation that DBCA is going to create the ASM instance now. Just press ok if you want to proceed.

Confirm ASM Instance Creation

ASM instance is being created.

ASM Instance Creation in Progress

Once the ASM instance is created you will see the next screen which is about ASM Disk Groups. Press "Create New" here.

ASM Disk Groups

Now you should see a dialog box like this.

Create Disk Group (ASMLib Disks)

Here you should see all the disks that you have configured as ASM disks using ASMLib. Provide the name of the disk group and choose the disks that will be used in this disk group.

There are three redundancies (ASM data mirroring mechanism) available:
EXTERNAL - This means no mirroring at all. This option is used when you have some kind of hardware mirroring already in place like, RAID.
NORMAL - ASM does two way mirroring i.e. it will keep two copies of all your data on different disks.
HIGH - ASM does three way mirroring i.e. it will keep three copies of all your data on different disks.

We are planning to have NORMAL redundancy for our disk group DATA, so we will have to choose at least two disks in one disk group to support two way mirroring. I am choosing ORCL:ASM1 and ORCL:ASM2 for the disk group DATA.

If you are using Raw disks then this screen will look like this: Rest everything is same as it is in ASMLib.

Create Disk Group (Raw Disks)

Press "Create New" on the ASM Disk Groups page again and create another diskgroup RECOVERY using disks ORCL:ASM3 and ORCL:ASM4.

Create Disk Group (ASMLib Disks)

Once you are done creating your diskgroups, your ASM Disk Groups page should look like this:

ASM Disk Groups

Now press finish and you will see a confirmation like this. Press "No" because there is nothing else we need to do.

Perform another Operation Confirmation

ASM Instance is now created.

$ lsnrctl status Copyright (c) 1991, 2005, Oracle. All rights reserved. . . . [output trimmed] Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM", status BLOCKED, has 1 handler(s) for this service... Service "+ASM_XPT" has 1 instance(s). Instance "+ASM", status BLOCKED, has 1 handler(s) for this service... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "ora10g" has 1 instance(s). Instance "ora10g", status READY, has 1 handler(s) for this service... Service "ora10gXDB" has 1 instance(s). Instance "ora10g", status READY, has 1 handler(s) for this service... Service "ora10g_XPT" has 1 instance(s). Instance "ora10g", status READY, has 1 handler(s) for this service... The command completed successfully

Notice that the +ASM, which is the sid for the ASM instance is registered with the listener.

$ export ORACLE_SID=+ASM $ sqlplus / as sysdba SQL> select name from v$asm_diskgroup; NAME ------------------------------ DATA RECOVERY SQL>

A successful login with the ASM instance and query the list of disk groups.