Convert
the standby database into a snapshot standby database:
SQL>
alter database convert to snapshot standby;
Database
altered.
SQL>
SQL>
shut immediate;
ORA-01109:
database not open
Database
dismounted.
ORACLE
instance shut down.
SQL>
startup;
ORA-32004:
obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE
instance started.
Total
System Global Area 2147483648 bytes
Fixed
Size 2926472 bytes
Variable
Size 452987000 bytes
Database
Buffers 1677721600 bytes
Redo
Buffers 13848576 bytes
Database
mounted.
Database
opened.
remove
the application config info
SQL*Plus:
Release 12.1.0.2.0 Production on Mon Sep 3 21:55:00 2018
Copyright
(c) 1982, 2014, Oracle. All rights
reserved.
Last
Successful login time: Mon Sep 03 2018 10:25:27 -04:00
Connected
to:
Oracle
Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the
Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>
exec fnd_conc_clone.setup_clean;
PL/SQL
procedure successfully completed.
SQL>
exec ad_zd_fixer.clear_valid_nodes_info;
PL/SQL
procedure successfully completed.
SQL> commit;
Commit
complete.
SQL>
now
create the context file. before that Copy the jre from primary database server
$ORACLE_HOME/appsutil/jre
[oracle@dr
bin]$ perl adbldxml.pl appsuser=apps appspass=welcome123
template=$ORACLE_HOME/appsutil/template/adxdbctx.tmp
out=$ORACLE_HOME/appsutil/PROD_dr.xml
Starting
context file generation for db tier..
Using
JVM from /u01/database/oracledb/product/12c/db_1/appsutil/jre/bin/java to
execute java programs..
The log
file for this adbldxml session is located at:
/u01/database/oracledb/product/12c/db_1/appsutil/log/adbldxml_09032214.log
AC-20010:
Error: File - listener.ora could not be found at the location:
/u01/app/oracledb/product/12c/db_1/network/admin/listener.ora
indicated
by TNS_ADMIN. Context file can not be generated.
Could
not Connect to the Database with the above parameters, Please answer the
Questions below
Enter
Hostname of Database server: dr
Enter
Port of Database server: 1521
Enter
SID of Database server: PROD
Enter
Database Service Name: PROD
Enter
the value for Display Variable: dr:1.0
The
context file has been created at:
/u01/database/oracledb/product/12c/db_1/appsutil/PROD_dr.xml
run autoconfig now:
[oracle@dr
PROD_dr]$ sh adautocfg.sh
Enter
the APPS user password:
The log
file for this session is located at: /u01/database/oracledb/product/12c/db_1/appsutil/log/PROD_dr/09032312/adconfig.log
AutoConfig
is configuring the Database environment...
AutoConfig
will consider the custom templates if present.
Using ORACLE_HOME location :
/u01/database/oracledb/product/12c/db_1
Classpath :
:/u01/database/oracledb/product/12c/db_1/jdbc/lib/ojdbc6.jar:/u01/database/oracledb/product/12c/db_1/appsutil/java/xmlparserv2.jar:/u01/database/oracledb/product/12c/db_1/appsutil/java:/u01/database/oracledb/product/12c/db_1/jlib/netcfg.jar:/u01/database/oracledb/product/12c/db_1/jlib/ldapjclnt12.jar
Using Context file :
/u01/database/oracledb/product/12c/db_1/appsutil/PROD_dr.xml
Context
Value Management will now update the Context file
Updating Context file...COMPLETED
Attempting upload of Context file and
templates to database...COMPLETED
Updating
rdbms version in Context file to db121
Updating
rdbms type in Context file to 64 bits
Configuring
templates from ORACLE_HOME ...
AutoConfig
completed successfully.
Now
configure the application tier
[applmgr@dr
bin]$ perl adcfgclone.pl appsTier dualfs
Copyright (c) 2002, 2015
Oracle Corporation
Redwood Shores,
California, USA
Oracle E-Business Suite
Rapid Clone
Version 12.2
adcfgclone Version
120.63.12020000.60
Enter
the APPS password :
Enter
the Weblogic AdminServer password :
Do you
want to add a node (yes/no) [no] : no
Running:
Context clone...
Log file
located at /u01/application/fs1/EBSapps/comn/clone/bin/CloneContext_0904023938.log
Provide
the values required for creation of the new APPL_TOP Context file.
Target
System Hostname (virtual or normal) [dr] :
Target
System Database SID : PROD
Target
System Database Server Node [dr] :
Target
System Database Domain Name [localdomain] :
Target
System Base Directory : /u01/application
Target
System Base Directory set to /u01/application
Target
System Current File System Base set to /u01/application/fs1
Target
System Other File System Base set to /u01/application/fs2
Target
System Fusion Middleware Home set to /u01/application/fs1/FMW_Home
Target
System Other File System Fusion Middleware Home set to
/u01/application/fs2/FMW_Home
Target
System Web Oracle Home set to /u01/application/fs1/FMW_Home/webtier
Target
System Other File System Web Oracle Home set to
/u01/application/fs2/FMW_Home/webtier
Target
System Appl TOP set to /u01/application/fs1/EBSapps/appl
Target
System Other File System Appl TOP set to /u01/application/fs2/EBSapps/appl
Target
System COMMON TOP set to /u01/application/fs1/EBSapps/comn
Target
System Other File System COMMON TOP set to /u01/application/fs2/EBSapps/comn
Target
System Instance Home Directory [/u01/application] :
Target
System Current File System Instance Top set to
/u01/application/fs1/inst/apps/PROD_dr
Do you
want to preserve the Display [rac2:0.0] (y/n)
: n
Target
System Display [dr:0.0] :
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 the target system to have the same port values as the source system (y/n)
[y] ? : n
Target System
Port Pool [0-99] : 1
Checking
the port pool 1
done:
Port Pool 1 is free
Report
file located at /u01/application/fs1/inst/apps/PROD_dr/admin/out/portpool.lst
RC-40201:
Unable to connect to Database PROD.
Enter
the Database listener port [1522] : 1521
UTL_FILE_DIR
on database tier consists of the following directories.
1.
/usr/tmp
2.
/usr/tmp
3.
/u01/database/PROD/12.1.0/appsutil/outbound/PROD_rac2
4.
/usr/tmp
Choose a
value which will be set as APPLPTMP value on the target node [1] : 1
The new
APPL_TOP context file has been created :
/u01/application/fs1/inst/apps/PROD_dr/appl/admin/PROD_dr.xml
Check
Clone Context logfile
/u01/application/fs1/EBSapps/comn/clone/bin/CloneContext_0904023938.log for
details.
Creating
Patch file system context file.....
Log file
located at
/u01/application/fs1/EBSapps/comn/clone/bin/CloneContextPatch_0904024546.log
Target
System Other File System Instance Top set to
/u01/application/fs2/inst/apps/PROD_dr
Target
System Port Pool [0-99] : 2
Checking
the port pool 2
done:
Port Pool 2 is free
Report
file located at /u01/application/fs2/inst/apps/PROD_dr/admin/out/portpool.lst
The new
APPL_TOP context file has been created :
/u01/application/fs2/inst/apps/PROD_dr/appl/admin/PROD_dr.xml
Check
Clone Context logfile /u01/application/fs1/EBSapps/comn/clone/bin/CloneContextPatch_0904024546.log
for details.
FMW
Pre-requisite check log file location :
/u01/application/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running:
FMW pre-req check...
Configuring:
Run file system....
LogFile
located at
/u01/application/fs1/inst/apps/PROD_dr/admin/log/clone/run/RCloneApplyAppstier_09040246.log
Configuring:
Patch file system....
LogFile
located at
/u01/application/fs1/inst/apps/PROD_dr/admin/log/clone/patch/RCloneApplyAppstier_09040359.log
Do you
want to startup the Application Services for PROD? (y/n) [n] : n
Services
not started
this
completes configuring apps tier configuration in dr server.
Revert the Physical Standby
Database to its Original State
Change
the standby database from snapshot mode back into standby mode using the
following commands:
Copyright
(c) 1982, 2014, Oracle. All rights
reserved.
Connected
to:
Oracle
Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the
Partitioning, OLAP, Advanced Analytics and Real Application Testing opt
ions
SQL>
startup mount force;
ORA-32004:
obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE
instance started.
Total
System Global Area 2147483648 bytes
Fixed
Size 2926472 bytes
Variable
Size 486541432 bytes
Database
Buffers 1644167168 bytes
Redo
Buffers 13848576 bytes
Database
mounted.
SQL>
alter database convert to physical standby;
Database
altered.
SQL>
shutdown immediate;
ORA-01109:
database not open
Database
dismounted.
ORACLE
instance shut down.
SQL>
startup nomount;
ORA-32004:
obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE
instance started.
Total
System Global Area 2147483648 bytes
Fixed
Size 2926472 bytes
Variable
Size 486541432 bytes
Database
Buffers 1644167168 bytes
Redo
Buffers 13848576 bytes
SQL>
alter database mount standby database;
Database
altered.
SQL>
enable
redo log apply
SQL>
alter database recover managed standby database using current logfile
disconnect;
Database
altered.
Performing
role transitions
I have illustrated the switchover and switchback steps. If you are familiar with these steps, then failover can also be done easily which is not in the scope of this post.
Prepare for a switchover to the standby server
- Verify the primary database instance is open and the standby database instance is mounted.
- Shut down all the application tier services on all nodes on the primary site.
$ adstpall.sh <appsuser>/<appspass>
- Verify there are no active users connected to the database. Shut down all the sessions on the primary database.
- Use the following command on both the primary and standby databases to ensure that the last redo data transmitted from the primary database has been applied on the standby database. If necessary, perform a log file switch before proceeding further:.
SQL>select sequence#,applied from v$archived_log;
Check
whether the primary is ready for a switch. Query the switchover_status
column
of the v$database
fixed
view to determine whether the database is ready to switch modes
SQL>
select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO
STANDBY
Initiate a switchover on
the primary database
Connect
as sysdba
and
issue the following SQL command:
SQL>
alter database commit to switchover to physical standby with session shutdown;
Database
altered.
When
this statement has completed, the primary database will have been converted to
a standby database. During the statement's execution, the current control file
is backed up to the current SQL session's trace file - this makes it possible
to reconstruct the control file should the need arise.
Shut down and mount the primary
database
To complete the transition, the database must be shut down and
restarted in a mounted state. Change the value of LOG_ARCHIVE_DEST_STATE_2
to defer
, in addition, recovery can be started in
preparation for transition.
SQL>
shutdown immediate;
ORA-01012:
not logged on
SQL>
exit;
Disconnected
from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit
Production
With the
Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@rac2
dbs]$ sqlplus / as sysdba
SQL*Plus:
Release 12.1.0.2.0 Production on Tue Sep 4 04:08:40 2018
Copyright
(c) 1982, 2014, Oracle. All rights
reserved.
Connected
to an idle instance.
SQL>
SQL>
startup nomount;
ORACLE
instance started.
Total System
Global Area 2147483648 bytes
Fixed
Size 2926472 bytes
Variable
Size 452987000 bytes
Database
Buffers 1677721600 bytes
Redo
Buffers 13848576 bytes
SQL>
alter database mount standby database;
Database
altered.
SQL>
alter system set LOG_ARCHIVE_DEST_STATE_2=defer scope=both sid='*';
System
altered.
SQL>
alter database recover managed standby database disconnect from session;
Database
altered.
SQL>
exit;
Disconnected
from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit
Production
With the
Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@rac2
dbs]$ ps -ef|grep mrp
oracle 11858
1 1 04:10 ? 00:00:00 ora_mrp0_PROD
oracle 11865
8370 0 04:10 pts/2 00:00:00 grep mrp
[oracle@rac2
dbs]$
At this
point in the switchover, both databases
are standby databases.
Verify the switchover status on
the standby server
As the ORACLE
user on the standby-to-become-the-primary database server, verify
that it is ready to switch to the primary:
SQL>
select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO
PRIMARY
SQL>
alter database commit to switchover to primary with session shutdown;
Database
altered.
Adjust the network parameters:
In the context ifile.ora change the host name in the primary as well as in the standby database.
cat
PROD_rac2_ifile.ora
PRODDR=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.localdomain)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=PROD)
(SERVER=DEDICATED)
)
)
PROD=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=dr.localdomain)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=PROD)
(INSTANCE_NAME=PROD)
)
)
in the
new primary server
PRODDR=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.localdomain)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=PROD)
(SERVER=DEDICATED)
)
)
PROD=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=dr.localdomain)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=PROD)
(INSTANCE_NAME=PROD)
)
On the current primary, change the LOG_ARCHIVE_DEST_STATE_2
to enable
using the following command:
SQL>
alter system set LOG_ARCHIVE_DEST_STATE_2=enable scope=both sid='*';
System
altered.
To
complete the transition, the database must be shut down and re-started:
SQL>
shut immediate;
ORA-01109:
database not open
Database
dismounted.
ORACLE
instance shut down.
SQL>
startup;
ORA-32004:
obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE
instance started.
Total
System Global Area 2147483648 bytes
Fixed
Size 2926472 bytes
Variable
Size 486541432 bytes
Database
Buffers 1644167168 bytes
Redo
Buffers 13848576 bytes
Database
mounted.
Database
opened.
Complete the database
configuration
- Connect
to the new primary database using SQL*Plus as the APPS user, and execute
the following commands:
SQL>
exec fnd_net_services.remove_system ('PROD');
PL/SQL
procedure successfully completed.
SQL>
commit;
Commit
complete.
SQL>
exec fnd_conc_clone.setup_clean;
PL/SQL
procedure successfully completed.
SQL>
exec ad_zd_fixer.clear_valid_nodes_info;
PL/SQL
procedure successfully completed.
SQL>
As
the ORACLE
user
on the new primary database server, use AutoConfig to complete the
configuration for the primary operations, providing the APPS password when
prompted
[oracle@dr
PROD_dr]$ sh adautocfg.sh
Enter
the APPS user password:
The log
file for this session is located at:
/u01/database/oracledb/product/12c/db_1/appsutil/log/PROD_dr/09041329/adconfig.log
AutoConfig
is configuring the Database environment...
AutoConfig
will consider the custom templates if present.
Using ORACLE_HOME location :
/u01/database/oracledb/product/12c/db_1
Classpath :
:/u01/database/oracledb/product/12c/db_1/jdbc/lib/ojdbc6.jar:/u01/database/oracledb/product/12c/db_1/appsutil/java/xmlparserv2.jar:/u01/database/oracledb/product/12c/db_1/appsutil/java:/u01/database/oracledb/product/12c/db_1/jlib/netcfg.jar:/u01/database/oracledb/product/12c/db_1/jlib/ldapjclnt12.jar
Using Context file :
/u01/database/oracledb/product/12c/db_1/appsutil/PROD_dr.xml
Context
Value Management will now update the Context file
Updating Context file...COMPLETED
Attempting upload of Context file and
templates to database...COMPLETED
Updating
rdbms version in Context file to db121
Updating
rdbms type in Context file to 64 bits
Configuring
templates from ORACLE_HOME ...
AutoConfig
completed successfully.
stop and
start the listener on the new primary database server:
[oracle@dr
database]$ lsnrctl stop PROD
LSNRCTL
for Linux: Version 12.1.0.2.0 - Production on 04-SEP-2018 14:11:21
Copyright
(c) 1991, 2014, Oracle. All rights
reserved.
Connecting
to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dr.localdomain)(PORT=1521)))
The
command completed successfully
[oracle@dr
database]$ lsnrctl start PROD
LSNRCTL
for Linux: Version 12.1.0.2.0 - Production on 04-SEP-2018 14:11:27
Copyright
(c) 1991, 2014, Oracle. All rights
reserved.
Starting
/u01/database/oracledb/product/12c/db_1/bin/tnslsnr: please wait...
TNSLSNR
for Linux: Version 12.1.0.2.0 - Production
System
parameter file is /u01/database/oracledb/product/12c/db_1/network/admin/listener.ora
Log
messages written to
/u01/database/oracledb/product/12c/db_1/admin/PROD_dr/diag/tnslsnr/dr/prod/alert/log.xml
Listening
on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dr.localdomain)(PORT=1521)))
Connecting
to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dr.localdomain)(PORT=1521)))
STATUS
of the LISTENER
------------------------
Alias PROD
Version TNSLSNR for Linux: Version
12.1.0.2.0 - Production
Start
Date 04-SEP-2018 14:11:27
Uptime 0 days 0 hr. 0 min. 0 sec
Trace
Level off
Security ON: Local OS Authentication
SNMP OFF
Listener
Parameter File /u01/database/oracledb/product/12c/db_1/network/admin/listener.ora
Listener
Log File
/u01/database/oracledb/product/12c/db_1/admin/PROD_dr/diag/tnslsnr/dr/prod/alert/log.xml
Listening
Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dr.localdomain)(PORT=1521)))
Services
Summary...
Service
"PROD" has 1 instance(s).
Instance "PROD", status UNKNOWN,
has 1 handler(s) for this service...
The
command completed successfully
[oracle@dr
database]$
On the
new standby server, stop and start the listener for the standby services
[oracle@rac2
database]$ lsnrctl stop PROD
LSNRCTL
for Linux: Version 12.1.0.2.0 - Production on 04-SEP-2018 06:36:55
Copyright
(c) 1991, 2014, Oracle. All rights
reserved.
Connecting
to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1521)))
The
command completed successfully
[oracle@rac2
database]$ lsnrctl start PROD
LSNRCTL
for Linux: Version 12.1.0.2.0 - Production on 04-SEP-2018 06:37:01
Copyright
(c) 1991, 2014, Oracle. All rights
reserved.
Starting
/u01/database/PROD/12.1.0/bin/tnslsnr: please wait...
TNSLSNR
for Linux: Version 12.1.0.2.0 - Production
System
parameter file is
/u01/database/PROD/12.1.0/network/admin/PROD_rac2/listener.ora
Log
messages written to
/u01/database/PROD/12.1.0/admin/PROD_rac2/diag/tnslsnr/rac2/prod/alert/log.xml
Listening
on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.localdomain)(PORT=1521)))
Connecting
to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1521)))
STATUS
of the LISTENER
------------------------
Alias PROD
Version TNSLSNR for Linux: Version
12.1.0.2.0 - Production
Start
Date 04-SEP-2018 06:37:01
Uptime 0 days 0 hr. 0 min. 0 sec
Trace
Level off
Security ON: Local OS Authentication
SNMP OFF
Listener
Parameter File
/u01/database/PROD/12.1.0/network/admin/PROD_rac2/listener.ora
Listener
Log File
/u01/database/PROD/12.1.0/admin/PROD_rac2/diag/tnslsnr/rac2/prod/alert/log.xml
Listening
Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.localdomain)(PORT=1521)))
Services
Summary...
Service
"PROD" has 1 instance(s).
Instance "PROD", status UNKNOWN,
has 1 handler(s) for this service...
The
command completed successfully
Configure the Application Tier After Role Transition (Switchover)
Once the primary database configuration has completed and its
listeners have started, log in to each new-primary application tier server as
the APPLMGR
user, and run the
final configuration steps on the run file systems providing the APPS password
when prompted::
[applmgr@dr
scripts]$ sh adautocfg.sh
Enter
the APPS user password:
The log
file for this session is located at:
/u01/application/fs1/inst/apps/PROD_dr/admin/log/09041433/adconfig.log
AutoConfig
is configuring the Applications environment...
AutoConfig
will consider the custom templates if present.
Using CONFIG_HOME location : /u01/application/fs1/inst/apps/PROD_dr
Classpath :
/u01/application/fs1/FMW_Home/Oracle_EBS-app1/shared-libs/ebs-appsborg/WEB-INF/lib/ebsAppsborgManifest.jar:/u01/application/fs1/EBSapps/comn/java/classes
Using Context file :
/u01/application/fs1/inst/apps/PROD_dr/appl/admin/PROD_dr.xml
Context
Value Management will now update the Context file
Updating Context file...COMPLETED
Attempting upload of Context file and
templates to database...COMPLETED
Configuring
templates from all of the product tops...
Configuring AD_TOP........COMPLETED
Configuring FND_TOP.......COMPLETED
Configuring ICX_TOP.......COMPLETED
Configuring MSC_TOP.......COMPLETED
Configuring IEO_TOP.......COMPLETED
Configuring BIS_TOP.......COMPLETED
Configuring CZ_TOP........COMPLETED
Configuring SHT_TOP.......COMPLETED
Configuring AMS_TOP.......COMPLETED
Configuring CCT_TOP.......COMPLETED
Configuring WSH_TOP.......COMPLETED
Configuring CLN_TOP.......COMPLETED
Configuring OKE_TOP.......COMPLETED
Configuring OKL_TOP.......COMPLETED
Configuring OKS_TOP.......COMPLETED
Configuring CSF_TOP.......COMPLETED
Configuring IBY_TOP.......COMPLETED
Configuring JTF_TOP.......COMPLETED
Configuring MWA_TOP.......COMPLETED
Configuring CN_TOP........COMPLETED
Configuring CSI_TOP.......COMPLETED
Configuring WIP_TOP.......COMPLETED
Configuring CSE_TOP.......COMPLETED
Configuring EAM_TOP.......COMPLETED
Configuring GMF_TOP.......COMPLETED
Configuring PON_TOP.......COMPLETED
Configuring FTE_TOP.......COMPLETED
Configuring ONT_TOP.......COMPLETED
Configuring AR_TOP........COMPLETED
Configuring AHL_TOP.......COMPLETED
Configuring IES_TOP.......COMPLETED
Configuring OZF_TOP.......COMPLETED
Configuring CSD_TOP.......COMPLETED
Configuring IGC_TOP.......COMPLETED
AutoConfig
completed successfully.
[applmgr@dr
scripts]$
On the
patch file system change to $AD_TOP/bin/
and run the following
command:
[applmgr@dr
bin]$ perl adconfig.pl
contextfile=/u01/application/fs2/inst/apps/PROD_dr/appl/admin/PROD_dr.xml
-syncctx
Enter
the APPS user password:
The log
file for this session is located at:
/u01/application/fs2/inst/apps/PROD_dr/admin/log/09041447/adconfig.log
Option
specified : Synchronize context file
Only
context file synchronization will be performed
Classpath :
/u01/application/fs2/FMW_Home/Oracle_EBS-app1/shared-libs/ebs-appsborg/WEB-INF/lib/ebsAppsborgManifest.jar:/u01/application/fs2/EBSapps/comn/java/classes
Using ContextFile :
/u01/application/fs2/inst/apps/PROD_dr/appl/admin/PROD_dr.xml
Synchronizing the context file
......COMPLETED
AutoConfig
completed successfully.
[applmgr@dr
bin]$
Update the Host Name in the
FND_CONCURRENT_REQUESTS and FND_CONC_REQ_OUTPUTS tables
In order to synchronize your concurrent manager log and out
directories, you must change the host name in the fnd_concurrent_requests
table to the standby
server name:
SQL>
update apps.fnd_concurrent_requests
set
logfile_node_name ='DR',
outfile_node_name
= 'DR'
where
logfile_node_name ='RAC2'
and
outfile_node_name ='RAC2'; 2 3
4 5
638 rows
updated.
SQL>
commit;
Commit
complete
:rsync the concurrent log and out files from old primary application server to new ones:
rsync -avz log applmgr@192.168.x.x:/u01/application/fs_ne/inst/PROD_dr/logs/appl/conc
rsync -avz out applmgr@192.168.x.x:/u01/application/fs_ne/inst/PROD_dr/logs/appl/conc
Now
start the application services in the new primary servers run file system and
redirect the user to the new url
http://dr.localdomain:8001/OA_HTML/AppsLocalLogin.jsp
Now we will do the switchback which will make
primary to standby and standby to primary
a.Verify that the primary database at the standby site is open, and the standby database at the primary site is mounted.
b. Verify all the redo logs are transferred to standby and are applied.
c. On the primary site, check whether the switchover_status from v$database is showing: TO STANDBY
in primary
SQL> select
switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO STANDBY
On the
primary database, issue the command:
SQL>
alter database commit to switchover to physical standby;
Database
altered.
So this
has shut down my database.
[oracle@dr
dbs]$ sqlplus / as sysdba
SQL*Plus:
Release 12.1.0.2.0 Production on Wed Sep 5 04:38:42 2018
Copyright
(c) 1982, 2014, Oracle. All rights
reserved.
Connected
to an idle instance.
SQL>
startup nomount;
ORA-32004:
obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE
instance started.
Total
System Global Area 2147483648 bytes
Fixed
Size 2926472 bytes
Variable
Size 503318648 bytes
Database
Buffers 1627389952 bytes
Redo
Buffers 13848576 bytes
SQL>
alter database mount standby database;
Database
altered.
SQL>
alter system set LOG_ARCHIVE_DEST_STATE_2=defer scope=both sid='*';
System
altered.
SQL>
in the standby
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
in the standby init file
changed the below parameters
*.log_archive_config='dg_config=(PROD,PRODDR)'
*.log_archive_dest_1='LOCATION=/u01/database/PROD/data'
*.log_archive_dest_2='service=PRODDR ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=PRODDR'
*.log_archive_dest_state_2='enable
now in the standby
SQL> alter database commit to switchover to primary with session shutdown;
Database altered.
SQL> exit;
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@rac2 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 4 21:17:08 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
MOUNTED PRIMARY
As the ORACLE
user on both the primary and standby database
servers, change the host name in the standby service definitions to point to
the new standby server in both the <CONTEXT_NAME>_ifile.ora
and
<STNDBY_CONTEXT>_ifile.ora
(which
are located in the <TNS_ADMIN>
directory(already done in the above sections, you can refer it to interchange the host names again)
now in the primary
[oracle@rac2 dbs]$ pwd
/u01/database/PROD/12.1.0/dbs
[oracle@rac2 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 4 21:21:55 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount pfile='/u01/database/PROD/12.1.0/dbs/initPROD.ora';
ORA-32006: SEC_CASE_SENSITIVE_LOGON initialization parameter has been deprecated
ORACLE instance started.
Total System Global Area 2147483648 bytes
Fixed Size 2926472 bytes
Variable Size 452987000 bytes
Database Buffers 1677721600 bytes
Redo Buffers 13848576 bytes
Database mounted.
SQL> create spfile from pfile;
File created.
SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 2147483648 bytes
Fixed Size 2926472 bytes
Variable Size 452987000 bytes
Database Buffers 1677721600 bytes
Redo Buffers 13848576 bytes
Database mounted.
Database opened.
SQL> select database_role,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PRIMARY READ WRITE
in the stanbdy started the mrp process
[oracle@dr admin]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 5 04:57:37 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> alter database recover managed standby database disconnect from session;
Database altered.
Now verify if the archives are getting shipped or not
in the primary
SQL> alter system switch logfile;
System altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/database/PROD/data
Oldest online log sequence 128
Next log sequence to archive 129
Current log sequence 129
SQL>
in the stanbdy
SQL> SELECT 'Last Applied : ' Logs,
TO_CHAR(next_time,'DD-MON-YY:HH24:MI:SS') TIME,thread#,sequence#
FROM v$archived_log
WHERE sequence# =
(SELECT MAX(sequence#) FROM v$archived_log WHERE applied='YES'
)
UNION
SELECT 'Last Received : ' Logs,
TO_CHAR(next_time,'DD-MON-YY:HH24:MI:SS') TIME,thread#,sequence#
FROM v$archived_log
WHERE sequence# =(SELECT MAX(sequence#) FROM v$archived_log ); 2 3 4 5 6 7 8 9 10 11
LOGS TIME THREAD# SEQUENCE#
---------------- ------------------ ---------- ----------
Last Applied : 04-SEP-18:21:29:46 1 128
Last Received : 04-SEP-18:21:29:46 1 128
Connect to the new primary database using SQL*Plus as the APPS user, and execute the following commands:
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Tue Sep 04 2018 16:03:42 -04:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> exec fnd_net_services.remove_system ('PROD');
PL/SQL procedure successfully completed.
SQL> commit;
Commit complete.
SQL> exec fnd_conc_clone.setup_clean;
PL/SQL procedure successfully completed.
SQL> exec ad_zd_fixer.clear_valid_nodes_info;
PL/SQL procedure successfully completed.
SQL> commit;
Commit complete.
SQL>
run autoconfig
[oracle@rac2 PROD_rac2]$ sh adautocfg.sh
Enter the APPS user password:
The log file for this session is located at: /u01/database/PROD/12.1.0/appsutil/log/PROD_rac2/09042141/adconfig.log
AutoConfig is configuring the Database environment...
AutoConfig will consider the custom templates if present.
Using ORACLE_HOME location : /u01/database/PROD/12.1.0
Classpath : :/u01/database/PROD/12.1.0/jdbc/lib/ojdbc6.jar:/u01/database/PROD/12.1.0/appsutil/java/xmlparserv2.jar:/u01/database/PROD/12.1.0/appsutil/java:/u01/database/PROD/12.1.0/jlib/netcfg.jar:/u01/database/PROD/12.1.0/jlib/ldapjclnt12.jar
Using Context file : /u01/database/PROD/12.1.0/appsutil/PROD_rac2.xml
Context Value Management will now update the Context file
Updating Context file...COMPLETED
Attempting upload of Context file and templates to database...COMPLETED
Updating rdbms version in Context file to db121
Updating rdbms type in Context file to 64 bits
Configuring templates from ORACLE_HOME ...
AutoConfig completed successfully.
[oracle@rac2 PROD_rac2]$
in the primary server and standby server
start stop listener
[oracle@rac2 PROD_rac2]$ lsnrctl stop PROD
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 04-SEP-2018 21:42:42
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1521)))
The command completed successfully
[oracle@rac2 PROD_rac2]$ lsnrctl start PROD
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 04-SEP-2018 21:42:46
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Starting /u01/database/PROD/12.1.0/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /u01/database/PROD/12.1.0/network/admin/PROD_rac2/listener.ora
Log messages written to /u01/database/PROD/12.1.0/admin/PROD_rac2/diag/tnslsnr/rac2/prod/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.localdomain)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias PROD
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 04-SEP-2018 21:42:46
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/database/PROD/12.1.0/network/admin/PROD_rac2/listener.ora
Listener Log File /u01/database/PROD/12.1.0/admin/PROD_rac2/diag/tnslsnr/rac2/prod/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.localdomain)(PORT=1521)))
Services Summary...
Service "PROD" has 1 instance(s).
Instance "PROD", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@rac2 PROD_rac2]$
in standby
[oracle@dr admin]$ lsnrctl stop PROD
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 05-SEP-2018 05:15:33
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dr.localdomain)(PORT=1521)))
The command completed successfully
[oracle@dr admin]$ lsnrctl start PROD
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 05-SEP-2018 05:15:38
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Starting /u01/database/oracledb/product/12c/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /u01/database/oracledb/product/12c/db_1/network/admin/listener.ora
Log messages written to /u01/database/oracledb/product/12c/db_1/admin/PROD_dr/diag/tnslsnr/dr/prod/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dr.localdomain)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dr.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias PROD
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 05-SEP-2018 05:15:38
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/database/oracledb/product/12c/db_1/network/admin/listener.ora
Listener Log File /u01/database/oracledb/product/12c/db_1/admin/PROD_dr/diag/tnslsnr/dr/prod/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dr.localdomain)(PORT=1521)))
Services Summary...
Service "PROD" has 1 instance(s).
Instance "PROD", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@dr admin]$
Configure the Application Tier After Role Transition switchback
in the
run file system, run autoconfig
[applmgr@rac2
scripts]$ sh adautocfg.sh
Enter
the APPS user password:
The log
file for this session is located at:
/u01/application/PROD/fs1/inst/apps/PROD_rac2/admin/log/09042147/adconfig.log
AutoConfig
is configuring the Applications environment...
AutoConfig
will consider the custom templates if present.
Using CONFIG_HOME location : /u01/application/PROD/fs1/inst/apps/PROD_rac2
Classpath :
/u01/application/PROD/fs1/FMW_Home/Oracle_EBS-app1/shared-libs/ebs-appsborg/WEB-INF/lib/ebsAppsborgManifest.jar:/u01/application/PROD/fs1/EBSapps/comn/java/classes
Using Context file :
/u01/application/PROD/fs1/inst/apps/PROD_rac2/appl/admin/PROD_rac2.xml
Context
Value Management will now update the Context file
Updating Context file...COMPLETED
Attempting upload of Context file and
templates to database...COMPLETED
Configuring
templates from all of the product tops...
Configuring AD_TOP........COMPLETED
Configuring FND_TOP.......COMPLETED
Configuring ICX_TOP.......COMPLETED
Configuring MSC_TOP.......COMPLETED
Configuring IEO_TOP.......COMPLETED
Configuring BIS_TOP.......COMPLETED
Configuring CZ_TOP........COMPLETED
Configuring SHT_TOP.......COMPLETED
Configuring AMS_TOP.......COMPLETED
Configuring CCT_TOP.......COMPLETED
Configuring WSH_TOP.......COMPLETED
Configuring CLN_TOP.......COMPLETED
Configuring OKE_TOP.......COMPLETED
Configuring OKL_TOP.......COMPLETED
Configuring OKS_TOP.......COMPLETED
Configuring CSF_TOP.......COMPLETED
Configuring IBY_TOP.......COMPLETED
Configuring JTF_TOP.......COMPLETED
Configuring MWA_TOP.......COMPLETED
Configuring CN_TOP........COMPLETED
Configuring CSI_TOP.......COMPLETED
Configuring WIP_TOP.......COMPLETED
Configuring CSE_TOP.......COMPLETED
Configuring EAM_TOP.......COMPLETED
Configuring GMF_TOP.......COMPLETED
Configuring PON_TOP.......COMPLETED
Configuring FTE_TOP.......COMPLETED
Configuring ONT_TOP.......COMPLETED
Configuring AR_TOP........COMPLETED
Configuring AHL_TOP.......COMPLETED
Configuring IES_TOP.......COMPLETED
Configuring OZF_TOP.......COMPLETED
Configuring CSD_TOP.......COMPLETED
Configuring IGC_TOP.......COMPLETED
AutoConfig
completed successfully.
in the
patch file system
[applmgr@rac2
PROD]$ cd $AD_TOP/bin
[applmgr@rac2
bin]$ echo $CONTEXT_FILE
/u01/application/PROD/fs2/inst/apps/PROD_rac2/appl/admin/PROD_rac2.xml
[applmgr@rac2
bin]$ perl adconfig.pl
contextfile=/u01/application/PROD/fs2/inst/apps/PROD_rac2/appl/admin/PROD_rac2.xml
-syncctx
Update the host names for concurrent requests log and out files to point to new primary after switchback
update
apps.fnd_concurrent_requests set logfile_node_name ='RAC2',outfile_node_name
='RAC2' where logfile_node_name ='DR' and outfile_node_name ='DR';
645 rows
updated.
SQL>
commit;
Commit
complete.
rsync the
concurrent log and out files between primary and secondary
rsync -avz log applmgr@192.168.x.x:/u01/application/fs_ne/inst/PROD_dr/logs/appl/conc
rsync -avz out applmgr@192.168.x.x:/u01/application/fs_ne/inst/PROD_dr/logs/appl/conc
start
the application services and redirect the user to new url
http://rac2.localdomain:8000/OA_HTML/AppsLocalLogin.jsp
Once you get comfortable with switchover/Switchback process, then failover steps can also be easily done. At this moment, failover is out of scope for this post.
Hope this post will help someone. Happy learning..:)