Saturday, June 27, 2009

Oracle AS Guard cloning - Add MT instance using Oracle ASGuard

Oracle AS Guard cloning

Please see my previous thread on how to setup the Oracle AS Guard setup.

In this thread i am posting how to install MT instance (Portal and Wireless option) and clone this newly installed MT instance to the standby instance.

Even if the primary node is unavailable (primary node is not reachable), you can still switch over to the seconday node (manual switchover). I have tested this and it perfectly works fine.OracleAS guard is more flexible.

The MT cloning took 10 min and switch over took 3 min.
In case of swithover situation,your cutover time would be approx 3-5 min.

With the help of DNS switch and/or LBR, the FO or SO option will be very transparent to the users/other applications.

Caution -
-------

Be little cautious using this option for your Oracle IAS environment as Active/Passive cluster.Without proper understanding of this process, you may corrupt the AS Guard setup.

This feature has to be completely tested before using it in a production environment.
Steps
-----
1.Keep the primary and standby instances up and running (Both instances running only Infrastructure) - ie Oracle AS Guard is setup and active for the infra instance.
2.Install MT (portal and Wireless option) on to the first instance(Primary)
3.Clone the newly added MT instance to the standby instance (DSA port should same as the primary DSA).start the asgctl from MT instance (not from infra home)
4.If this clone is successfull , veryify the topology and confirm everything is fine.
5.Now test the switchover is possible
6.Switch back to the primary node

on Primary node
===============
After the MT install, stop all the MT opmn process

connect to asgctl

connect to primary database

clone the MT instance to the standby instance.

ASGCTL> clone instance mt.ias1.ushasuji.com to rinfra
Generating default policy for this operation

IAS1:7891
Clone Instance

IAS1:7891 (home /u01/oracle/product/mt)
Running configure option in bkp_restore script.
Running node_backup prepare option in bkp_restore script. This may take a few minutes
Running node_backup image_backup option in bkp_restore script. This may take a few minutes
Please run /u01/oracle/product/mt/backup_restore/brHome12228823ba8.sh as root. Enter "Yes" after the script is completed successfully, "No" otherwise. Yes or No
yes

ias1 192.168.1.16:7891 (home /u01/oracle/product/mt)
Copying backup file "/u01/oracle/product/loha/mt/as_mt.ias1.ushasuji.com_2009-06-28_17-04-03.img" from "192.168.1.15" [192.168.1.15] to "192.168.1.16" at "/u01/oracle/product/loha/mt/as_mt.ias1.ushasuji.com_2009-06-28_17-04-03.img"
Unpacking image backup at target host. This may take a few minutes
Running node_restore sys_init option in bkp_restore script.
Please run /u01/oracle/product/mt/backup_restore/brHome122283ed9fe.sh as root. Enter "Yes" after the script is completed successfully, "No" otherwise. Yes or No
yes
Running node_restore inst_register option in bkp_restore script.
Please run /u01/oracle/product/mt/backup_restore/brHome122283ed9fe.sh as root. Enter "Yes" after the script is completed successfully, "No" otherwise. Yes or No
yes
ASGCTL>

Check everything is copied on to the standby MT home.It may prompt to run the copy script twice as root user.

This clone process will stop the MR database istance and all the Infra/MT opmn process on node1 and starts in node2.I mean the current primary node becomes standby and old standby becomes primary. So easy .... All is taken care automatically by Oracle AG Guard.

If no errors , then you are all to test the switchover.

From Primary Node
-------------------

Now switchover both infrastructure and Mid Tier applications to standby node - Rinfra

ASGCTL> switchover topology to rinfra

IAS1 192.168.1.15:7890 (home /u01/oracle/product/infra)
Connecting to the primary database ias.ushasuji.com
Gathering information from the primary database ias.ushasuji.com

ias1:7891 (home /u01/oracle/product/mt)
Shutting down component HTTP_Server
Shutting down component WebCache
Shutting down component OC4J
Shutting down component dcm-daemon
Shutting down component LogLoader

ias1 192.168.1.16:7890 (home /u01/oracle/product/infra)
Running emctl command: "/u01/oracle/product/infra/bin/emctl status iasconsole".
Shutting down component OID
Shutting down component HTTP_Server
Shutting down component OC4J
Shutting down component dcm-daemon
Shutting down component LogLoader

IAS1:7891 (home /u01/oracle/product/mt)
Shutting down each instance in the topology
Shutting down component HTTP_Server
Shutting down component WebCache
Shutting down component OC4J
Shutting down component dcm-daemon
Shutting down component LogLoader

IAS1 192.168.1.15:7890 (home /u01/oracle/product/infra)
Running emctl command: "/u01/oracle/product/infra/bin/emctl status iasconsole".
Shutting down component OID
Shutting down component HTTP_Server
Shutting down component OC4J
Shutting down component dcm-daemon
Shutting down component LogLoader

IAS1:7891 (home /u01/oracle/product/mt)
Synchronizing topology
Synchronizing each instance in the topology to standby topology
Starting backup of topology ""
Backing up and copying data to the standby topology
Backing up each instance in the topology
Starting backup of instance "mt.ias1.ushasuji.com"
Configuring the backup script

IAS1 192.168.1.15:7890 (home /u01/oracle/product/infra)
Starting backup of instance "infra.ias1"
Configuring the backup script
Oracle Application Server Backup/Recovery Tool 10g (10.1.2.0.2)
Copyright (c) 2004, 2005, Oracle. All rights reserved.

Performing configuration ...
Configuration completed successfully !!!
Backing up the instance configuration files. This may take a few minutes

IAS1:7891 (home /u01/oracle/product/mt)
Backing up the instance configuration files. This may take a few minutes
Deleted directory "/u01/oracle/product/mt/dsa/backup".

IAS1 192.168.1.15:7890 (home /u01/oracle/product/infra)
Deleted directory "/u01/oracle/product/infra/dsa/backup".
Oracle Application Server Backup/Recovery Tool 10g (10.1.2.0.2)
Copyright (c) 2004, 2005, Oracle. All rights reserved.

Backing up configuration files ...
Warning(s) during backup - please check /u01/oracle/product/infra/dsa/backup/log/2009-06-28_17-46-19_config_bkp.log
Configuration backup archive is /u01/oracle/product/infra/dsa/backup/config_bkp_2009-06-28_17-46-19.jar
Configuration backup completed with warning(s) logged in
file /u01/oracle/product/infra/dsa/backup/log/2009-06-28_17-46-19_config_bkp.log

IAS1:7891 (home /u01/oracle/product/mt)
Copying backup file "/u01/oracle/product/mt/dsa/backup/config_bkp_2009-06-28_17-46-19.jar" from "IAS1" [192.168.1.15] to "192.168.1.16" at "/u01/oracle/product/mt/dsa/backup/mt.ias1.ushasuji.com/config_bkp_2009-06-28_17-46-19.jar"

IAS1 192.168.1.15:7890 (home /u01/oracle/product/infra)
Copying backup file "/u01/oracle/product/infra/dsa/backup/config_bkp_2009-06-28_17-46-19.jar" from "IAS1" [192.168.1.15] to "192.168.1.16" at "/u01/oracle/product/infra/dsa/backup/infra.ias1/config_bkp_2009-06-28_17-46-19.jar"
Copying backup catalog file /u01/oracle/product/infra/backup_restore/data/catalog.txt from IAS1 [192.168.1.15] to 192.168.1.16

IAS1:7891 (home /u01/oracle/product/mt)
Copying backup catalog file /u01/oracle/product/mt/backup_restore/data/catalog.txt from IAS1 [192.168.1.15] to 192.168.1.16

IAS1 192.168.1.15:7890 (home /u01/oracle/product/infra)
Completed backup of instance "infra.ias1"

IAS1:7891 (home /u01/oracle/product/mt)
Completed backup of instance "mt.ias1.ushasuji.com"
Starting restore of topology ""
Restoring data to the standby topology
Restoring each instance in the topology

ias1 192.168.1.16:7890 (home /u01/oracle/product/infra)
Copying backup file "/u01/oracle/product/infra/dsa/backup/infra.ias1/config_bkp_2009-06-28_17-46-19.jar" from "192.168.1.16" to "ias1" [192.168.1.16] at "/u01/oracle/product/infra/dsa/backup/config_bkp_2009-06-28_17-46-19.jar"

ias1:7891 (home /u01/oracle/product/mt)
Copying backup file "/u01/oracle/product/mt/dsa/backup/mt.ias1.ushasuji.com/config_bkp_2009-06-28_17-46-19.jar" from "192.168.1.16" to "ias1" [192.168.1.16] at "/u01/oracle/product/mt/dsa/backup/config_bkp_2009-06-28_17-46-19.jar"

ias1 192.168.1.16:7890 (home /u01/oracle/product/infra)
Deleting backup file "/u01/oracle/product/infra/dsa/backup/infra.ias1/config_bkp_2009-06-28_17-46-19.jar"

ias1:7891 (home /u01/oracle/product/mt)
Deleting backup file "/u01/oracle/product/mt/dsa/backup/config_bkp_2009-06-28_17-46-19.jar"
Starting restore of instance "mt.ias1.ushasuji.com"

ias1 192.168.1.16:7890 (home /u01/oracle/product/infra)
Starting restore of instance "infra.ias1"

ias1:7891 (home /u01/oracle/product/mt)
Configuring the backup script

ias1 192.168.1.16:7890 (home /u01/oracle/product/infra)
Configuring the backup script

ias1:7891 (home /u01/oracle/product/mt)
Restoring the instance configuration files. This may take a few minutes

ias1 192.168.1.16:7890 (home /u01/oracle/product/infra)
Oracle Application Server Backup/Recovery Tool 10g (10.1.2.0.2)
Copyright (c) 2004, 2005, Oracle. All rights reserved.

Performing configuration ...
Configuration completed successfully !!!
Restoring the instance configuration files. This may take a few minutes
Oracle Application Server Backup/Recovery Tool 10g (10.1.2.0.2)
Copyright (c) 2004, 2005, Oracle. All rights reserved.

Restoring configuration files from backup 2009-06-28_17-46-19 ...
Configuration file restore completed successfully !!!
Running opmnctl reload command: "/u01/oracle/product/infra/opmn/bin/opmnctl reload".

IAS1 192.168.1.15:7890 (home /u01/oracle/product/infra)
Starting backup/synchronization of database "ias.ushasuji.com"

ias1 192.168.1.16:7890 (home /u01/oracle/product/infra)
Starting restore/synchronization of database "ias.ushasuji.com"

IAS1:7891
Synchronizing topology completed successfully

IAS1 192.168.1.15:7890
Connecting to the primary database ias.ushasuji.com
Gathering information from the primary database ias.ushasuji.com
Switchover - init.

ias1 192.168.1.16:7890
Switchover - init.

IAS1 192.168.1.15:7890
Switchover - primary preparing.

ias1 192.168.1.16:7890
Switchover - standby preparing.
Stopping Job Queue Scheduler.
Stopping Advanced Queue Time Manager.
Starting managed recovery in the standby database.

IAS1 192.168.1.15:7890
Switchover - primary processing.
Active user sessions detected
The primary database is ready to switchover
Switching over the primary database to the standby role
Shutting down the old primary database
Issuing "shutdown immediate;" to shutdown the database
Starting up the old primary database as the new standby
Issuing "startup nomount;" to start the database
Old primary database now running as the new standby

ias1 192.168.1.16:7890
Switchover - standby processing.
Getting the switchover status from the database.
Switching over the standby database to the primary role.
Shutting down the new primary database.
Issuing "shutdown immediate;" to shutdown the database
Starting up the new primary database.
Issuing "startup open;" to start the database
Switchover - standby finishing.
Enabling the archive destination in the new primary database.
Starting log archiving in the new primary database.

IAS1 192.168.1.15:7890
Switchover - primary finishing.
Deferring the archive destination in the new standby database.
Enabling managed recovery in the new standby database.

ias1 192.168.1.16:7890 (home /u01/oracle/product/infra)
Running opmnctl reload command: "/u01/oracle/product/infra/opmn/bin/opmnctl reload".
Starting component OID
Starting component dcm-daemon
Configuring the backup script
Oracle Application Server Backup/Recovery Tool 10g (10.1.2.0.2)
Copyright (c) 2004, 2005, Oracle. All rights reserved.

Performing configuration ...
Configuration completed successfully !!!
Executing restore_config -F DCM-resyncforce option in bkp_restore.pl script
Oracle Application Server Backup/Recovery Tool 10g (10.1.2.0.2)
Copyright (c) 2004, 2005, Oracle. All rights reserved.

Resynchronizing instance with DCM repository ...
Running opmnctl reload command: "/u01/oracle/product/infra/opmn/bin/opmnctl reload".
Executing opmnctl startall command

ias1:7891 (home /u01/oracle/product/mt)
Starting component dcm-daemon
Configuring the backup script
Executing restore_config -F DCM-resyncforce option in bkp_restore.pl script
Executing opmnctl startall command

ias1:7891
HA directory exists for instance mt.ias1.ushasuji.com

ias1 192.168.1.16:7890 (home /u01/oracle/product/infra)
HA directory exists for instance infra.ias1

IAS1:7891
HA directory exists for instance mt.ias1.ushasuji.com

IAS1 192.168.1.15:7890 (home /u01/oracle/product/infra)
HA directory exists for instance infra.ias1

ias1 192.168.1.16:7890
Verifying that the topology is symmetrical in both primary and standby configuration
Switchover topology to standby host completed successfully


From node2 (new primary node)
---------------------------

try to switchover back to the original primary node

No comments:

Post a Comment