You are on page 1of 11

Production Db name=PROD UNIQUE name= prod host name=appsdemo.

com
standby db name =PROD Unique name = standby Host name=appsdr72.com
production side =
-----------------------------------
SQL> ALTER DATABASE FORCE LOGGING;
sql>show parameter db_unique_name=prod
SQL> alter system set log_archive_config='DG_CONFIG=(PROD,STANDBY)';
SQL> alter system set log_archive_dest_1='LOCATION=/u01/database/PROD/arch MANDA
TORY';
SQL> alter system set log_archive_dest_2='SERVICE=STANDBY LGWR ASYNC VALID_FOR=(
ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STANDBY' scope=spfile;
SQL> show parameter log_archive_min_succeed_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_min_succeed_dest integer 1
SQL> alter system set standby_file_management='AUTO';
SQL> alter system set fal_server=STANDBY;
SQL> alter system set fal_client=PROD;
SQL> alter system set log_archive_dest_state_2=DEFER;
SQL> alter system set db_file_name_convert='/u01/database/STANDBY/db/apps_st/dat
a','/u01/database/PROD/db/apps_st/data' scope=spfile;
SQL> alter system set log_file_name_convert='/u01/database/STANDBY/db/apps_st/da
ta','/u01/database/PROD/db/apps_st/data' scope=spfile;
SQL> alter system set standby_archive_dest='/u01/database/PROD/arch';
sql>show parameter db_recovery_file_dest='/u01/database/PROD/flashback'
sql> show paramerter db_recovery_file_dest_size = 500G
SQL> alter database add standby logfile group 4 ('/u01/database/PROD/db/apps_st/
data/redo04.dbf','/u01/database/PROD/db/apps_st/data/redo05.log') size 1000m;
sql>alter database add standby logfile group 5 ('/u01/database/PROD/db/apps_st/d
ata/redo06.dbf','/u01/database/PROD/db/apps_st/data/redo07.log') size 1000m;
sql>alter database add standby logfile group 6 ('/u01/database/PROD/db/apps_st/d
ata/redo08.dbf','/u01/database/PROD/db/apps_st/data/redo09.log') size 1000m;

$ tnsnames.ora
IFILE=/u01/database/PROD/db/tech_st/11.1.0/network/admin/PROD_appsdemo/PROD_apps
demo_ifile.ora

cat /db/oracle/10R2/network/admin/PROD_bcpdb/PROD_bcpdb_ifile.ora
[oracle@appsdemo PROD_appsdemo]$ cat PROD_appsdemo_ifile.ora
PRODDB = (DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=appsdemo.com)(PORT=1521))
(CONNECT_DATA=(SID=PROD))
)

STANDBY = (DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=appsdr72.com)(PORT=1521))
(CONNECT_DATA=(SID=PROD))
)
[oracle@appsdemo PROD]$ pwd
/u01/database/PROD
[oracle@appsdemo PROD]$ mkdir arch flashback
[oracle@appsdemo dbs]$ orapwd file=orapwPROD password=manager entries=5 ignoreca
se=y
SQL> shut immediate;
sql>startup;
[oracle@appsdemo 11.1.0]$ cd /u01/database/
[oracle@appsdemo ~]$ mkdir backup
RMAN method
--------------------------------
[oracle@appsdemo ~]$ rman target / nocatalog
rman>run
{
BACKUP AS COMPRESSED BACKUPSET database FORMAT '/u01/database/backup/database__%
d_%u_%s_%T';
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL FORMAT '/u01/database/backup/archi
velogs_%d_%u_%s_%T';
BACKUP AS COMPRESSED BACKUPSET CURRENT CONTROLFILE FOR STANDBY FORMAT '/u01/dat
abase/backup/controlfile_standby_%d_%u_%s_%T';
}
USERMANAGED cold backup --
--------------------------------
sql>shut immediate;
sql>shut immediate;
sql>shut immediate;
sql>shut immediate;
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/u01/standby.ctl';
sql>shut immmediate;
(copy rman backup / oracle home to standby side)
(copy datafiles / redolog file / standby controlfile / oracle home to standby si
de)
STANDBY SIDE=
-----------------------------------
[oracle@appsdemo PROD_appsdemo]$ perl adpreclone.pl dbTier
[applmgr@appsdemo scripts]$ perl adpreclone.pl appsTier
[oracle@appsdr72 bin]$ pwd
/u01/database/PROD/db/tech_st/11.1.0/appsutil/clone/bin
[oracle@appsdr72 bin]$ perl adcfgclone.pl dbTechStack
Target System Hostname (virtual or normal) [appsdr72] :
Target Instance is RAC (y/n) [n] :
Target System Database SID : PROD
Target System Base Directory : /u01/database/PROD
Target System utl_file_dir Directory List : /usr/tmp
Number of DATA_TOP's on the Target System [1] :
Target System DATA_TOP Directory 1 [/u01/database/PROD/db/apps_st/data] :
Target System RDBMS ORACLE_HOME Directory [/u01/database/PROD/db/tech_st/11.1.0]
:
Do you want to preserve the Display [null] (y/n) ? : n
Target System Display [appsdr72:0.0] :
Do you want the the target system to have the same port values as the source sys
tem (y/n) [y] ? : y

$ tnsnames.ora
IFILE=/u01/database/PROD/db/tech_st/11.1.0/network/admin/PROD_appsdemo/PROD_apps
demo_ifile.ora

[oracle@appsdemo PROD_appsdemo]$ cat PROD_appsdemo_ifile.ora


PRODDB = (DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=appsdemo.com)(PORT=1521))
(CONNECT_DATA=(SID=PROD))
)

STANDBY = (DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=appsdr72.com)(PORT=1521))
(CONNECT_DATA=(SID=PROD))
)

[oracle@appsdr72 dbs]$ vi initPROD.ora


db_unique_name=STANDBY
log_archive_config='dg_config=(PROD,STANDBY)'
log_archive_dest_1='LOCATION=/u01/database/PROD/db/archivelog'
log_archive_dest_2='service=PRODDB valid_for=(online_logfiles,primary_role) db_u
nique_name=PROD LGWR ASYNC '
fal_server='PRODDB'
fal_client='STANDBY'
standby_file_management=AUTO
standby_archive_dest='LOCATION=/u01/database/PROD/db/dr_archivelog'
db_file_name_convert=('/u01/database/PROD/db/apps_st/data/','/u01/database/PROD/
db/apps_st/data/')
log_file_name_convert=('/u01/database/PROD/db/apps_st/data/','/u01/database/PROD
/db/apps_st/data/')
db_recovery_file_dest='/u01/database/PROD/flashback'
db_recovery_file_dest_size = 50G
Rman method =
--------------------
[oracle@appsdr72 PROD]$ mkdir archivelog dr_archivelog flshback
SQL> startup nomount;
SQL> alter system set log_archive_dest_state_2 = defer;
[oracle@appsdr72 data]$ rman target sys/manager@PRODDB nocatalog auxiliary /
rman>duplicate target database for standby dorecover nofilenamecheck;
sql>shut immediate
sql>startup nomount
sql>ALTER DATABASE MOUNT STANDBY DATABASE;
sql>alter database recover managed standby database disconnect from session;
On production..enable archive dest_2
--------------------------------------
sql>alter system set log_archive_dest_state_2 = enable;
User managed method =
-------------------------
SQL> create spfile from pfile;
SQL> startup nomount
SQL> alter database mount standby database;
SQL> alter database recover managed standby database disconnect from session;

you can check the status of sequences applied on DR with below


----------------------------------------------------------------------
sql>select process, thread#, sequence#, status from v$managed_standby where proc
ess='MRP0';
In this method above..The DR database will bring the reqired archives from produ
ction archive location.

The DR database will gte into sycn overtime..once all the archives are applied-
--------------------------------------------------------------------------------
In case you want to open DR database in read only
=============================================
on production
---------------
sql>alter system set log_Archive_dest_state_2=defer;
On DR side =
------------
sql>recover managed standby database cancel;
sql>alter database open read only;
Once you want to remove DR db from read only mode
===============================================
on DR side
sql>shutdown immediate
sql>startup nomount
sql>ALTER DATABASE MOUNT STANDBY DATABASE;
sql>alter database recover managed standby database disconnect from session;
on production Side=
-----------------
sql>alter system set log_Archive_dest_state_2=enable;

Monitor managed recovery processon standby


sql>select process, thread#, sequence#, status from v$managed_standby where proc
ess='MRP0';
sql>select sequence#,archived, applied from v$archived_log order by sequence#;

[applmgr@appsdr72 bin]$ ./adcfgclone.pl atTechStack


Target System Hostname (virtual or normal) [appsdr72] :
Target System Database SID : PROD
Target System Database Server Node [appsdr72] :
Target System Base Directory : /u01/application/PROD
Target System Tools ORACLE_HOME Directory [/u01/application/PROD/apps/tech_st/10
.1.2] :
Target System Web ORACLE_HOME Directory [/u01/application/PROD/apps/tech_st/10.1
.3] :
Target System APPL_TOP Directory [/u01/application/PROD/apps/apps_st/appl] :
Target System COMMON_TOP Directory [/u01/application/PROD/apps/apps_st/comn] :
Target System Instance Home Directory [/u01/application/PROD/inst] :
Target System Root Service [enabled] :
Target System Web Entry Point Services [enabled] :
Target System Web Application Services [enabled] :
Target System Batch Processing Services [enabled] :
Target System Other Services [disabled] :
Do you want to preserve the Display [appsdemo:0.0] (y/n) ? : n
Target System Display [appsdr72:0.0] :
Do you want the the target system to have the same port values as the source sys
tem (y/n) [y] ? :

[applmgr@appsdr72 bin]$ ./adconfig.sh contextfile=/u01/application/PROD/inst/app


s/PROD_appsdr72/appl/admin/PROD_appsdr72.xml run=INSTE8
Crontab setting =
-----------------------------
On HP ux=
[applmgr@appsdemo log]$ crontab -l
30 * * * * /usr/local/bin/rsync -avzW --rsync-path=/usr/local/bin/rsync --time
out=300000 -e ssh /u01/application/PROD/inst/apps/PROD_appsdemo/logs/appl/conc/
log applmgr@192.168.1.172:/u01/application/PROD/inst/apps/PROD_appsdr72/logs/app
l/conc/log
35 * * * * /usr/local/bin/rsync -avzW --rsync-path=/usr/local/bin/rsync --time
out=300000 -e ssh /u01/application/PROD/inst/apps/PROD_appsdemo/logs/appl/conc/
out

On linux =
----------------
[applmgr@appsdemo ~]$ crontab -l
30 * * * * /bin/sh /u01/application/rsynclog.sh
30 * * * * /bin/sh /u01/application/rsyncout.sh
[applmgr@appsdemo ~]$ cat /u01/application/rsynclog.sh
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
rsync -arvh /u01/application/PROD/inst/apps/PROD_appsdemo/logs/appl/conc/log app
lmgr@192.168.1.172:/u01/application/PROD/inst/apps/PROD_appsdr72/logs/appl/conc/
> /u01/application/resynclog.log

[applmgr@appsdemo ~]$ cat /u01/application/rsyncout.sh


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
rsync -arvh /u01/application/PROD/inst/apps/PROD_appsdemo/logs/appl/conc/out app
lmgr@192.168.1.172:/u01/application/PROD/inst/apps/PROD_appsdr72/logs/appl/conc/
> /u01/application/resyncout.log

#SWITCHOVER STEPS:-
ON?PRIMARY PROD
1.1.1 Preparing for switchover to standby server
1. Verify the primary database instance is open and standby database instance is
mounted.
2. Verify there are no active users connected to the database. Shut down all the
sessions in
the primary database.
3. Ensure that the last redo data transmitted from the primary database was appl
ied on the
standby database. Issue the following SQL command on the primary and standby
databases to find out. If necessary, perform a logfile switch before the first c
ommand
ON Standby
-----------------------
check for the sync
SQL> SELECT MAX(SEQUENCE#) FROM V$ARCHIVED_LOG WHERE APPLIED='YES';
SQL> archive log list
SQL> SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL
.SEQUENCE# "Last Sequence Applied",
(ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# F
ROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME )
IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,
(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY
WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTO
RY GROUP BY THREAD#)) APPL
WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;
Sql>show parameter LOG_ARCHIVE_DEST_STATE_2= defer ;
ON Primary
---------------------------
perform a logfile switch before the first command
SQL>alter system switch logfile;
SQL>select sequence#,applied from v$archived_log;
SQL>select switchover_status from v$database;
SQL>connect / as sysdba;
SQL>alter database commit to switchover to physical standby with session shutdow
n;
SQL> Alter system set LOG_ARCHIVE_DEST_STATE_2= DEFER ;

Shut down and mount the primary database


SQL>shutdown immediate
SQL>startup nomount pfile=$ORACLE_HOME/dbs/init<SID>.ora | spfile
SQL>alter database mount standby database;
ON STANDBY DR-
SQL>select switchover_status from v$database;
SQL>alter database commit to switchover to primary with session shutdown;

LOG_ARCHIVE_DEST_STATE_2 to enable
SQL> Alter system set LOG_ARCHIVE_DEST_STATE_2= ENABLE ;
To complete the transition, the database must be shut down and re-started:
SQL>shutdown immediate
SQL>startup pfile=$ORACLE_HOME/dbs/init<SID>.ora | spfile

Complete the database configurations


1. Connect to the new primary database using SQL*Plus as user APPS, and exe
cute the following commands:
SQL>exec fnd_net_services.remove_system ('PROD');
SQL>commit;
SQL>exec fnd_conc_clone.setup_clean ;
2. As the oraprod user on the new primary database server, use AutoConfig t
o complete configuration for primary operations, providing the APPS password whe
n prompted:
$ cd <RDBMS ORACLE_HOME>/appsutil/scripts/<context>
$ ./adautocfg.sh
3. When this completes, stop and start the listener on the new primary data
base server:
$ lsnrctl stop
$ lsnrctl start <SID>
4. On the new standby server, stop and start the listener for standby servi
ces:
$ lsnrctl
$ lsnrctl start <Standby Service>

Application Tier Configuration After a Role Transition (switchover/failover/swi


tchback)
ON STANDBY DR-
Finish Oracle E-Business Suite configuration on application tiers
After the primary database configuration is complete and its listeners have star
ted, log in to each now-primary application tier server as the APPLPROD user, an
d run the final configuration steps:
$ cd $INST_TOP/admin/scripts>
$ ./adautocfg.sh
Provide the APPS password when prompted.
Update host name in fnd_concurrent_requests and fnd_conc_req_outputs tables
If you synchronize your concurrent manager log and out directories, you must cha
nge the host name in the fnd_concurrent_requests table to the name of the new pr
imary server (that was the standby before the role transition):
SQL>update apps.fnd_concurrent_requests
set logfile_node_name = <new application tier node>,
outfile_node_name = <new application tier node>
where logfile_node_name = <old application tier node>
and outfile_node_name = <old application tier node>;
SQL> update apps.fnd_concurrent_requests set logfile_node_name='APPSDR72 ',outfi
le_node_name = 'APPSDR72' WHERE logfile_node_name = 'APPSDEMO' and outfile_node_
name = 'APPSDEMO';
SQL>update apps.fnd_conc_req_outputs set file_node_name=<new applications tier n
ode>
where file_node_name=<old applications tier node>;

If you do not synchronize your concurrent manager log and out directories, blank
out the host name in the fnd_concurrent_requests table to avoid network timeout
errors:
SQL>update apps.fnd_concurrent_requests
set logfile_node_name = null,
outfile_node_name = null;
SQL>update apps.fnd_conc_req_outputs set file_node_name=' ';
SQL> update apps.fnd_conc_req_outputs set file_node_name='APPSDR72' where file_
node_name = 'APPSDEMO';
SQL> update apps.fnd_concurrent_queues set node_name = 'APPSDR72' where node_nam
e = 'APPSDEMO';

Perform the cloning finishing tasks


Perform the Finishing Tasks outlined in My Oracle Support Knowledge Document 406
982.1, Cloning Oracle Applications Release R12 with Rapid Clone.
Instance specific profile options at other than site level (Rapid Clone updates
the site level instance specific profile options)
Printer settings as necessary
Workflow configuration settings
APPLCSF variable if necessary
Direct users to the new system
The standby system should be available to your users as your new primary system.
Direct your users to the new URL.
Business Continuity for Oracle E-Business Release 12 Using Oracle 11g

#SWITCHOVER STEPS:-
ON?PRIMARY PROD
1.1.1 Preparing for switchover to standby server
1. Verify the primary database instance is open and standby database instance is
mounted.
2. Verify there are no active users connected to the database. Shut down all the
sessions in
the primary database.
3. Ensure that the last redo data transmitted from the primary database was appl
ied on the
standby database. Issue the following SQL command on the primary and standby
databases to find out. If necessary, perform a logfile switch before the first c
ommand

If you run the latter update, you must execute it before starting the concurrent
managers on the
system. If you do not execute it before starting the managers, you must add a wh
ere clause to
limit the rows updated to those pointing to the old host names. This does not ne
ed to complete
before you run the next step. However, if you let users on to the system before
it is committed,
they will get errors if they try to access a report's log or out file that was g
enerated on the old
primary system.
6.2.3 Perform the cloning finishing tasks
Perform the Finishing Tasks outlined in My Oracle Support Knowledge Document 406
982.1,
Cloning Oracle Applications Release R12 with Rapid Clone.
Instance specific profile options at other than site level (Rapid Clone updates
the site level
instance specific profile options)
Printer settings as necessary
Workflow configuration settings
APPLCSF variable if necessary
6.2.4 Direct users to the new system
The standby system should be available to your users as your new primary system.
Direct your
users to the new URL.
6.2.5 Establish a new standby system
Perform this step if you have performed a failover. Failing over to the standby
database (versus
switching over) separates it from the old primary. You must create a new standby
environment
from this new system to again provide disaster recovery protection.
6.2.6 Re-point your CM log and out and native PL/SQL object directory rsync scri
pts
(optional)
If you are keeping your concurrent manager log and out directories synchronized
across the
environments, set up your rsync scripts to move the files from the new primary s
erver to the new
standby server.