Mount ASM diskgroups with new ASM instance

Imagine you have 11gR2 Oracle Restart configuration with database files located in ASM.

After server crash you realized that local disks are corrupted and with local disks you lost all Oracle installations. Even though this is important system you don’t have database backup (always take backups!).

But you managed to save all ASM disks as they were located on separate storage.

This will be small beginner guide on how to help yourself in such situation.

As old server crashed you must create new server configuration, identical as old configuration. Nice thing about ASM is that it keeps it’s metadata in disk header. If disks are intact and headers are not damaged you should be able to mount diskgroups with new ASM instance. But this new instance must be compatible with your diskgroups.

Grid Infrastrcuture and database software were version and this version I will install on new server.

To keep this post short enough steps like creating users, installing ASMLib and other packages, configuring kernel parameters,… are excluded.

List Oracle ASM disks mounted to new server.
With “scandisks” command I will find devices which have been labeled as ASM disks.

# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
# oracleasm listdisks
Install “Oracle Grid Infrastructure software only” option to avoid automatic Oracle Restart and ASM configuration. This configuration will be performed later manually.

After installation finished run noted perl script as root to configure Grid Infrastructure for a Stand-Alone server.
For my configuration script looks like this:

To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/ -I/u01/app/ -I/u01/app/ /u01/app/
Start cssd if it’s not running.
# ./crsctl stat res -t
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
Cluster Resources
      1        OFFLINE OFFLINE
      1        OFFLINE OFFLINE
# ./crs_start ora.cssd
Attempting to start `ora.cssd` on member `asterix`
Attempting to stop `ora.diskmon` on member `asterix`
Stop of `ora.diskmon` on member `asterix` succeeded.
Attempting to start `ora.diskmon` on member `asterix`
Start of `ora.diskmon` on member `asterix` succeeded.
Start of `ora.cssd` on member `asterix` succeeded.
Create parameter file for ASM instance in $ORACLE_HOME/dbs directory of Grid Infrastructure.
Register and start ASM instance.

$ export ORACLE_SID=+ASM
$ export ORACLE_HOME=/u01/app/
$ srvctl add asm -p $ORACLE_HOME/dbs/init+ASM.ora
$ srvctl start asm
$ srvctl status asm
ASM is running on asterix

Now notice what I see when I start ASM configuration assistant

$ ./asmca

These are diskgroups with my database and recovery files.
Click “Mount all” to mount them all.

Install Oracle database software and create parameter file in “$ORACLE_HOME/dbs” to start database.

$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
$ export ORACLE_SID=ora11gr2
$ cd $ORACLE_HOME/dbs
$ cat initora11gr2.ora
$ sqlplus / as sysdba
SQL*Plus: Release Production on Wed Oct 29 14:29:37 2014
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area  668082176 bytes
Fixed Size                  2216344 bytes
Variable Size             222301800 bytes
Database Buffers          436207616 bytes
Redo Buffers                7356416 bytes
Database mounted.
Database opened.
SQL> select name from v$datafile;

Database is successfully opened and you can register instance using SRVCTL command.

$ srvctl add database -d $ORACLE_SID -o $ORACLE_HOME -p $ORACLE_HOME/dbs/initora11gr2.ora
$ srvctl start database -d $ORACLE_SID
Final status.
$ ./crsctl stat res -t
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
Local Resources
               ONLINE  ONLINE       asterix
               ONLINE  ONLINE       asterix
               ONLINE  ONLINE       asterix
               ONLINE  ONLINE       asterix                  Started
Cluster Resources
      1        ONLINE  ONLINE       asterix
      1        ONLINE  ONLINE       asterix
      1        ONLINE  ONLINE       asterix                  Open




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s