Starting from AD-TXK Delta 7 Oracle has enabled dualfs option in which the RUN and PATCH file systems get cloned simultaneously.
It is recommended to bring your system to AD-TXK Delta 7 to enable the
use of dualfs option.
There are various methods of cloning as below:
1. Standard Cloning
2. Advanced Cloning
a. Refreshing a Target System
b. Cloning a Multi-Node System
c. Adding a New Application Tier Node to an Existing System
d. Deleting an Application Tier Node
e. Cloning an Oracle RAC System
f. Adding/Deleting a Node from an Existing Oracle RAC Cluster
g. Cloning the Database Separately
h. Application Tier Fast Cloning
We will be proceeding with the concept and detail steps to clone SOURCE
system to TARGET which will cover Point 2 a.
Section 1. Prerequisite Tasks
Check if on SOURCE system patching cycle has been completed
successfully before proceeding with clone steps.
You can check using below commands:
$ adop -status -detail
SQL> select ADOP_SESSION_ID, PREPARE_STATUS, APPLY_STATUS,
FINALIZE_STATUS, CUTOVER_STATUS, CLEANUP_STATUS, ABORT_STATUS, STATUS,
ABANDON_FLAG, NODE_NAME from AD_ADOP_SESSIONS order by ADOP_SESSION_ID;
Query to determine the codelevel:
SQL> select * from AD_TRACKABLE_ENTITIES
where abbreviation like '%pf'
SQL> select
abbreviation,name,codelevel,baseline from AD_TRACKABLE_ENTITIES where
abbreviation=('ad');
Query to determine the baseline:
Following select will tell you the
R12 version:
SQL> select ‘RELEASE ‘||RELEASE_NAME
from APPLSYS.FND_PRODUCT_GROUPS;
Following select will tell you the
products and their corresponding baselines:
SQL> set pages 999
SQL> set long 9999
SQL> column BASELINE format a8
SQL> break on baseline
SQL> select BASELINE,upper(abbreviation),name
from AD_TRACKABLE_ENTITIES order by baseline,abbreviation;
SQL> SELECT app_short_name,
MAX(patch_level) FROM apps.ad_patch_driver_minipks GROUP BY app_short_name;
NOTE:
In AD-TXK Delta 7 we can clone the Application tier run and patch file
systems in a single operation, using the 'dualfs' option.Separate cloning of
the run and patch file systems is not required.
Before cloning to a new system, you must first prepare the Source
System by following the below steps:
1. Verify disk space requirements on Source System:
Ensure the Source System has enough free disk space. Oracle Fusion
Middleware cloning tools require 6GB in /tmp and 6GB under $COMMON_TOP.
2. Verify OS requirements on Target System:
Ensure the Target System meets all the requirements for Oracle
E-Business Suite Release 12.2 as stated in My Oracle Support Knowledge Document
1320300.1, Oracle
E-Business Suite Release Notes, Release 12.2, and Oracle E-Business Suite
Installation and Upgrade Notes for each platform.
3. Verify Inventory Requirements:
A global (central) inventory is generally recommended for all Oracle
E-Business Suite Release 12.2 application tier nodes and database tier nodes.
Note:
The 'EBS Installation Central Inventory' is supported only for the application
tier and only for UNIX platforms.
Requirements for Global Inventory:
A global (central) inventory is required for all Oracle E-Business
Suite Release 12.2 application tier nodes and database tier nodes.
The central inventory location must be identified by the value defined
in oraInst.loc file.
On a shared file system, the global inventory location must be shared
and used by all participating nodes.
oraInst.loc file specifies the location of the global inventory file.
a. Check that oraInst.loc exists in the correct directory for your
platform:
/etc
b. Confirm that the contents of oraInst.loc look like this:
inventory_loc=/oracle/oraInventory
where /oracle/oraInventory points to the directory where the central
inventory is located. This location must be writable by the user account that
is to run Rapid Clone.
Note:
If your system has separate installation user accounts for the database
and the applications, both users must be in the same install group (inst_group)
in oraInst.loc, which will need to contain a line such as inst_group=oracle.
If the oraInst.loc file does not exist, create it in the correct
directory with contents as shown above.
4. Verify Source and Target System software components and versions:
Verify software versions on SOURCE and TARGET for zip, unzip, operation
system utilities, perl.
5. Run AutoConfig on the application tier
6. Synchronize appsutil on the database tier nodes
7. Run AutoConfig on the database tier
8. Run EBS Technology Codelevel Checker (ETCC) on the database tier
9. Maintain snapshot information
Section 2. Standard Cloning Tasks
Rapid clone is used to create template files for cloning on SOURCE
system, post copying the SOURCE system to TARGET system rapid clone updates
these templates to include TARGET system configuration settings.
The cloning process consists of the following three phases, each of
which is made up of several logical sections and their steps.
è
Prepare the Source System for database tier and
application tier.
è
Copy both database tier and application tier nodes
from the Source System to Target System.
è
Configure the Target System for both database tier
and application tier.
1. Prepare the Source System for database tier and application tier
Note:
Ensure all the processes in the SOURCE System are up before proceeding
with the following two steps.
a. Prepare the Source System database tier for cloning:
Log on to the SOURCE System as the oracle user.
Source the database tier environment file.
Run the following commands:
$ cd <RDBMS ORACLE_HOME>/appsutil/scripts/<CONTEXT_NAME>
$ perl adpreclone.pl dbTier
Significance of running preclone:
It will create following directories in the $ORACLE_HOME/appsutil/clone
"Jlib", "db" & "data" where "Jlib"
relates to libraries "db" will contain the techstack information,
"data" will contain the information related to datafiles required for
cloning.
Creates driver files at $ORACLE_HOME/appsutil/driver/instconf.drv
Converts inventory from binary to xml, the xml file is located at
$ORACLE_HOME/appsutil/clone/context/db/Sid_context.xml
Prepare database for cloning:
This includes creating database control file script and datafile
location information file at
$ORACLE_HOME/appsutil/template/
"adcrdbclone.sql" & "dbfinfo.lst"
Generates database creation driver file at
ORACLE_HOME/appsutil/clone/data/driverdata.drv
Copy JDBC Libraries at ORACLE_HOME/appsutil/clone/jlib/classes12.jar
and appsutil
b. Prepare the Source System application tier for cloning
Log on to the primary node of the Source System as the applmgr user.
Source the environment file of the Run Edition File system.
You can use the following command to confirm that the environment
variable FILE_EDITION points to the Run Edition File System:
$ echo $FILE_EDITION
It should return the value:
run
Run the following commands:
$ cd <INST_TOP>/admin/scripts
$ perl adpreclone.pl appsTier
Significance of running preclone:
If there are any rapid clone or autoconfig patches appplied on SOURCE
system adpreclone.pl needs to be executed on Application and Database
tier to apply the new files into the clone directory structures to be used
during the cloning configuration stage.
Also, if you patch Oracle Fusion Middleware or make configuration
changes to the Oracle E-Business Suite WebLogic Domain, you must run adpreclone.pl
again on the application tier to rebuild the Oracle Fusion Middleware home.
The adpreclone.pl process on the application tier creates a complete
compressed archive of the Oracle Fusion Middleware and its components as
follows:
A compressed archive of the Oracle WebLogic Server home, Oracle Web
Tier Utilities home, Oracle Common Utilities home and the Oracle E-Business
Suite home:
<COMMON_TOP>/clone/FMW/FMW_Home.jar
A compressed archive of the Oracle E-Business Suite WebLogic domain:
<COMMON_TOP>/clone/FMW/WLS/EBSdomain.jar
The Oracle E-Business Suite WebLogic domain's configuration template:
<COMMON_TOP>/clone/FMW/WLS/plan/moveplan.xml
A compressed archive of the Oracle Web Tier/Oracle HTTP Server
configuration instance:
<COMMON_TOP>/clone/FMW/OHS/ohsarchive.jar
The Oracle HTTP Server configuration instance's configuration template:
<COMMON_TOP>/clone/FMW/OHS/moveplan.xml
The adpreclone log files are created in the
<INST_TOP>/admin/log/clone directory.
2. Take tar backup of Database ORACLE_HOME and for Application EBSapps
directory:
Dabatase ORACLE_HOME:
$ nohup tar -cvzf
/backup/O_H.tar.gz /u01/app/oracle/product/db/<DB_VERSION> &
Application:
Copy the EBSapps application tier directory from the SOURCE Node to the
TARGET run edition file system application tier node
EBSapps directory contains <APPL_TOP> , <COMMON_TOP> and
<OracleAS Tools 10.1.2 ORACLE_HOME>. EBSapps directory to be copied is
located under run edition file system ($RUN_BASE ).
$ echo $RUN_BASE
$ cd $RUN_BASE
$ nohup tar -cvzf /backup/APPS_`date +%m%d%y`.tar.gz
/u01/app/oracle/fs2/EBSapps &
Note:
If the SOURCE run fs is fs1 then the TARGET run fs should also be fs1.
Note:
In Release 12.2, you can set the base directory to any desired
location. However, the subdirectory structure cannot be changed because of
dependencies on both the WLS domain and the dual file system required for
online patching. Also, the base directory must be the same across all nodes in
multi-node configurations.
Section 3. Configuring TARGET system
1.Configure ORACLE_HOME:
Before you scrap the TARGET instance home and database files please
follow below steps:
Stop target application system services
You can stop it with below commands.
$ cd $INST_TOP/admin/scripts
$ ./adstapall.sh apps/<apps_password>
Take spool of TARGET database files
SQL> spool DB_NAME_bef_drop_DATE.txt
SQL> select
instance_name,status,name,database_role,open_mode, from
gv$instance,gv$database;
SQL> select name from v$datafile order by file#;
SQL> select name from v$controlfile;
SQL> select member from v$logfile;
SQL> select file_name from dba_temp_files;
SQL> archive log list;
SQL> show parameter dump;
SQL> show parameter spfile;
---Control file trace
SQL> alter database backup controlfile to trace as
'PATH/cntrl/before_drp/cntrl.txt';
SQL> create pfile='PATH/pfile_DB_NAME.ora' from spfile;
SQL> spool off
Drop TARGET database:
SQL> startup mount restrict pfile='PATH/pfile_DB_NAME.ora';
SQL> select
instance_name,status,name,database_role,open_mode, from v$instance,v$database;
SQL> show parameter spfile;
SQL> drop database;
Note:
Please keep the alert log open to monitor database drop.
Remove
TARGET ORACLE_HOME and untar the tar backup of SOURCE ORACLE_HOME and then
proceed with ORACLE_HOME configuration.
$ cd <RDBMS ORACLE_HOME>/appsutil/clone/bin
$ perl adcfgclone.pl dbTechStack
Below are the prompts that will be asked:
Enter the APPS password :
Provide the values required for creation of the new Database Context
file.
Target System Hostname (virtual or normal) [<hostname>] :
<hostname>
Target Instance is RAC (y/n) [n] : n
Target System Database SID : TEST
Target System Base Directory : /u01/app/oracle
Target System utl_file_dir Directory List : /tmp,/u01/app/oracle/12.1.0/appsutil/outbound/TEST_<hostname>
Number of DATA_TOP's on the Target System [1] :
Target System DATA_TOP Directory 1 [/u02/app/data] :
Target System RDBMS ORACLE_HOME Directory [/u01/app/oracle/12.1.0] :
Do you want to preserve the Display [null] (y/n) : n
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] : 19
Checking the port pool 19
done: Port Pool 19 is free
Report file located at /u01/app/oracle/12.1.0/appsutil/temp/portpool.lst
This will be followed by rdbms home Apply and starting the listener.
The entire process takes 15-20 minutes.
Once the ORACLE_HOME is configured check the listener status and then
proceed with restoring the database.
Note:
We will be restoring the database on target system using RMAN.
There is no downtime required for the SOURCE database.
Restore of database files:
Start the restore as per below steps:
Edit the above created pfile with DB_NAME='PROD'
$ export ORACLE_SID=PROD
$ sqlplus / as sysdba
SQL> startup nomount pfile='PATH/pfile_DB_NAME.ora';
SQL> select instance_name from v$instance;
Restore controlfile from backup piece:
$ rman target /
rman> restrore controlfile from 'CNTRL_FILE_BKP_PIECE';
$ sqlplus / as sysdba
SQL> select instance_name from v$instance;
SQL> alter database mount;
SQL> select name,open_mode from v$database;
Catalog backup pieces:
$ rman target /
rman> catalog start with 'BKP_PIECE_PATH';
Set new name command on TARGET node after mount:
$ sqlplus / as sysdba
SQL> select name,open_mode from v$database;
SQL> set page size 900
SQL> set line size 900
SQL> select ' set newname for datafile ' || '' || FILE# || ''
|| ' to ''+DISK_GRP' ||reverse
(substr(reverse(name),0,instr(reverse(name),'/')-1)) || ''';' from v$datafile;
The above command will set the new name for the datafiles as per
TARGET node env, Copy the output and paste it in the run block.
restore the database using set new name run block:
Eg:
{
run
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
allocate channel ch4 device type disk;
set new name output paste here
restore database;
switch datafile all;
recover database;
release channel ch1 device type disk;
release channel ch2 device type disk;
release channel ch3 device type disk;
release channel ch4 device type disk;
}
Check rman restore progress using below commands:
TTITLE LEFT '% Completed. Aggregate is the overall progress:'
SET LINE 132
SELECT opname, round(sofar/totalwork*100) "% Complete"
FROM gv$session_longops
WHERE opname LIKE 'RMAN%'
AND totalwork != 0
AND sofar <> totalwork
ORDER BY 1;
TTITLE LEFT 'Channels waiting:'
COL client_info FORMAT A15 TRUNC
COL event FORMAT A20 TRUNC
COL state FORMAT A7
COL wait FORMAT 999.90 HEAD "Min waiting"
SELECT s.sid, p.spid, s.client_info, status, event, state,
seconds_in_wait/60 wait
FROM gv$process p, gv$session s
WHERE p.addr = s.paddr
AND client_info LIKE 'rman%';
TTITLE LEFT 'Files currently being written to:'
COL filename FORMAT a50
SELECT filename, bytes, io_count
FROM v$backup_async_io
WHERE status='IN PROGRESS'
/
Once recovery done, backup the control file to trace:
SQL> alter database backup controlfile to trace as
'PATH/cntrl/after_restore/cntrl.txt';
SQL> select name,free_mb,total_mb from v$asm_diskgroup;
SQL> select name,open_mode from v$database;
SQL> shutdown immediate
Change the DB_NAME in pfile to the instance that you are cloning
to.
Login to asm:
Take bkp of all the existing control files then, remove them and
follow below steps:
From the control file trace modify the control file as per the
requirement.
$ export ORACLE_SID=INST_NAME
$ sqlplus / as sysdba
SQL> startup nomount pfile='PATH/pfile_DB_NAME.ora';
SQL> select instance_name from v$instance;
SQL> @run_cntrl.txt
---- Modified
trace file run
SQL> select name,open_mode,log_mode from v$database;
SQL> alter database open resetlogs;
Note:
Keep the alert log open and check which temp tablespaces are
empty and add temp files accordingly.
Add temp files:
SQL> alter tablespace TEMP1 add temp files '+DISK_GROUP' size
4G;
SQL> alter tablespace TEMP2 add temp files '+DISK_GROUP' size
4G;
SQL> select name,open_mode,log_mode from v$database;
SQL> shutdown immediate
$ export ORACLE_SID=INST_NAME
SQL> startup nomount pfile='PATH/pfile_DB_NAME.ora';
SQL> select instance_name from v$instance;
SQL> alter database mount;
SQL> alter database open;
SQL> select name,open_mode,log_mode from v$database;
SQL> select instance_name,status,name,database_role,open_mode,
from gv$instance,gv$database;
Create spfile from pfile:
SQL> select
instance_name,status,name,database_role,open_mode, from v$instance,v$database;
SQL> create spfile='<Location>' from
pfile='PATH/pfile_DB_NAME.ora';
SQL> shutdown immediate
SQL> startup
2.Configure Application Tier:
Cleanup
TARGET application tier file system
Note:
If any of
the above ORACLE_HOME entries are already registered in Oracle Inventory, run
the following command to de-register or detach that ORACLE_HOME:
$ ./runInstaller
-detachhome ORACLE_HOME=<Oracle Home Location> [-invPtrLoc
<s_invPtrLoc>]
Here,
-invPtrLoc
argument needs to be specified only if the 'EBS installation central' inventory
is being used.
s_invPtrLoc
is the context variable that stores the inventory pointer location.
For
example:
$ cd
/u02/r122/fs1/FMW_Home/oracle_common/oui/bin
$ ./runInstaller
-detachhome \
ORACLE_HOME=/s0/r122/at1/FMW_Home/oracle_common
-silent
Remove
application directory structure from under $RUN_BASE and $PATCH_BASE in the
target application tier system.
Untar
the tar backup of SOURCE Application tier and then proceed with configuration.
$ nohup tar -xvzf /backup/apps_<date>3.tar.gz &
$ perl adcfgclone.pl appsTier dualfs
Report file located at /test/applebs/inst/fs1/inst/apps/CLOVER_<hostname>/admin/out/portpool.lst
The new APPL_TOP context file has been created:
/test/applebs/inst/fs1/inst/apps/CLOVER_tstebd01/appl/admin/CLOVER_<hostname>.xml
Check Clone Context logfile /test/applebs/apps/fs2/EBSapps/comn/clone/bin/CloneContextPatch_0226120637.log for details.
FMW Pre-requisite check log file location:
/test/applebs/apps/fs2/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running: FMW pre-req check...
Configuring: Run file system....
LogFile located at /test/applebs/inst/fs2/inst/apps/CLOVER_tstebd01/admin/log/clone/run/RCloneApplyAppstier_02261206.log
Configuring: Patch files system....
LogFile located at
/test/applebs/inst/fs2/inst/apps/CLOVER_tstebd01/admin/log/clone/patch/RCloneApplyAppstier_02261303.log
Do you want to startup the Application Services for CLOVER? (Y/n) [n] :
y
Important:
If adcfglone fails on application tier ensure ORACLE_HOMES are
not already registered in the Oracle inventory.
If it is registered, please follow below steps:
In the event of failure of Rapid Clone during execution of
adcfgclone, the following steps need to be performed before restarting
adcfgclone execution on the application tier:
On application tier:
1. De-register the Oracle Homes on both Run Edition and
Patch Edition file system:
Verify if Oracle Inventory contains the following Oracle
Home entries for the Run Edition or Patch Edition file system:
<FMW_HOME>/oracle_common
<FMW_HOME>/webtier
<FMW_HOME>/Oracle_EBS-app1
If any of the above Oracle Home entries are already
registered in Oracle Inventory, you can run the following command to
de-register or detach that Oracle Home:
$ ./runInstaller -detachhome \
ORACLE_HOME=<Oracle Home Location> [-invPtrLoc
<s_invPtrLoc>]
Here,
-invPtrLoc argument needs to be specified only if an 'EBS
Installation Central' inventory is being used.
s_invPtrLoc is the context variable that stores the
inventory pointer location.
For example:
$ cd /u02/r122/fs1/FMW_Home/oracle_common/oui/bin
$ ./runInstaller -detachhome \
ORACLE_HOME=/s0/r122/at1/FMW_Home/oracle_common
2. If the FMW_HOME directory structure exists, delete it as
follows:
$ rm -rf <FMW_HOME>
Reference:
Cloning Oracle E-Business Suite Release 12.2 with Rapid Clone (Doc ID
1383621.1)
No comments:
Post a Comment