Friday, July 3, 2020

adcfgclone failing with Error: AFTER PASTEBINARY COMMENV.SH FILE IS POPULATED WITH INCORRECT JAVA_HOME PATH in EBS 12.2

Hi DBAs,

I'm happy to share my knowledge and experience based out of one cloning experience in EBS 12.2 Environment. I faced this issue while doing cloning. Sharing my experience .
I'm making this post short and sweet.


Adcfgclone failing with Error: AFTER PASTEBINARY COMMENV.SH FILE IS POPULATED WITH INCORRECT JAVA_HOME PATH in EBS 12.2

Oracle Support notes:
=====================
12.2 E-Business Suite Applications Manager Rapidclone Fails With Error 'Oracle.as.t2p.exceptions.FMWT2PPasteConfigException: Paste Config In Offline Mode Failed', 'CLONE-20454 Execution of wlst script' And 'CLONE-20365 Error in executing WebLogic script' (Doc ID 2545694.1)

Resolution: Apply patch 27212806 to MIDDLE_WARE/oracle_common Home

Zero downtime patch can be applied directly .


[applmgr@erpap02 WLS_ERROR_patch]$ echo $TWO_TASK
ERP_BALANCE
[applmgr@erpap02 WLS_ERROR_patch]$ echo $RUN_BASE
/u01/oracle/ERP/fs1
[applmgr@erpap02 WLS_ERROR_patch]$ export ORACLE_HOME=/u01/oracle/ERP/fs1/FMW_Home/oracle_common
[applmgr@erpap02 WLS_ERROR_patch]$ cd 28708563/

[applmgr@erpap02 28708563]$ export ORACLE_HOME=/u01/oracle/ERP/fs1/FMW_Home/oracle_common
[applmgr@erpap02 28708563]$ /u01/oracle/ERP/fs1/FMW_Home/oracle_common/OPatch/opatch version
OPatch Version: 11.1.0.12.9

OPatch succeeded.
[applmgr@erpap02 28708563]$ /u01/oracle/ERP/fs1/FMW_Home/oracle_common/OPatch/opatch lsinventory|grep 28708563
Patch  28708563     : applied on Sun Jun 02 02:03:34 AST 2019
[applmgr@erpap02 28708563]$ cd ..
[applmgr@erpap02 WLS_ERROR_patch]$ cd 27212806/
[applmgr@erpap02 27212806]$ ls -ltr
total 8
drwxr-xr-x. 4 applmgr oinstall   31 Jul  3 14:12 etc
drwxr-xr-x. 3 applmgr oinstall   18 Jul  3 14:12 files
-rw-r--r--. 1 applmgr oinstall 7248 Jul  3 14:12 README.txt
[applmgr@erpap02 27212806]$ /u01/oracle/ERP/fs1/FMW_Home/oracle_common/OPatch/opatch apply
Oracle Interim Patch Installer version 11.1.0.12.9
Copyright (c) 2020, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/oracle/ERP/fs1/FMW_Home/oracle_common
Central Inventory : /u01/oracle/oraInventory
   from           : /u01/oracle/ERP/fs1/FMW_Home/oracle_common/oraInst.loc
OPatch version    : 11.1.0.12.9
OUI version       : 11.1.0.11.0
Log file location : /u01/oracle/ERP/fs1/FMW_Home/oracle_common/cfgtoollogs/opatch/27212806_Jul_03_2020_14_14_39/apply2020-07-03_14-14-39PM_1.log


OPatch detects the Middleware Home as "/u01/oracle/ERP/fs1/FMW_Home"

Applying interim patch '27212806' to OH '/u01/oracle/ERP/fs1/FMW_Home/oracle_common'
Verifying environment and performing prerequisite checks...
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y



Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/oracle/ERP/fs1/FMW_Home/oracle_common')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...

Patching component oracle.as.common.clone, 11.1.1.9.0...

Verifying the update...
Patch 27212806 successfully applied
Log file location: /u01/oracle/ERP/fs1/FMW_Home/oracle_common/cfgtoollogs/opatch/27212806_Jul_03_2020_14_14_39/apply2020-07-03_14-14-39PM_1.log

OPatch succeeded.
[applmgr@erpap02 27212806]$ /u01/oracle/ERP/fs1/FMW_Home/oracle_common/OPatch/opatch lsinventory|grep 27212806
Patch  27212806     : applied on Fri Jul 03 14:14:52 AST 2020
     27212806
[applmgr@erpap02 27212806]$


Happy Apps DBA learning

Thanks,

Rafi

Sunday, April 5, 2020

Implement Transparent Data Encryption(TDE) using fast offline conversion for Oracle Databases

Hi DBAs,

It is important we share what we do in DBAs life to help ourself and others. I've done many implementation projects recently related with Database Security. One of the them was TDE which was pending in my blog posts . I've decided to share the steps involve in implementing Transparent Data Encrption(TDE) using fast offline conversion method for entire Oracle Database. We can follow the similar steps in Oracle RAC or Standalone Database Except few additional things need to done for Oracle RAC Database.


Prerequisite:

Make sure you have applied the patch 23315889(fast offline conversion patch) if you are on Oracle 11g Database or latest CPU patches are applied which already include all the mandatory patches before proceeding with below steps.

Below steps can be used for Oracle 11g,12c , 18c, 19c Databases

Step 1: Take a Backup of  Database using RMAN.

Make sure you have full Database backup using RMAN and Validated.

Step 2: Take Backup of  $TNS_ADMIN ( $ORACLE_HOME/network/admin) Directory

Please take backup of network configuration files which includes backup of  $TNS_ADMIN Directory of $ORACLE_HOME in all the DB nodes.

Step 3: Make Sure You Inform Application owners or End User for Downtime

Please make sure you take sufficient downtime based on the size of your Database if it is Production Environment . If you have identical test environment as Production , we have very good opportunity to make a note of timings at each step of implementation phase. It will surely be useful.

Step 4:Shut down applications

If you are using Oracle ERP Applications make sure all the applications are stopped with adstpall.sh script or other applications it needs to be completed stoped.

Step 5:Create a specific wallet by specifying the wallet location in the  sqlnet.ora file(sqlnet_ifile.ora in Oracle ERP Environment).

$ORACLE_HOME/network/admin is the location where you find network configuration files( sqlnet.ora or sqlnet_ifile.ora(In Oracle ERP) needs to be modified).

sqlnet.or or sqlnet_ifile.ora contents :

ENCRYPTION_WALLET_LOCATION =
(SOURCE = (METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = /home/oracle/wallet/$ORACLE_SID)
)
)

Note: DIRECTORY location like above makes it easier to copy wallet files across multiple databases. However we are free to have any location of our choice.

Step 6: Restart Database instance and Listener for Oracle RAC Environment running on node1 and node2  or Listener and DB in Standalone DB using SQLPLUS

After completing step 1 to step5 perform step 6 mandatory. This is important to detect the wallet location by Database.

Make sure you bring down all the instances and databases services from all the other nodes if you are working in RAC Database Environment. All the steps need to be performed from DB node1 or Primary Database Instance and all the other instances and Database services are down in other servers.


DB node1:
=====================
[root@dbhost01 bin]# su - oracle
[oracle@dbhost01 ~]$ srvctl status database -d testdb
Instance testdb1 is running on node dbhost01
Instance testdb2 is not running on node dbhost02
[oracle@dbhost01 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): dbhost01,dbhost02
[oracle@dbhost01 ~]$ srvctl stop instance -i testdb1 -d testdb
[oracle@dbhost01 ~]$ srvctl status database -d testdb
Instance testdb1 is not running on node dbhost01
Instance testdb2 is not running on node dbhost02
[oracle@dbhost01 ~]$ srvctl stop listener -n dbhost01
[oracle@dbhost01 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): dbhost02
[oracle@dbhost01 ~]$ srvctl start listener -n dbhost01
[oracle@dbhost01 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): dbhost01,dbhost02
[oracle@dbhost01 ~]$ srvctl start instance -i testdb1 -d testdb
[oracle@dbhost01 ~]$ srvctl status database -d testdb
Instance testdb1 is running on node dbhost01
Instance testdb2 is not running on node dbhost02
[oracle@dbhost01 ~]$


Step 7:Create the wallet and Set the Master Encryption Key.

Initiate a new SQL*Plus session.
This causes the changes to sqlnet.ora and the environment variable to be picked
up by the new session.

SQL> select name from v$database;

NAME
---------
testdb

SQL> select status from v$instance;

STATUS
------------
OPEN

Set the Master Encryption Key.

Check below:
==========

SQL> select instance_name,status,database_status from gv$instance;

INSTANCE_NAME    STATUS       DATABASE_STATUS
---------------- ------------ -----------------
testdb1        OPEN         ACTIVE


SQL> select * from gv$encryption_wallet order by inst_id;

   INST_ID WRL_TYPE
---------- --------------------
WRL_PARAMETER
--------------------------------------------------------------------------------
STATUS
------------------
         1 file
/home/oracle/wallet/$ORACLE_SID
CLOSED

(or)

select * from v$encryption_wallet;


SQL> ALTER SYSTEM SET ENCRYPTION KEY IDENTIFIED BY "Mywork8t5_mydbacomp";

System altered.

NOTE: Ensure that the password string is contained in double quotation marks (" ").


Step 8: Shutdown & Startup  the database normally, ensuring that the wallet is open: 


[oracle@dbhost01 ~]$ sqlplus "/as sysdba"

SQL> select name from v$database;

NAME
---------
testdb

SQL>shut immediate

SQL*Plus: Release 11.2.0.4.0 Production on Fri Apr 19 20:31:26 2019

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 1.2527E+10 bytes
Fixed Size                  2264856 bytes
Variable Size            7012876520 bytes
Database Buffers         5502926848 bytes
Redo Buffers                8658944 bytes
Database mounted.

SQL> alter system set encryption wallet open identified by "Mywork8t5_mydbacomp";

System altered.

SQL> alter database open;

Database altered.

SQL> select instance_name,status,database_status from gv$instance;

INSTANCE_NAME    STATUS       DATABASE_STATUS
---------------- ------------ -----------------
testdb1        OPEN         ACTIVE


SQL>

Step 9:To configure auto login for wallet (optional), do the following

Command: orapki wallet create -wallet "/home/oracle/wallet/$ORACLE_SID" -auto_login

[oracle@dbhost01 admin]$ orapki wallet create -wallet "/home/oracle/wallet/$ORACLE_SID" -auto_login
Oracle PKI Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.

Enter wallet password:     Mywork8t5_mydbacomp
                    
[oracle@dbhost01 admin]$

Verify autostart of Database is working as expected:
=======================================
[oracle@dbhost01 admin]$ srvctl status database -d testdb
Instance testdb1 is running on node dbhost01
Instance testdb2 is not running on node dbhost02
[oracle@dbhost01 admin]$ srvctl stop instance -i testdb1 -d testdb
[oracle@dbhost01 admin]$ srvctl status database -d testdb
Instance testdb1 is not running on node dbhost01
Instance testdb2 is not running on node dbhost02
[oracle@dbhost01 admin]$ srvctl start instance -i testdb1 -d testdb
[oracle@dbhost01 admin]$ srvctl status database -d testdb
Instance testdb1 is running on node dbhost01
Instance testdb2 is not running on node dbhost02

Step 10:Backup the wallet

Using 'cp' command copy the wallet files in separate directory and verify it.

[oracle@dbhost01 testdb1]$ pwd
/home/oracle/DBA/backup/wallet/testdb1
[oracle@dbhost01 testdb1]$ ls -ltr
total 8
-rw-------. 1 oracle oinstall 2917 Apr 19 21:00 cwallet.sso
-rw-r--r--. 1 oracle oinstall 2840 Apr 19 21:00 ewallet.p12
[oracle@dbhost01 testdb1]$


Step 11: Copy the wallet to DB node2 in the same location as DB node1.

Copy the wallet to DB node2 in the same location as DB node1 and make sure in the sqlnet.ora and sqlnet_ifile.ora file has the same location defined.

$ORACLE_HOME/network/admin is the location where you find network configuration files( sqlnet.ora or sqlnet_ifile.ora(In Oracle ERP) needs to be modified).

sqlnet.or or sqlnet_ifile.ora contents :

ENCRYPTION_WALLET_LOCATION =
(SOURCE = (METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = /home/oracle/wallet/$ORACLE_SID)
)
)

oracle@dbhost01 testdb1]$ pwd
/home/oracle/wallet/testdb1
[oracle@dbhost01 testdb1]$ ls -ltr
total 8
-rw-r--r--. 1 oracle asmadmin 2840 Apr 19 20:17 ewallet.p12
-rw-------. 1 oracle oinstall 2917 Apr 19 20:47 cwallet.sso
[oracle@dbhost01 testdb1]$ scp ewallet.p12 cwallet.sso oracle@dbhost02:/home/oracle/wallet/testdb2
ewallet.p12                                                                           100% 2840     2.8KB/s   00:00
cwallet.sso                                                                           100% 2917     2.9KB/s   00:00
[oracle@dbhost01 testdb1]$


Step 12:Verify DB Instances and Services on DB node1 & DB node2.

Now you can start the instance on Database Instance and Database services on DB node2 and verify it is running.

[oracle@dbhost01 admin]$ srvctl status database -d testdb
Instance testdb1 is running on node dbhost01
Instance testdb2 is running on node dbhost02


[oracle@dbhost01 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): dbhost01,dbhost02

(OR)

For Testing purpose only

We can also verify DB node2 is started after copying ewallet.p12 and cwallet.sso:
===========================================================
[oracle@dbhost02 testdb2]$ ls -ltr
total 8
-rw-r--r--. 1 oracle oinstall 2840 Apr 19 21:08 ewallet.p12
-rw-------. 1 oracle oinstall 2917 Apr 19 21:08 cwallet.sso

[oracle@dbhost02 testdb2]$ srvctl stop instance -i testdb1 -d testdb
[oracle@dbhost02 testdb2]$ srvctl status database -d testdb
Instance testdb1 is not running on node dbhost01
Instance testdb2 is not running on node dbhost02
[oracle@dbhost02 testdb2]$ srvctl start instance -i testdb2 -d testdb
[oracle@dbhost02 testdb2]$ srvctl status database -d testdb
Instance testdb1 is not running on node dbhost01
Instance testdb2 is running on node dbhost02
[oracle@dbhost02 testdb2]$


Make sure all the Database Instances and Services are Up before proceeding next step.

Verify as below:
[oracle@dbhost01 admin]$ srvctl status database -d testdb
Instance testdb1 is running on node dbhost01
Instance testdb2 is running on node dbhost02


[oracle@dbhost01 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): dbhost01,dbhost02



Step 13: Find out all the Temporary and Undo Tablespaces in the Database


SQL> select name from v$database;

NAME
---------
TESTDB

SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY' and STATUS='ONLINE';

TABLESPACE_NAME
------------------------------
TEMP
PG_TEMP
MG_TEMP
TG_TEMP
TMP

SQL> select tablespace_name from dba_tablespaces where contents='UNDO' and STATUS='ONLINE';

TABLESPACE_NAME
------------------------------
UNDOTBS1
UNDOTBS2


Step 14: Create a script called tbsp_offline.sql script to bring tablespaces 
other than system, sysaux, temp and undo offline: 

cd /home/oracle/DBA/scripts/tde_scripts

$ sqlplus / as sysdba
SQL>set heading off
 SQL>set linesize 150
 SQL>spool tbsp_offline.sql
SQL>select 'alter tablespace '||tablespace_name|| ' offline;' from dba_tablespaces where tablespace_name not in ('SYSTEM','SYSAUX','TEMP','PG_TEMP','MG_TEMP','TG_TEMP','TMP','UNDOTBS1','UNDOTBS2','MY_TEMP');
SQL>exit
Now edit the tbsp_offline.sql script to remove all lines other than alter tablespace commands.

(testdb):
-------------------
Don't delete line just comment extra lines as done below:

[oracle@dbhost01 tde_scripts]$ ls -ltr
total 36
-rw-r--r--. 1 oracle oinstall  2181 Apr 17 15:00 tbsp_offline_orig_17Apr2019.sql
-rw-r--r--. 1 oracle oinstall 12025 Apr 17 15:07 datafiles_encrypt_orig_17Apr2019.sql
-rw-r--r--. 1 oracle oinstall  2175 Apr 17 15:21 tbsp_offline.sql
-rw-r--r--. 1 oracle oinstall  2150 Apr 17 15:21 tbsp_online.sql
-rw-r--r--. 1 oracle oinstall 12031 Apr 17 15:23 datafiles_encrypt.sql
[oracle@dbhost01 tde_scripts]$ cat tbsp_offline.sql
--SQL> select 'alter tablespace '||tablespace_name|| ' offline;' from dba_tablespaces where tablespace_name not in ('SYSTEM','SYSAUX','TEMP','PG_TEMP','MG_TEMP','TG_TEMP','TMP','UNDOTBS1','UNDOTBS2','MY_TEMP');

alter tablespace USERS offline;
alter tablespace TEST1_TS offline;
alter tablespace TEST2_TS offline;
alter tablespace TEST3_TS offline;
alter tablespace TEST4_TS offline;
alter tablespace TEST5_TS offline;
alter tablespace TEST6_TS offline;


--7 rows selected.

Step 15: Create script for to Encrypt datafiles of Tablespaces

Create a script called datafiles_encrypt.sql containing the commands to encrypt your datafiles,
except system, sysaux, temp and undo.Include all TEMP and UNDO tablespace names from the database in your TESTDB instance, in the exclusion list.

$ sqlplus / as sysdba
SQL>set heading off
 SQL>set linesize 150
 SQL>spool datafiles_encrypt.sql
 SQL>select 'alter database datafile ''' || file_name ||''' encrypt;' from dba_data_files where tablespace_name not in (('SYSTEM','SYSAUX','TEMP','PG_TEMP','MG_TEMP','TG_TEMP','TMP','UNDOTBS1','UNDOTBS2','MY_TEMP');

SQL>exit

Verify the Script.

[oracle@dbhost01 tde_scripts]$ cat datafiles_encrypt.sql
--SQL> select 'alter database datafile ''' || file_name ||''' encrypt;' from dba_data_files where tablespace_name not in --('SYSTEM','SYSAUX','TEMP','PG_TEMP','MG_TEMP','TG_TEMP','TMP','UNDOTBS1','UNDOTBS2','MY_TEMP');
alter database datafile '+DATA/testdb/datafile/user_ts_ts01.dbf' encrypt;                                     
alter database datafile '+DATA/testdb/datafile/test_01_ts.dbf' encrypt;                                           
alter database datafile '+DATA/testdb/datafile/test_02_ts.dbf' encrypt;                                         
alter database datafile '+DATA/testdb/datafile/test_03_ts.dbf' encrypt;                                           
alter database datafile '+DATA/testdb/datafile/test_04_ts.dbf' encrypt;                                           
alter database datafile '+DATA/testdb/datafile/test_05_ts.dbf' encrypt;                                         
alter database datafile '+DATA/testdb/datafile/test_06_ts.dbf' encrypt;   

--7 rows selected.                                   
                                     
                                             
Step 16: Create a script called tbsp_online.sql script to bring Encrypted tablespaces online now 

$ sqlplus / as sysdba
SQL>set heading off
 SQL>set linesize 150
 SQL>spool  tbsp_online.sql 
SQL> select 'alter tablespace '||tablespace_name|| ' online;' from dba_tablespaces where tablespace_name not in ('SYSTEM','SYSAUX','TEMP','PG_TEMP','MG_TEMP','TG_TEMP','TMP','UNDOTBS1','UNDOTBS2','MY_TEMP');
--SQL> spool off


alter tablespace USERS online;
alter tablespace TEST1_TS online;
alter tablespace TEST2_TS online;
alter tablespace TEST3_TS online;
alter tablespace TEST4_TS online;
alter tablespace TEST5_TS online;
alter tablespace TEST6_TS online;


--7 rows selected.

[oracle@dbhost01 tde_scripts]$


Step 17: Execute the script for bringing the tablespaces offline

cd /home/oracle/DBA/scripts/tde_scripts

sqlplus "/as sysdba"

SQL> select name from v$database;

NAME
---------
testdb

SQL> @tbsp_offline.sql

Tablespace altered.

Step 18: Execute the script for Encrypting the Datafiles of the tablespaces.

cd /home/oracle/DBA/scripts/tde_scripts

sqlplus "/as sysdba"

SQL> select name from v$database;

NAME
---------
testdb

SQL> @datafiles_encrypt.sql

Database altered.

Note: If we have a large number of datafiles , we can parallelize their encryption by creating sub-scripts  and running the sub-scripts from parallel SQL*Plus sessions.

Step 19: Execute the script for bringing the tablespaces online

cd /home/oracle/DBA/scripts/tde_scripts

sqlplus "/as sysdba"

SQL> select name from v$database;

NAME
---------
testdb

SQL> @tbsp_online.sql

Tablespace altered.


Note: Some tablespaces may take time to show as online. These are probably tablespaces that are encrypted.

*Check the status of tablespace encryption by connecting to SQL*Plus / as sysdba
and running the query shown:

$ sqlplus / as sysdba

SQL>select tablespace_name, encrypted from dba_tablespaces;

Note: Be aware that unless an auto login keystore is created, every time the database is started up the wallet will need to be opened.


Note: In Oracle 12c we can use below command to create auto login

$ sqlplus / as sysdba
$ administer key management create AUTO_LOGIN keystore from keystore "<Wallet Path>" identified by "<Wallet Password>";

Please refer below link for more details on it:

https://oracle-base.com/articles/12c/multitenant-transparent-data-encryption-tde-12cr1


Step 20: Bounce database and listener , verify auto login is working .

Verify the Database , Listener and Do Complete Health check of the Database.
Start the Applications.
Validate Database connectivity with TOAD, SQL Developer and every component is working as expected.
Make sure all the instances and Database services are up & running. If you have DR Database copy the wallet to same location as Primary Database and Sync it and Verify the DR DB is in sync with Primary.

sqlplus "/as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Tue Mar 5 17:12:22 2019

Copyright (c) 1982, 2017, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 5167382528 bytes
Fixed Size                  3056376 bytes
Variable Size            1056967944 bytes
Database Buffers         4093640704 bytes
Redo Buffers               13717504 bytes
Database mounted.
Database opened.
SQL> select tablespace_name, encrypted from dba_tablespaces;

TABLESPACE_NAME                ENC
------------------------------ ---
SYSTEM                         NO
SYSAUX                         NO
UNDOTBS1                       NO
TEMP                           NO
USERS                          YES

SQL> SET LINESIZE 200
SQL> COLUMN wrl_parameter FORMAT A50
SQL> SELECT * FROM gv$encryption_wallet;

WRL_TYPE             WRL_PARAMETER                                      STATUS                         WALLET_TYPE          WALLET_OR FULLY_BAC     CON_ID
-------------------- -------------------------------------------------- ------------------------------ -------------------- --------- --------- ----------
FILE                 /home/oracle/wallet/testdb1 OPEN                                    SINGLE    NO                 0
FILE                 /home/oracle/wallet/testdb2 OPEN 
                   
SQL> select active_state,instance_Name,status from gv$instance;

ACTIVE_ST INSTANCE_NAME    STATUS
--------- ---------------- ------------
NORMAL    testdb1          OPEN
NORMAL    testdb2          OPEN

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE


Enjoy DBA learning and doing tasks....


Thanks,

Rafi





Monday, August 5, 2019

Completed Oracle 12c Database OCP Certification

Dear All,

Alhumdulilah Completed Oracle 12c OCP Certification after working hard in Oracle 12c Databases.
Worked & Studied Rigorously on Oracle 12c Database..

https://www.youracclaim.com/badges/d7740e40-df91-4f87-af9e-efd66d5533f0/linked_in









Please Study Oracle Workshop Admin guide and practices DBA tasks to get compatable with Exam.
Below link also can be helpful. All the best. Enjoy DBA tasks.


https://docs.oracle.com/database/121/ADMIN/E41484-15.pdf

Friday, June 14, 2019

Configure Database option is greyed out in DBCA

Hi DBAs,

Recently we faced a strange issue which became a show stopper for us.

Database Configuration Assistant was not showing the database and  Configure Database Options and it was greyed out(disabled).

 We tried setting up ORACLE_SID and ORACLE_HOME and ran dbca but it was not showing the database and the above option was  greyed out.

We checked and verified the oratab file for correct entry for the database we were trying to access from dbca but still it was greyed out.

To resolve this issue I utilized all my experience and knowledge at last was able to resolve it. The issue was simple and silly but sometimes small things matter.

Below are steps used to resolve this issue:

Step 1:

Make sure the ORACLE_HOME is some thing like below : /u01/app/oracle/12.1/dbhome in /etc/oratab file

(Note we should not have '/' after dbhome)

Step 2:

Check the value of the configuration of  RAC Database:

srvctl config database -d testdb1

Where: testdb1=> DB Name.

Now change the ORACLE_HOME value as below:

srvctl modify database -o /u01/app/oracle/12.1/dbhome

Where:  /u01/app/oracle/12.1/dbhome=> ORACLE HOME location.

Make sure you don't use '/' after dbhome.

Step 3:

Now launch 'dbca' bye setting correct Environment.

Now you should see the option enabled for Configure Database Options after launching dbca.


Enjoy troubleshooting Database....

Happy DBA Learning...


Thanks,

Rafi




Friday, January 18, 2019

Migrating Oracle ERP Applications from one server to another in Windows Environment

Hi DBAs,

Below are the steps required to be done in order to migrate Oracle ERP Applications from one server to another. These steps are successfully tested in my Test Oracle ERP Servers.

Note 1: My source and Target Environment is EBS 12.1.3
Note 2: This is applicable for Windows 2008 R2 server but somewhat similar steps can be applicable to Windows 2012 R2 or Windows 2016 server)
Note 3:All the steps are done on the Target Application Server
Note 4:Make sure you change the source server name and assign the same name to target Windows server in order to have backup of source Application server and not much changes is required in CONTEXT FILE if you have same Drives on Source and Target Application server.
Note 5: Please change server names,Directory structure and Environment files based on your servers.
as one need to spend some time in order to do this activity successfully.

Preparatory Steps:

1. Install MKS Toolkit on Target Server( we can also install CYGWIN ) . It is recommended to install MKS from Oracle Support.
2.Install VISUAL Studio of same Windows OS version(2008 R2).

Planning and Execution Steps:

1.Shutdown Oracle ERP Applications(adstpall.sh) Source(ERP APPLICATIONS)
Command prompt Run As Administrator: Source Env file APPSERP.env
cd $ADMIN_SCRIPTS_HOME
./adstpall.sh

2.Check firewall and connectivity from DB to Apps Tier and verify the port is open using telnet on Target(ERP APPLICATIONS)

telnet hostname port
telnet testhost 1521
connected means it is working fine, if it says trying add the firewall rules and allow port and try again.

3.Copy Apps Files from Source to target Target Server (Initiate copy From Target Server)

4.Modify PATH Environment variable to execute perl K:\oracle\apps\tech_st\10.1.3\perl\5.8.3\bin\MSWin32-x86-multi-thread; => In First line and remove rest of the variables if exists.
5.Change compatibility to Windows Server 2003 SP1 in K:\oracle\apps\tech_st\10.1.2\oui\bin for setup.exe 

6.Change compatibility to Windows Server 2003 SP1 in K:\oracle\apps\tech_st\10.1.3\oui\bin for setup.exe
7.Make sure INST_TOP is renamed on new Target(ERP APPLICATIONS)

(Run as Administrator on new command prompt).
cd K:\oracle\apps\apps_st\comn\clone\bin
 Execute  perl adcfgclone.pl appsTier
8.Verify logs of adcfgclone and confirm no errors exists.
adcfgclone logs Applications tier:

$COMMON_TOP/clone/bin/CloneContext_<timestamp>.log
This log shows the entries selected during execution of adcfgclone command
9.Execute autoconfig on Apps Tier and copy env file APPSERP_testhost.cmd from backup to APPL_TOP

cd $ADMIN_SCRIPTS_HOME
./adautocfg.sh

10.Replace ADMIN Directory(K:\oracle\inst\apps\ERP APPLICATIONS_testhost\ora\10.1.2\network) with admin_bkp and Reboot the Target(ERP APPLICATIONS)
11.Compare Services properties in old and new server and set accordingly. Restart the new Target (ERP APPLICATIONS) Application server

12.Compare Firewall rules in old and New  PROD Apps servers and copy accordingly and Validate with telnet

13.Execute cmclean(K:\oracle)
14.Start the Applications (adstral.sh) Target (ERP APPLICATIONS)

cd $ADMIN_SCRIPTS_HOME
./adstral.sh

Post Execution and Sanity Checks:
1.Configure Oracle Workflow inbound and outbound server settings and validate workflow mailer is up and running and test mailer
2.Complete Sanity checks for Database ,Applications, Concurrent Programs ,SSO and Workflow Mailer

Enjoy Apps DBA Tasks...


Thanks,


Rafi

Sunday, September 2, 2018

Completed Oracle Access Manager Implementation Specialist Certification.

Dear All,

By the grace of Allah I have completed Oracle Access Manager Implementation Specialist Certification.




It feels great to do certification on one of the Product which you work more and practice lot . After doing lot of hard work and with lot of enthusiasm I'm happy to achieve it.

Efforts required to do this certification:

1) Read the concepts and implementation docs from Oracle Documentation, Blogs, Youtube , linkedin and from all places on the internet about Oracle Access Manager

2) The challenging part about this certification is we need to study about lot of products like ( Oracle Access Manager,Oracle Adaptive Access Manager, Oracle Entitlements Server, Oracle Identity Federation, Mobile and Social ) to name few if you are planning to prepare for this certification and pass it.

Thanks,

Rafi

Monday, August 20, 2018

Step by Step Oracle Applications and Database Cloning for Oracle EBS 12.2 Environment

Hi All,

Cloning of Oracle ERP Database and Applications for Oracle EBS 12.2 ( 12.2.x) can be done in several ways. Below I have described one such scenario.  Based on the backup policy and customization you have for your Oracle EBS Environment steps might vary . Here I just documented based on my experiences.


Source :ERP122_Source

DB node:source_db_host
App node:source_apps_host

Target :erp1226

DB node:target_db_host
App node:target_apps_host


Step 1: Running Pre-clone on the Source Apps Tier(ERP122_Source)

To prepare the source environment for cloning we need to run adpreclone.pl script.

cd $ADMIN_SCRIPTS_HOME

perl adpreclone.pl appsTier

apps:welcome1
weblogic:welcome1


Log file located at /erpapp/ERP122_Source/upgrade/fs1/inst/apps/ERP122_Source_uat-

cm2/admin/log/clone/StageAppsTier_02041740.log

  \     20% completed

Completed Stage...

END: Calling StagefmwTechStack...


#############################################################

END: StageAppsTier Finished at Thu Feb 04 18:14:16 GST 2018
Status: Completed Successfully
#############################################################


Step 2: Running Pre-Clone on the Source DB Tier

To prepare the source environment for cloning we need to run adpreclone.pl script.

cd /u01/ERP122_Source/db/dbhome_1/appsutil/scripts/ERP122_Source_host

perl adpreclone.pl dbTier


Log file located at /u01/ERP122_Source/db/dbhome_1/appsutil/log/ERP122_Source_host/StageDBTier_02041853.log

  /     50% completed

Completed Stage...
Thu Feb  4 18:55:58 2018

Step 3: Copying Application Tier from Source to Target

WHAT NEEDS TO BE COPIED
----------------------------
Choose only RUN FILE SYSTEM for copying

Copy EBSapps directory from source(ERP122_Source) to target(erp1226) (no need to copy FMW_Home and inst Directories)


a) EBSapps =>COPY

On Source(ERP122_Source): Take tar backup of EBSapps

cd /erpapp/ERP122_Source/upgrade/fs1
tar -cvf /u04/ERP122_Source/apps/EBSapps.tar

b) FMW_HOME =>DON'T COPY
c) inst =>DON'T COPY

Prepare Target:(erp1226 : 12.2.5)
=========================================

cd /erpapp/
applmgr@orace_erp_host:~$ mkdir erp1226

mkdir -p /erpapp/erp1226/fs1/
mkdir -p /erpapp/erp1226/fs2/
mkdir -p /erpapp/erp1226/fs_ne/

Step 4:Copy the Oracle Home from source(ERP122_Source) to target(erp1226):

Step a:Create Required directory structures on target with 'oracle' ownership and permissions

root@host:~# mkdir -p /u01/erp1226/db
chown -R oracle:oinstall /u01/erp1226/db


Step b: Take tar backup on ERP122_Source(Source Environment)

cd /u01/ERP122_Source/db
 tar -cvf /u04/ERP122_Source/db/dbhome_1.tar dbhome_1 &

drwxr-xr-x  82 oracle   oinstall      87 Jan 18 10:32 dbhome_1
-rw-r--r--   1 oracle   oinstall 3711308097 Jan 18 17:36 dbhome_1.tar.gz

Step 5:On Target: Extract and give required permissions.


APPS:
======
cd /erpapp/erp1226/fs1
tar -xvf /u04/ERP122_Source/apps/EBSapps.tar

DB:
====
cd /u01/erp1226/db
tar -xvf /u04/ERP122_Source/db/dbhome_1.tar

After extracting DB home please give the required permisssion VVIMP

root@host:~# cd /u01/erp1226/db/dbhome_1/bin
root@host:/u01/erp1226/db/dbhome_1/bin# chmod 6751 oracle
root@host:/u01/erp1226/db/dbhome_1/bin# ls -l oracle
-rwsr-s--x   1 oracle   oinstall 258934216 Jan 31 12:51 oracle
root@host:/u01/erp1226/db/dbhome_1/bin#


$ perl adcfgclone.pl dbTechStack

first source perl
--------------------

export

PERL5LIB=/u01/erp1226/db/dbhome_1/perl/lib/5.10.0:/u01/erp1226/db/dbhome_1/perl/lib/site_perl/5.10.0:/u01/erp1226/db/dbhom

e_1/appsutil/perl
export

PATH=/u01/erp1226/db/dbhome_1/perl/bin:/u01/erp1226/db/dbhome_1/perl/bin:/u01/erp1226/db/dbhome_1/bin:/usr/ccs/bin:/usr/sb

in:/u01/erp1226/db/dbhome_1/jdk/jre/bin:/usr/bin:/bin:.:.
export ADPERLPRG=/u01/erp1226/db/dbhome_1/perl/bin/perl


support id: 458653.1 OUICLI.PL Fail while running adcfgclone
-------------------------------------------------------------

Note:Take oraInst.loc backup

I created oraInventory directory in $ORACLE_HOME and updated new location in oraInst.loc and the issue resolved.

-bash-4.1$ cd $ORACLE_HOME
-bash-4.1$ pwd
/u01/erp1226/db/dbhome_1
-bash-4.1$ mkdir oraInventory
-bash-4.1$ cd oraInventory
-bash-4.1$ pwd
/u01/erp1226/db/dbhome_1/oraInventory

-bash-4.1$ mv oraInst.loc oraInst.loc.org (backup oraInst.loc.org)

-bash-4.1$ vi oraInst.loc
-bash-4.1$ cat $ORACLE_HOME/oraInst.loc
inventory_loc=/u01/erp1226/db/dbhome_1/oraInventory
inst_group=oinstall


Step 6: Execute adcfgclone with tech_st for configuring Technology stack on Target DB Tier

/u01/erp1226/db/dbhome_1/appsutil/clone/bin

export

PERL5LIB=/u01/erp1226/db/dbhome_1/perl/lib/5.10.0:/u01/erp1226/db/dbhome_1/perl/lib/site_perl/5.10.0:/u01/erp1226/db/dbhom

e_1/appsutil/perl

perl adcfgclone.pl dbTechStack


practical
=============
(Eg:export

PERL5LIB=/u01/erp1223/db/dbhome_1/perl/lib/5.10.0:/u01/erp1223/db/dbhome_1/perl/lib/site_perl/5.10.0:/u01/erp1223/db/dbhom

e_1/appsutil/perl)

On Target set the perl path:

export

PERL5LIB=/u01/erp1226/db/dbhome_1/perl/lib/5.10.0:/u01/erp1226/db/dbhome_1/perl/lib/site_perl/5.10.0:/u01/erp1226/db/dbhom

e_1/appsutil/perl

-bash-4.1$ perl adcfgclone.pl dbTechStack

                     Copyright (c) 2002, 2015 Oracle Corporation
                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adcfgclone Version 120.63.12020000.56

Enter the APPS password :

Running: Context clone...

Log file located at /u01/erp1226/db/dbhome_1/appsutil/clone/bin/CloneContext_0204213607.log

Provide the values required for creation of the new Database Context file.

Target System Hostname (virtual or normal) [host] :

Target Instance is RAC (y/n) [n] : n

Target System Database SID : erp1226

Target System Base Directory : /u01/erp1226/

Target System utl_file_dir Directory List : /usr/tmp

Number of DATA_TOP's on the Target System [3] : 1

Target System DATA_TOP Directory 1 : /u04/erp1226

Target System RDBMS ORACLE_HOME Directory [/u01/erp1226/db/11.2.0] : /u01/erp1226/db/dbhome_1

Do you want to preserve the Display [host:0.0] (y/n)  : y

Target System Port Pool [0-99] : 20

Checking the port pool 6
done: Port Pool 6 is free
Report file located at /u01/erp1226/db/dbhome_1/appsutil/temp/portpool.lst
The new database context file has been created :
  /u01/erp1226/db/dbhome_1/appsutil/erp1226_host.xml
Check Clone Context logfile /u01/erp1226/db/dbhome_1/appsutil/clone/bin/CloneContext_0204213607.log for details.

Running Rapid Clone with command:

Running:
perl /u01/erp1226/db/dbhome_1/appsutil/clone/bin/adclone.pl java=/u01/erp1226/db/dbhome_1/appsutil/clone/bin/../jre

mode=apply stage=/u01/erp1226/db/dbhome_1/appsutil/clone component=dbTechStack method=CUSTOM

dbctxtg=/u01/erp1226/db/dbhome_1/appsutil/erp1226_host.xml showProgress contextValidated=true


Beginning rdbms home Apply - Thu Feb  4 21:40:11 2018

/u01/erp1226/db/dbhome_1/appsutil/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true -

Doracle.installer.oui_loc=/u01/erp1226/db/dbhome_1/oui -classpath

/u01/erp1226/db/dbhome_1/appsutil/clone/jlib/xmlparserv2.jar:/u01/erp1226/db/dbhome_1/appsutil/clone/jlib/ojdbc6.jar:/u01/

erp1226/db/dbhome_1/appsutil/clone/jlib/java:/u01/erp1226/db/dbhome_1/appsutil/clone/jlib/oui/OraInstaller.jar:/u01/erp122

6/db/dbhome_1/appsutil/clone/jlib/oui/ewt3.jar:/u01/erp1226/db/dbhome_1/appsutil/clone/jlib/oui/share.jar:/u01/erp1226/db/

dbhome_1/appsutil/clone/jlib/oui/srvm.jar:/u01/erp1226/db/dbhome_1/appsutil/clone/jlib/ojmisc.jar 

oracle.apps.ad.clone.ApplyDBTechStack -e /u01/erp1226/db/dbhome_1/appsutil/erp1226_host.xml -stage

/u01/erp1226/db/dbhome_1/appsutil/clone   -showProgress
APPS Password : Log file located at /u01/erp1226/db/dbhome_1/appsutil/log/erp1226_host/ApplyDBTechStack_02042140.log
  |      0% completed


Cloning of Database:
===========================
We can use various techniques for cloning depending on the backup policy and availability of Database.
Here I have discussed few approaches. Please follow your own approach depending on backup you have.

Step 7 a:Backup Database:(ERP122_Source)
===========================

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;
allocate channel ch5 device type disk;
allocate channel ch6 device type disk;
backup as copy database format '/u04/ERP122_Source/db/data/%b';
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
release channel ch6;
}



Note:For inventory issue:ETCC issue:
====
Download the patch 17537119 and Apply

Step 1:
-bash-4.1$ . erp1226_host.env
-bash-4.1$ cd /u01/erp1226/db/dbhome_1/appsutil/
-bash-4.1$ mkdir etcc
-bash-4.1$ cd etcc/
-bash-4.1$ pwd
/u01/erp1226/db/dbhome_1/appsutil/etcc


Step 2:
cd /export/home/oracle/DBA/1225_Patches/

mkdir 17537119

unzip p17537119.zip

-bash-4.1$ ls -ltr
total 1923
-rwxrwxrwx   1 oracle   oinstall   37060 Feb  1 15:53 checkDBpatch.sh
-rwxrwxrwx   1 oracle   oinstall   34675 Feb  1 15:56 txk_R1220_MT_base_bugs.xml
-rwxrwxrwx   1 oracle   oinstall  275560 Feb  1 16:21 txk_R1220_DB_mappings.xml
-rwxrwxrwx   1 oracle   oinstall  228911 Feb  1 16:31 txk_R1220_MT_mappings.xml
-rwxrwxrwx   1 oracle   oinstall   45408 Feb  1 17:04 checkMTpatch.cmd
-rwxrwxrwx   1 oracle   oinstall   41856 Feb  1 17:28 checkMTpatch.sh
-rwxrwxrwx   1 oracle   oinstall   25103 Feb  1 19:14 txk_R1220_DB_base_bugs.xml
-rw-r--r--   1 oracle   oinstall   23546 Feb  1 19:39 README.txt
-rwxrwxrwx   1 oracle   oinstall   40266 Feb  2 13:08 checkDBpatch.cmd
-rw-r--r--   1 oracle   oinstall   70609 Feb  5 13:28 p17537119_R12_GENERIC.zip
-bash-4.1$ pwd
/export/home/oracle/DBA/1225_Patches/17537119


Step 3:

-bash-4.1$ cp *.* /u01/erp1226/db/dbhome_1/appsutil/etcc
-bash-4.1$ cd /u01/erp1226/db/dbhome_1/appsutil/etcc
-bash-4.1$


step 4:Execute checkdbpatch.sh

-bash-4.1$ ./checkDBpatch.sh

 +===============================================================+
 |    Copyright (c) 2005, 2018 Oracle and/or its affiliates.     |
 |                     All rights reserved.                      |
 |             Oracle E-Business Suite Release 12.2              |
 |          Database EBS Technology Codelevel Checker            |
 +===============================================================+

Using context file from currently set database environment:
/u01/erp1226/db/dbhome_1/appsutil/erp1226_host.xml

Starting Database EBS Technology Codelevel Checker, Version 120.31
Fri Feb  5 15:40:05 GST 2018
Log file for this session : ./checkDBpatch_25691.log

Bugfix XML file version: 120.0.12020000.28
This file will be used for identifying missing bugfixes.

Mapping XML file version: 120.0.12020000.1
This file will be used for mapping bugfixes to patches.

Identifying database release.
Database release set to 11.2.0.4.

Connecting to database.



on 170 DB node:
==========

Verify the backup location :(/u04/ERP122_Source/db/data)

/u04/ERP122_Source/db/onlinelog

mkdir -p /u04/ERP122_Source/db/onlinelog

-bash-4.1$ cp initERP122_Source.ora initERP122_Source.ora
-bash-4.1$ ps -ef|grep smno
  oracle  5639 20586   0 15:57:39 pts/8       0:00 grep smno
-bash-4.1$ ps -ef|grep smon
  oracle 16818 16642   0   Jan 06 ?           2:27 ora_smon_obieedb
    grid 17823  5568   0   Jan 06 ?           1:22 asm_smon_+ASM
  oracle 16301 17091   0   Feb 03 ?           4:54 ora_smon_erp1223
  oracle  5759 20586   0 15:57:42 pts/8       0:00 grep smon
  oracle 13428 13320   0   Feb 03 ?           6:09 ora_smon_erp1224
-bash-4.1$ pwd
/u01/erp1226/db/dbhome_1/dbs
-bash-4.1$ export ORACLE_SID=ERP122_Source

-bash-4.1$ du -sh .
 2.1T   .


Note: IN SOURCE ENV:
===================

-bash-4.1$ . ERP122_Source_host.env

-bash-4.1$ pwd
/export/home/oracle
-bash-4.1$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Feb 5 16:39:55 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 2.6732E+10 bytes
Fixed Size                  2194184 bytes
Variable Size            5570036984 bytes
Database Buffers         2.0804E+10 bytes
Redo Buffers              355704832 bytes
Database mounted.
Database opened.
SQL> select name from v$database;

NAME
---------
ERP122_Source

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

once copy archives and than shut down ERP122_Source(source)

SQL> shut immediate


create archivelog destination and copy archives

mkdir -p /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05

Login as 'grid' os user and do below:

chmod -R 777 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05

Eg:
===

cp thread_1_seq_1425.13277.902885815 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1426.13275.902889561 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1427.13273.902892401 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1428.13267.902894711 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1429.13265.902894727 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1430.13263.902894743 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1431.13261.902894755 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05



SQL> startup nomount pfile='/u01/erp1226/db/dbhome_1/dbs/initERP122_Source.ora'
ORACLE instance started.

Total System Global Area 2.6732E+10 bytes
Fixed Size                  2194184 bytes
Variable Size            3221226744 bytes
Database Buffers         2.3153E+10 bytes
Redo Buffers              355704832 bytes
SQL> show parameter db_recover%

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
db_recovery_file_dest                string
/u04/ERP122_Source/db/data/erp122
5/archivelog
db_recovery_file_dest_size           big integer
2000G
SQL> alter database mount;

Database altered.

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u04/ERP122_Source/db/data/contro
                                                 l1.dbf, /u04/ERP122_Source/db/dat
                                                 a/control2.dbf
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
-bash-4.1$ echo $ORACLE_SID
ERP122_Source
-bash-4.1$ rman target /


RMAN> recover database;

Starting recover at 05-FEB-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5429 device type=DISK

starting media recovery

RMAN-08187: WARNING: media recovery until scN 9814470450787 complete
Finished recover at 05-FEB-16



SQL> recover database using backup controlfile;
ORA-00279: change 9814470450787 generated at 02/04/2018 21:30:22 needed for
thread 1
ORA-00289: suggestion :
/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/o1_mf_1
_1559_%u_.arc
ORA-00280: change 9814470450787 for thread 1 is in sequence #1559


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}






NAME
---------
ERP122_Source

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u04/ERP122_Source/db/data/contro
                                                 l1.dbf, /u04/ERP122_Source/db/dat
                                                 a/control2.dbf
SQL> select status from v$instance;

STATUS
------------
MOUNTED

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
-bash-4.1$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Feb 5 17:49:55 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ERP122_Source (DBID=3882746714, not open)

RMAN> recover database;

Starting recover at 05-FEB-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5429 device type=DISK

starting media recovery

archived log for thread 1 with sequence 1559 is already on disk as file

/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1559.12972.903026451
archived log for thread 1 with sequence 1560 is already on disk as file

/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1560.12971.903026455
archived log file

name=/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1559.12972.90302

6451 thread=1 sequence=1559
archived log file

name=/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1560.12971.90302

6455 thread=1 sequence=1560
RMAN-08187: WARNING: media recovery until scN 9814470462883 complete
archived log file

name=/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1560.12971.90302

6455 thread=1 sequence=1561
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/05/2018 17:50:35
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile

'/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1560.12971.903026455

'
ORA-00283: recovery session canceled due to errors
ORA-01112: media recovery not started
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 1561 and starting scN of

9814470462883

RMAN> exit


Recovery Manager complete.
-bash-4.1$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Feb 5 17:50:56 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name from v$database;

NAME
---------
ERP122_Source

SQL> select status from v$instance;

STATUS
------------
MOUNTED

SQL> alter database open resetlogs;

Database altered.



-bash-4.1$ cd /u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05
-bash-4.1$ ls -l *1559*
*1559*: No such file or directory
-bash-4.1$ pwd
/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05
-bash-4.1$ ls -ltr
total 0
-bash-4.1$ pwd
/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05
-bash-4.1$ cd /u04/ERP122_Source/db/data/ERP122_Source/archivelog
-bash-4.1$ ls



Original defined:
================

/u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05

As per recommendation:

/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05



NOW bring up the database as erp1226:
------------------------------------

alter database backup controlfile to trace as '/export/home/oracle/CLONE_erp1226/trace_cont_05Feb2018_u04_up_trc';

shut immediate the ERP122_Source database which is running already.

shut immediate

SQL> select name from v$database;

NAME
---------
ERP122_Source

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> show parameter %CONTROL%

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      /u04/rman/01Jan2015/cnt1.db
                                                 f, /u04/rman/01Jan2015/cnt2
                                                 .dbf, /u04/rman/01Jan2015/c
                                                 nt3.dbf
control_management_pack_access       string      DIAGNOSTIC+TUNING
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u04/rman/01Jan2015/system.272.845039815


export ORACLE_SID=erp1226

-bash-4.1$ mv initerp1226.ora initerp1226.ora_orig
-bash-4.1$ cp initERP122_Source.ora initerp1226.ora
-bash-4.1$ vi initerp1226.ora
-bash-4.1$ grep -i control_files initerp1226.ora
*.control_files='/u04/ERP122_Source/db/data/control1_erp1226.dbf','/u04/ERP122_Source/db/data/control2_erp1226.dbf'
-bash-4.1$ grep -i db_name initerp1226.ora
*.db_name='erp1226'
-bash-4.1$



b. Rename trace file to ctrl.sql
vi ctrl.sql
Change “REUSE” to “SET”
Change “ERP122_Source” to “erp1226”
Change “noresetlogs” to “resetlogs”
Change “archivelog” to “noarchivelog”

after rename cont_01Jan2015_u04_dev.sql

c. cp initERP122_Source.ora initerp1226.ora

VVIMP

Change db_name=erp1226 in initerp1226.ora
change the controlfile names in initerp1226.ora

racle@erp3client01:/u01/app/oracle/product/11.2.0/dbhome_1/dbs$ grep -i control_file initerp1226.ora
*.control_files='/u04/rman/01Jan2015/cnt_d1.dbf','/u04/rman/01Jan2015/cnt_d2.dbf','/u04/rman/01Jan2015/cnt_d3.dbf'

oracle@erp3client01:/u01/app/oracle/product/11.2.0/dbhome_1/dbs$ grep -i db_name initerp1226.ora
*.db_name='erp1226'


d. export ORACLE_SID=erp1226

(Eg controlfile erp1226
CREATE CONTROLFILE SET DATABASE "erp1226" RESETLOGS FORCE LOGGING NOARCHIVELOG
    MAXLOGFILES 32
    MAXLOGMEMBERS 5
    MAXDATAFILES 512
    MAXINSTANCES 8
    MAXLOGHISTORY 20157
LOGFILE
)


SQL> startup nomount pfile='/u01/erp1226/db/dbhome_1/dbs/initerp1226.ora'
ORACLE instance started.

Total System Global Area 2.6732E+10 bytes
Fixed Size                  2194184 bytes
Variable Size            3221226744 bytes
Database Buffers         2.3153E+10 bytes
Redo Buffers              355704832 bytes
SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/u04/ERP122_Source/db/data/contro
l1_erp1226.dbf, /u04/erp122
5/db/data/control2_erp1226.dbf



SQL> startup nomount pfile='/u01/erp1226/db/dbhome_1/dbs/initerp1226.ora'
ORACLE instance started.

Total System Global Area 2.6732E+10 bytes
Fixed Size                  2194184 bytes
Variable Size            3221226744 bytes
Database Buffers         2.3153E+10 bytes
Redo Buffers              355704832 bytes
SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/u04/ERP122_Source/db/data/contro
l1_erp1226.dbf, /u04/erp122
5/db/data/control2_erp1226.dbf
SQL> !pwd
/export/home/oracle/CLONE_erp1226

SQL> @cont_05Feb2018_u04_erp1226.sql

Control file created.

SQL> alter database open resetlogs;

Database altered.

SQL> select name from v$database;

NAME
---------
erp1226

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/u04/ERP122_Source/db/data/contro
l1_erp1226.dbf, /u04/erp122
5/db/data/control2_erp1226.dbf



SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u04/ERP122_Source/db/onlinelog/group_17.9627.902761661
/u04/ERP122_Source/db/onlinelog/group_17.9626.902761663
/u04/ERP122_Source/db/onlinelog/group_16.9629.902761653
/u04/ERP122_Source/db/onlinelog/group_16.9628.902761655
/u04/ERP122_Source/db/onlinelog/group_15.9631.90276164

e. sqlplus "/as sysdba"

startup nomount

SQL> startup nomount
ORACLE instance started.

Total System Global Area 7484866560 bytes
Fixed Size                  2196112 bytes
Variable Size            1627397488 bytes
Database Buffers         5519704064 bytes
Redo Buffers              335568896 bytes
SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/u04/rman/01Jan2015/cnt_dev
1.dbf, /u04/rman/01Jan2015/
cnt_dev2.dbf, /u04/rman/08D
ec2015/cnt_dev3.dbf


SQL> @contr_01Jan2015_u04_DEV.sql

Control file created.




alter database open resetlogs;


SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/u04/rman/erp1226/data/contro
l_d1.dbf, /u04/rman/erp1226/d
ata/control_d2.dbf
SQL> select status from v$instance;

STATUS
------------------------------------
STARTED

SQL> @contr_dev_u04_03Jan2018.sql

Control file created.



SQL> alter database open resetlogs;

Database altered.

SQL> select name from v$database;

NAME
---------
erp1226

SQL> select status from v$instance;

STATUS
------------
OPEN

Once the Database is recovered verify the Datafiles,Redolog files.


SQL> select name from v$database;

NAME
---------
erp1226

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u04/ERP122_Source/db/onlinelog/group_17.9627.902761661
/u04/ERP122_Source/db/onlinelog/group_17.9626.902761663
/u04/ERP122_Source/db/onlinelog/group_16.9629.902761653
/u04/ERP122_Source/db/onlinelog/group_16.9628.902761655
/u04/ERP122_Source/db/onlinelog/group_15.9631.902761641
/u04/ERP122_Source/db/onlinelog/group_15.9630.902761643
/u04/ERP122_Source/db/onlinelog/group_14.9633.902761631
/u04/ERP122_Source/db/onlinelog/group_14.9632.902761631
/u04/ERP122_Source/db/onlinelog/group_13.9635.902761623
/u04/ERP122_Source/db/onlinelog/group_13.9634.902761623
/u04/ERP122_Source/db/onlinelog/group_12.9637.902761701

MEMBER
--------------------------------------------------------------------------------
/u04/ERP122_Source/db/onlinelog/group_12.9636.902761701
/u04/ERP122_Source/db/onlinelog/group_11.9639.902761589
/u04/ERP122_Source/db/onlinelog/group_11.9638.902761591

14 rows selected.



SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u04/ERP122_Source/db/data/system.9939.902760745
/u04/ERP122_Source/db/data/system.10052.902761115
/u04/ERP122_Source/db/data/system.9931.902761091
/u04/ERP122_Source/db/data/system.10016.902761093
/u04/ERP122_Source/db/data/system.10050.902761123
/u04/ERP122_Source/db/data/system.10007.902761093
/u04/ERP122_Source/db/data/system.10048.902761123
/u04/ERP122_Source/db/data/system.10040.902761139
/u04/ERP122_Source/db/data/system.10049.902761107
/u04/ERP122_Source/db/data/system.9998.902761021
/u04/ERP122_Source/db/data/system.10042.902761123



Create temporary tablespace and make it default.


Once the Database is recovered verify the Datafiles,Redolog files.

select member from v$logfile;
select name from v$datafile;


SQL> select * from v$tempfile;

no rows selected

SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY';

TABLESPACE_NAME
------------------------------
TEMP11
TEMP8


create temporary tablespace and make it default.


select  name from v$datafile;
create temporary tablespace temp12 tempfile '/u04/ERP122_Source/db/data/temp12_01.dbf' size 20g;
alter database default temporary tablespace temp12;

drop tablespace temp11 including contents and datafiles;
drop tablespace temp8 including contents and datafiles;

SQL> select PROPERTY_NAME,PROPERTY_VALUE from database_properties where property_name like '%DEFAULT%';

PROPERTY_NAME
------------------------------
PROPERTY_VALUE
--------------------------------------------------------------------------------
DEFAULT_TEMP_TABLESPACE
TEMP12


CREATE SPFILE:
===============

create spfile from pfile;

SQL> create spfile from pfile;


File created.

shut immediate

Migrate Database from Filesystem to ASM location:
====================================================

Startup with SPFILE

shut immediate
startup

SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/erp1226/db/dbhome_1/dbs/s
                                                 pfileerp1226.ora


Migrate to ASM:
==================

ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks

Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576  25165824  6296220            65536         3115342              0       

   N  DATA/

ASMCMD> cd DATA/
ASMCMD> ls
ASM/
DB_UNKNOWN/
DEVOATS/
erp1223/
erp1224/
ERP122_Source/
UPGUAT1/
spfileerp1224.ora

ASMCMD> pwd
+DATA


ASMCMD> mkdir erp1226
ASMCMD> ls
ASM/
DB_UNKNOWN/
DEVOATS/
erp1223/
erp1224/
ERP122_Source/
erp1226/
UPGUAT1/
spfileerp1224.ora

ASMCMD> cd erp1226/
ASMCMD> pwd
+DATA/erp1226

+DATA/erp1226
ASMCMD> mkdir CONTROLFILE
ASMCMD> ls
CONTROLFILE/


B. Migrate Database from Filesystem to ASM location

Startup with SPFILE
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/erp1226/db/dbhome_1/dbs/s
                                                 pfileerp1226.ora
                             

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u04/ERP122_Source/db/data/contro
                                                 l1_erp1226.dbf, /u04/erp122
                                                 5/db/data/control2_erp1226.dbf


alter system set db_recovery_file_dest='+DATA';
alter system set db_create_file_dest='+DATA';

alter system set control_files='+DATA/erp1226/CONTROLFILE/ctrlerp1226_05Feb2018.dbf' scope=spfile;
SQL> show parameter control_files

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u04/ERP122_Source/db/data/contro
                                                 l1_erp1226.dbf, /u04/erp122
                                                 5/db/data/control2_erp1226.dbf

             
shut immediate
startup nomount

SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
+DATA/erp1226/controlfile/ctrl
erp1226_05feb2018.dbf





(WE HAVE TO DO THIS STEP AFTER DB CLONE)

(optionally workaround step

SQL> alter system set local_listener='erp1226' scope=spfile;

System altered.

SQL> shut immediate
ORA-01507: database not mounted


ORACLE instance shut down.

SQL> startup nomount
ORACLE instance started.

Total System Global Area 2.6732E+10 bytes
Fixed Size                  2194184 bytes
Variable Size            3556771064 bytes
Database Buffers         2.2817E+10 bytes
Redo Buffers              355704832 bytes
SQL> show parameter %LOCAL%

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
local_listener                       string
ERP122_Source
log_archive_local_first              boolean
TRUE
parallel_force_local                 boolean
FALSE


)

SQL> alter system register;

System altered.

-bash-4.1$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       host           STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       host           STABLE
ora.asm


)

Registering listener:
========================

-bash-4.1$ srvctl status listener -l listener
srvctl stop listener -l listener

srvctl modify listener -l listener -endpoints 1521,1596,1548,1561,1701
srvctl start listener -l listener

-bash-4.1$ srvctl status listener -l listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): host



Restore controlfile using RMAN from backup location taken earlier.


rman target /


RMAN> restore controlfile from '/u04/ERP122_Source/db/data/control1_erp1226.dbf';

-bash-4.1$ echo $ORACLE_SID
erp1226
-bash-4.1$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Feb 5 19:17:54 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: erp1226 (not mounted)

RMAN> restore controlfile from '/u04/ERP122_Source/db/data/control1_erp1226.dbf';

Starting restore at 05-FEB-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6373 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=+DATA/erp1226/controlfile/ctrlerp1226_05feb2018.dbf
Finished restore at 05-FEB-16



RMAN> alter database mount;

ASMCMD> cd CONTROLFILE/
ASMCMD> ls -l
Type         Redund  Striped  Time             Sys  Name
CONTROLFILE  HIGH    FINE     FEB 05 19:00:00  N    ctrlerp1226_05feb2018.dbf =>

+DATA/erp1226/CONTROLFILE/current.3903.903035901
CONTROLFILE  HIGH    FINE     FEB 05 19:00:00  Y    current.3903.903035901
ASMCMD> pwd
+DATA/erp1226/CONTROLFILE



Note:Eg: Test with 1 datafile:
======

RMAN> backup as copy datafile 1 format '+DATA';

Starting backup at 05-FEB-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6137 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u04/ERP122_Source/db/data/system.9939.902760745
output file name=+DATA/erp1226/datafile/system.10315.903036027 tag=TAG20180205T192025 RECID=1 STAMP=903036055
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=+DATA/erp1226/controlfile/backup.10316.903036061 tag=TAG20180205T192025 RECID=2 STAMP=903036062
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 05-FEB-16
channel ORA_DISK_1: finished piece 1 at 05-FEB-16
piece handle=+DATA/erp1226/backupset/2018_02_05/nnsnf0_tag20180205t192025_0.10317.903036063 tag=TAG20180205T192025

comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-FEB-16



verify:
=========

DATAFILE/
ASMCMD> cd DATAFILE/
ASMCMD> ls -l
Type      Redund  Striped  Time             Sys  Name
DATAFILE  MIRROR  COARSE   FEB 05 19:00:00  Y    SYSTEM.10315.903036027
ASMCMD> pwd
+DATA/erp1226/DATAFILE

Remove the file tested:
========================

ASMCMD> pwd
+DATA/erp1226/DATAFILE
ASMCMD> ls -ltr
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type      Redund  Striped  Time             Sys  Name
DATAFILE  MIRROR  COARSE   FEB 05 19:00:00  Y    SYSTEM.10315.903036027
ASMCMD> rm SYSTEM.10315.903036027
ASMCMD> pwd
+DATA/erp1226/DATAFILE
ASMCMD> cd ..
ASMCMD> pwd
+DATA/erp1226
ASMCMD> ls
BACKUPSET/
CONTROLFILE/


Now start the Migration of erp1226 Db from filesystem to ASM:
================================================================

rman target / log rman_05Feb2018.log trace rman_05Feb2018.trc debug
set echo on;
debug on;

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;
allocate channel ch5 device type disk;
allocate channel ch6 device type disk;
allocate channel ch7 device type disk;
backup as copy database format  '+DATA';
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
release channel ch6;
release channel ch7;
}


RMAN> exit

rman target /


RMAN> switch database to copy;



RMAN> alter database open;

Create the temporary tablespace and make it default

create temporary tablespace temp14 tempfile '+DATA03' size 30g;
alter database default temporary tablespace temp14;

drop tablespace temp12 including contents and datafiles;

set lines 200
col member for a60
select member,group# from v$logfile;
select group#,status from v$log;

Drop the unused groups and Drop the Thread2 groups

select group#,thread#,status from v$log;
alter system switch logfile;
alter database drop logfile group 12;


select group#,thread#,status from v$log;
alter database disable thread 2;
alter database drop logfile group 13;
alter database drop logfile group 14;


Verify and add groups:
select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         1          1 ACTIVE
         2          1 CURRENT
         3          1 UNUSED

alter database add logfile group 1 size 500m;
alter database add logfile group 6 size 500m;
alter database add logfile group 13 size 500m;
alter system switch logfile;

Drop the inactive group

SQL> select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         1          1 INACTIVE
         2          1 ACTIVE
         3          1 CURRENT
         4          1 UNUSED
         5          1 UNUSED
         6          1 UNUSED

6 rows selected.

 alter database drop logfile group 1;
alter system switch logfile;


Verify 3 Redo logs Groups exists.

SQL> select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         2          1 ACTIVE
         3          1 ACTIVE
         4          1 CURRENT
         5          1 UNUSED
         6          1 UNUSED


alter database open

Check the status of Redolog files and make sure all are active

select group#,thread#,status from v$log;
SQL> select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         2          1 INACTIVE
         3          1 INACTIVE
         4          1 CURRENT
         5          1 UNUSED
         6          1 UNUSED

SQL> alter database drop logfile group 2;

Database altered.

SQL> alter database drop logfile group 3;

Database altered.

SQL> select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         4          1 CURRENT
         5          1 UNUSED
         6          1 UNUSED

SQL> alter system switch logfile;

System altered.

SQL> select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         4          1 ACTIVE
         5          1 CURRENT
         6          1 UNUSED

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
+DATA/erp1226/onlinelog/group_6.12953.903043737
+DATA/erp1226/onlinelog/group_6.12952.903043739
+DATA/erp1226/onlinelog/group_7.12951.903043757
+DATA/erp1226/onlinelog/group_7.12950.903043757
+DATA/erp1226/onlinelog/group_8.12949.903043759
+DATA/erp1226/onlinelog/group_8.12948.903043761
+DATA/erp1226/onlinelog/group_9.12947.903043763
+DATA/erp1226/onlinelog/group_9.12946.903043765
+DATA/erp1226/onlinelog/group_10.12945.903043767
+DATA/erp1226/onlinelog/group_10.12944.903043769
+DATA/erp1226/onlinelog/group_1.12963.903043559

MEMBER
--------------------------------------------------------------------------------
+DATA/erp1226/onlinelog/group_1.12962.903043561
+DATA/erp1226/onlinelog/group_2.12961.903043579
+DATA/erp1226/onlinelog/group_2.12960.903043581
+DATA/erp1226/onlinelog/group_3.12959.903043583
+DATA/erp1226/onlinelog/group_3.12958.903043583
+DATA/erp1226/onlinelog/group_4.12957.903043587
+DATA/erp1226/onlinelog/group_4.12956.903043589
+DATA/erp1226/onlinelog/group_5.12955.903043591
+DATA/erp1226/onlinelog/group_5.12954.903043593

20 rows selected.

select group#,status from v$log;

This completes the database restore and recovery.

Step 7 b:Post Clone Steps on Database node

Now the Database is up. We need to Source the Environment and complete the post clone steps.


a.Execute FND_CONC_CLEAN to cleanup nodes entries of source Database.( as 'apps' user)
                           exec fnd_conc_clone.setup_clean;

b.Run Autoconfig
$ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME
./adautocfg.sh


-bash-4.1$ ./adautocfg.sh
Enter the APPS user password:
The log file for this session is located at: /u01/erp1226/db/dbhome_1/appsutil/log/erp1226_host/02052136/adconfig.log

AutoConfig is configuring the Database environment...

AutoConfig will consider the custom templates if present.
        Using ORACLE_HOME location : /u01/erp1226/db/dbhome_1
        Classpath                   :

:/u01/erp1226/db/dbhome_1/jdbc/lib/ojdbc6.jar:/u01/erp1226/db/dbhome_1/appsutil/java/xmlparserv2.jar:/u01/erp1226/db/dbhom

e_1/appsutil/java:/u01/erp1226/db/dbhome_1/jlib/netcfg.jar:/u01/erp1226/db/dbhome_1/jlib/ldapjclnt11.jar

        Using Context file          : /u01/erp1226/db/dbhome_1/appsutil/erp1226_host.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 db112
Updating rdbms type in Context file to 64 bits
Configuring templates from ORACLE_HOME ...

AutoConfig completed successfully.



c.Execute post clone script on Database for Data Masking


--VIMP check fnd_nodes uat-cm2
--Change the node name
update fnd_concurrent_queues set node_name='orace_erp_host' WHERE node_name in 'uat-CM2';
commit;

UPDATE XXerp_MISSN_CAPABILITY_DTLS set MISSION_CAP_STATUS_CODE = '1234';
commit;

--For Faster adcfgclone Execution
Execute package body APPS.WF_CLONE .


This completes the Database Cloning


(Note :Before starting application run cmclean.sql and than start applications )

Before starting Application cloning, modify FND Template as below for faster application tier cloning:
cd $FND_TOP/admin/driver/
vi fndtmpl.drv
txkWfClone.sh INSTE8_SETUP to txkWfClone.sh INSTALL_SETUP


Step 8: APPS CLONING:(erp1226 :12.2.5)
=======
Log on to the Run Edition File System in the Target System as the applmgr user and enter the following commands:
$ cd <COMMON_TOP>/clone/bin


cd /erpapp/erp1226/fs1/EBSapps/comn/clone/bin
total 561
-rwxr-xr-x   1 applmgr  dba         5101 Feb  2 15:22 adchkutl.sh
-rwxr-xr-x   1 applmgr  dba        95774 Feb  4 17:44 adclone.pl
-rwxr-xr-x   1 applmgr  dba        47194 Feb  4 17:44 adclonectx.pl
-rwxr-xr-x   1 applmgr  dba       125060 Feb  4 17:44 adcfgclone.pl
-rwxr-xr-x   1 applmgr  dba        10050 Feb  4 17:44 adaddnode.pl
applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ pwd

*******NOTE BELOW STEP of adcfgclone should be done in VNC SESSION to avoid disconnection of session ***************

$ perl adcfgclone.pl appsTier dualfs

At the prompt:
"Do you want to add a node (yes/no)", enter the value as 'no'.
At the prompt:
"Target System Base Directory", enter the location of the base directory. =>/erpapp/erp1226
Provide:
the new port pools for the Run Edition File System and the Patch Edition File System need to be provided.



When asked the question:
"Do you want to startup the Application Services for <TWO_TASK>? (y/n)" you should answer 'y' if you do not need

to perform any further actions and 'n'  =>choose n

if there are other pending actions which need the Application services to be down.

Different logs are created for Run Edition and Patch Edition Cloning. The log files are created in the following

directories in the Run Edition File System:
<INST_TOP>/admin/log/clone/run
<INST_TOP>/admin/log/clone/patch



applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ pwd
/erpapp/erp1226/fs1/EBSapps/comn/clone/bin
applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ uname -a
SunOS orace_erp_host 5.11 11.1 sun4v sparc sun4v
applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ echo $TWO_TASK

You have new mail in /var/mail/applmgr
applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ ls -ltr
total 561
-rwxr-xr-x   1 applmgr  dba         5101 Feb  2 15:22 adchkutl.sh
-rwxr-xr-x   1 applmgr  dba        95774 Feb  4 17:44 adclone.pl
-rwxr-xr-x   1 applmgr  dba        47194 Feb  4 17:44 adclonectx.pl
-rwxr-xr-x   1 applmgr  dba       125060 Feb  4 17:44 adcfgclone.pl
-rwxr-xr-x   1 applmgr  dba        10050 Feb  4 17:44 adaddnode.pl
applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/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.56

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 /erpapp/erp1226/fs1/EBSapps/comn/clone/bin/CloneContext_0205214743.log

Provide the values required for creation of the new APPL_TOP Context file.

Target System Hostname (virtual or normal) [orace_erp_host] :

Target System Database SID : erp1226

Target System Database Server Node [orace_erp_host] : host

Target System Database Domain Name [erpdom.local] :

Target System Base Directory : /erpapp/erp1226

Target System Base Directory set to /erpapp/erp1226

Target System Current File System Base set to /erpapp/erp1226/fs1

Target System Other File System Base set to /erpapp/erp1226/fs2

Target System Fusion Middleware Home set to /erpapp/erp1226/fs1/FMW_Home
Target System Other File System Fusion Middleware Home set to /erpapp/erp1226/fs2/FMW_Home

Target System Web Oracle Home set to /erpapp/erp1226/fs1/FMW_Home/webtier
Target System Other File System Web Oracle Home set to /erpapp/erp1226/fs2/FMW_Home/webtier

Target System Appl TOP set to /erpapp/erp1226/fs1/EBSapps/appl
Target System Other File System Appl TOP set to /erpapp/erp1226/fs2/EBSapps/appl

Target System COMMON TOP set to /erpapp/erp1226/fs1/EBSapps/comn
Target System Other File System COMMON TOP set to /erpapp/erp1226/fs2/EBSapps/comn

Target System Instance Home Directory [/erpapp/erp1226] :

Target System Base Directory set to /erpapp/erp1226

Target System Current File System Base set to /erpapp/erp1226/fs1

Target System Other File System Base set to /erpapp/erp1226/fs2

Target System Fusion Middleware Home set to /erpapp/erp1226/fs1/FMW_Home
Target System Other File System Fusion Middleware Home set to /erpapp/erp1226/fs2/FMW_Home

Target System Web Oracle Home set to /erpapp/erp1226/fs1/FMW_Home/webtier
Target System Other File System Web Oracle Home set to /erpapp/erp1226/fs2/FMW_Home/webtier

Target System Appl TOP set to /erpapp/erp1226/fs1/EBSapps/appl
Target System Other File System Appl TOP set to /erpapp/erp1226/fs2/EBSapps/appl

Target System COMMON TOP set to /erpapp/erp1226/fs1/EBSapps/comn
Target System Other File System COMMON TOP set to /erpapp/erp1226/fs2/EBSapps/comn

Target System Instance Home Directory [/erpapp/erp1226] :

Target System Current File System Instance Top set to /erpapp/erp1226/fs1/inst/apps/erp1226_orace_erp_host

Do you want to preserve the Display [uat-cm2:0.0] (y/n)  : n

Target System Display [orace_erp_host: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] : 20

Checking the port pool 20
done: Port Pool 20 is free
Report file located at /erpapp/erp1226/fs1/inst/apps/erp1226_orace_erp_host/admin/out/portpool.lst

UTL_FILE_DIR on database tier consists of the following directories.

1. /usr/tmp
2. /usr/tmp
3. /u01/app/oracle/product/11.2.0/dbhome_1/appsutil/outbound/
4. /u04/oradata/utl_dir
Choose a value which will be set as APPLPTMP value on the target node [1] :

Choose a value which will be set as APPLPTMP value on the target node [1] :
The new APPL_TOP context file has been created :
  /erpapp/erp1226/fs1/inst/apps/erp1226_orace_erp_host/appl/admin/erp1226_orace_erp_host.xml
Check Clone Context logfile /erpapp/erp1226/fs1/EBSapps/comn/clone/bin/CloneContext_0205214743.log for details.

Creating Patch file system context file.....

Log file located at /erpapp/erp1226/fs1/EBSapps/comn/clone/bin/CloneContextPatch_0205215144.log

Target System Other File System Instance Top set to /erpapp/erp1226/fs2/inst/apps/erp1226_orace_erp_host

Target System Port Pool [0-99] : 21

Checking the port pool 21
done: Port Pool 21 is free
Report file located at /erpapp/erp1226/fs2/inst/apps/erp1226_orace_erp_host/admin/out/portpool.lst
The new APPL_TOP context file has been created :
  /erpapp/erp1226/fs2/inst/apps/erp1226_orace_erp_host/appl/admin/erp1226_orace_erp_host.xml
Check Clone Context logfile /erpapp/erp1226/fs1/EBSapps/comn/clone/bin/CloneContextPatch_0205215144.log for details.

FMW Pre-requisite check log file location : /erpapp/erp1226/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running: FMW pre-req check...

Configuring: Run file system....
LogFile located at /erpapp/erp1226/fs1/inst/apps/erp1226_erp3-dev-zc1/admin/log/clone/run/RCloneApplyAppstier_02052152.log



Checking the port pool 21
done: Port Pool 21 is free
Report file located at /erpapp/erp1226/fs2/inst/apps/erp1226_orace_erp_host/admin/out/portpool.lst
The new APPL_TOP context file has been created :
  /erpapp/erp1226/fs2/inst/apps/erp1226_orace_erp_host/appl/admin/erp1226_orace_erp_host.xml
Check Clone Context logfile /erpapp/erp1226/fs1/EBSapps/comn/clone/bin/CloneContextPatch_0205215144.log for details.

FMW Pre-requisite check log file location : /erpapp/erp1226/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running: FMW pre-req check...

Configuring: Run file system....
LogFile located at /erpapp/erp1226/fs1/inst/apps/erp1226_erp3-dev-zc1/admin/log/clone/run/RCloneApplyAppstier_02052152.log

Configuring: Patch file system....
LogFile located at /erpapp/erp1226/fs1/inst/apps/erp1226_erp3-dev-

zc1/admin/log/clone/patch/RCloneApplyAppstier_02052237.log

AutoConfig has completed with errors for .patch

Do you want to startup the Application Services for erp1226? (y/n) [n] : n

Services not started


Step 9:Validation steps:
====================

applmgr@orace_erp_host:~/erp1226$ pwd
/erpapp/erp1226
applmgr@orace_erp_host:~/erp1226$ ls -ltr
total 23
drwxr-xr-x   5 applmgr  dba            5 Feb  5 21:55 fs1
drwxr-xr-x   4 applmgr  dba            4 Feb  5 22:19 fs_ne
drwxr-xr-x   5 applmgr  dba            5 Feb  5 23:17 fs2
-rw-r--r--   1 applmgr  dba         6465 Feb  5 23:36 EBSapps.env
applmgr@orace_erp_host:~/erp1226$ . EBSapps.env run

  E-Business Suite Environment Information
  ----------------------------------------
  RUN File System           : /erpapp/erp1226/fs1/EBSapps/appl
  PATCH File System         : /erpapp/erp1226/fs2/EBSapps/appl
  Non-Editioned File System : /erpapp/erp1226/fs_ne


  DB Host: host.erpdom.local  Service/SID: erp1226


  Sourcing the RUN File System ...




applmgr@orace_erp_host:~/erp1226/fs1/inst/apps/erp1226_orace_erp_host/ora/10.1.2/network/admin$ cp tnsnames.ora

tnsnames.ora_05Feb2018bkup
applmgr@orace_erp_host:~/erp1226/fs1/inst/apps/erp1226_orace_erp_host/ora/10.1.2/network/admin$ vi tnsnames.ora
applmgr@orace_erp_host:~/erp1226/fs1/inst/apps/erp1226_orace_erp_host/ora/10.1.2/network/admin$ tnsping erp1226

TNS Ping Utility for Solaris: Version 10.1.0.5.0 - Production on 05-FEB-2018 23:56:33

Copyright (c) 1997, 2003, Oracle.  All rights reserved.

Used parameter files:
/erpapp/erp1226/fs1/inst/apps/erp1226_orace_erp_host/ora/10.1.2/network/admin/sqlnet_ifile.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DEscRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=host.erpdom.local)(PORT=1541)) (CONNECT_DATA=

(SERVICE_NAME=erp1226) (INSTANCE_NAME=erp1226)))
OK (0 msec)
applmgr@orace_erp_host:~/erp1226/fs1/inst/apps/erp1226_orace_erp_host/ora/10.1.2/network/admin$ sqlplus apps

SQL*Plus: Release 10.1.0.5.0 - Production on Fri Feb 5 23:56:44 2018

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select name from v$database;

NAME
---------
erp1226

SQL> select status from v$instance;

STATUS
------------
OPEN




applmgr@orace_erp_host:~$ cd /erpapp/erp1226
applmgr@orace_erp_host:~/erp1226$ pwd
/erpapp/erp1226
applmgr@orace_erp_host:~/erp1226$ ls -ltr
total 23
drwxr-xr-x   5 applmgr  dba            5 Feb  5 21:55 fs1
drwxr-xr-x   4 applmgr  dba            4 Feb  5 22:19 fs_ne
drwxr-xr-x   5 applmgr  dba            5 Feb  5 23:17 fs2
-rw-r--r--   1 applmgr  dba         6465 Feb  5 23:36 EBSapps.env
applmgr@orace_erp_host:~/erp1226$ . EBSapps.env run

  E-Business Suite Environment Information
  ----------------------------------------
  RUN File System           : /erpapp/erp1226/fs1/EBSapps/appl
  PATCH File System         : /erpapp/erp1226/fs2/EBSapps/appl
  Non-Editioned File System : /erpapp/erp1226/fs_ne


  DB Host: host.erpdom.local  Service/SID: erp1226


  Sourcing the RUN File System ...



Step 10: Start the Target Applications after cloning 
======================================

a. Take a backup of context file
b. vi $CONTEXT_FILE
c. Change the load balancing related parameters
d. adstrtal.sh apps/<password>

Step 11:Post Cloning Steps on Application node:
=====================================

a)Change Logo

Upload the below logo to $OA_MEDIA/erp_logo.jpg

/erpapp/apps/apps_st/comn/java/classes/oracle/apps/media
-bash-4.1$ ls -ltr erp_sc.jpg
-rw-r--r--   1 applmgr  dba         6008 Mar 14  2014 erp_logo.jpg
-bash-4.1$ mv erp_logo.jpg erp_logo.jpg_old
-bash-4.1$ cp /erpapp/erp_sc.jpg .
-bash-4.1$ ls -ltr erp_logo.jpg
-rw-r--r--   1 applmgr  dba        16907 Apr 16 12:33 erp_logo.jpg


b)Execute below wfntfqup.sql from apps node:
==============================================

Disable Workflow Notification Mailer. Set the override address from OAM. Purge pending notifications.

sqlplus apps/apps @$FND_TOP/patch/115/sql/wfntfqup.sql apps apps applsys

cd $FND_TOP/patch/115/sql

cd /erpapp/apps/apps_st/appl/fnd/12.0.0/patch/115/sql/
sqlplus apps/apps

@wfntfqup.sql



-bash-4.1$ cd $FND_TOP/patch/115/sql/
-bash-4.1$ ls -l wfntfqup.sql
-rwxr-xr-x   1 applmgr  dba        11862 Oct 28  2010 wfntfqup.sql
-bash-4.1$ sqlplus apps

SQL*Plus: Release 10.1.0.5.0 - Production on Fri Jan 16 12:34:19 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> @wfntfqup.sql



Take backup of context file before configuring load balancing in APPS NODE

c) Change the URLs previously in Context File configured for Load Balancing in PROD and run autoconfig.

s_external_url http://erpdev.erp.ae:8020
s_login_page http://erpdev.erp.ae:8020/OA_HTML/AppsLogin
s_webentryhost erpdev
s_webentrydomain erp.ae



If we are working in Oracle SuperCluster Environment we need to start the application with the below commands:
=====================================================================================================================

We need to start the erpuat applications with 'clrg' command as 'root' user from APPS NODE1:


# clrg online cm-rg
# clrg online opmn-rg
#cluster status

(OR)
Source the Apps Environment.

cd $ADMIN_SCRIPTS_HOME
./adstral.sh

Step 12: Post clonning steps after Application Tier cloning. 

Changing password:
======================

a)system and sys database users:
----------------------------------

alter user system identified by welcome1;

alter user sys identified by welcome1;


FNDCPASS apps/welcome1 0 Y system/welcome1 SYSTEM APPLSYS new_pass


b)sysadmin password:
=========================

FNDCPASS apps/welcome1 0 Y system/welcome1 USER SYSADMIN welcome6

FNDCPASS apps/welcome1 0 Y system/welcome1 USER rafi welcome6


FNDCPASS apps/welcome1 0 Y system/welcome1 USER sysadmin Welcome789


c)Postclone steps for to clean up FND_NODES entries for concurrent Manager:
==========================

Execute cmclean.sql by connecting with 'apps' user.

To make sure all the Database and Applications service comes up smoothly follow below approach

Shut down the Application tier services.

On App node:
------------

cd $ADMIN_scRIPTS_HOME
./adstpall.sh


d) Execute autoconfig on apps node than on db node and than again on apps node

On DB node:
----------
cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME

./adautocfg.sh

On App node:
------------

cd $ADMIN_scRIPTS_HOME
./adautocfg.sh

ONLY if require do below steps:

C ) Update the Node information for all Concurrent Managers from Concurrent Manager Define to current node name and

Restart concurrent managers using adcmctl.sh


d) Postclone steps for discoverer:
====================================


1)Update Discoverer URL in Context File ( Application Tier - s_disco_url):


2)For Discoverer Copy the new DBC file and change the name in lower case on Discoverer Server


/erpapp/erp1226/fs1/inst/apps/erp1226_orace_erp_host/appl/fnd/12.0.0/secure

applmgr@orace_erp_host:~/erp1226/fs1/inst/apps/erp1226_orace_erp_host/appl/fnd/12.0.0/secure$ scp erp1226.dbc

oracle@198.17.18.142:/u01/app/oracle/Middleware/fmw11gr1/discodom_1/config/discovererr/discovererr_discodom_1
Password:
erp1226.dbc          100% |*********************************************************************************



e)Postclone steps for Colour change at site level:
===================================================

1) Change the profile options:
Site Name to “DEV Instance”
Java Color schme to a color which is not same as PROD


IN POST CLONE FOR UPGRADE ENV Please do cutom sync driver steps:

add Below to adop_sync.drv

applmgr@uat-cm2:/erpapp/ERP122_Source/upgrade/fs_ne/EBSapps/appl/ad/custom$ view adop_sync.drv
applmgr@uat-cm2:/erpapp/ERP122_Source/upgrade/fs_ne/EBSapps/appl/ad/custom$ pwd
/erpapp/ERP122_Source/upgrade/fs_ne/EBSapps/appl/ad/custom



f) Begin Customization

##Customization for erp
rsync -zr %s_current_base%/EBSapps/comn/java/classes/xxadat %s_other_base%/EBSapps/comn/java/classes
rsync -zr %s_current_base%/EBSapps/comn/java/classes/xxad %s_other_base%/EBSapps/comn/java/classes
rsync -zr %s_current_base%/EBSapps/comn/java/classes/xxerp %s_other_base%/EBSapps/comn/java/classes


#Copy Starts
mkdir -p %s_other_base%/EBSapps/comn/java/classes/com/excel4apps
rsync -zr %s_current_base%/EBSapps/comn/java/classes/com/excel4apps %s_other_base%/EBSapps/comn/java/classes/com
rsync -zr %s_current_base%/EBSapps/appl/xxe4a %s_other_base%/EBSapps/appl
rsync -zr %s_current_base%/EBSapps/appl/xxe4arw %s_other_base%/EBSapps/appl
rsync -zr %s_current_base%/EBSapps/appl/fnd/12.0.0/admin/template/custom %s_other_base

%/EBSapps/appl/fnd/12.0.0/admin/template
cp %s_current_base%/EBSapps/comn/java/classes/customall.jar %s_other_base%/EBSapps/comn/java/classes



*****Now Login in separate putty session,source the Envrionmement for APPS DEV and Start all the application services:


applmgr@orace_erp_host:~$ . APPSERPDEV_orace_erp_host.env
applmgr@orace_erp_host:~$ cd $ADMIN_scRIPTS_HOME
applmgr@orace_erp_host:~/inst/apps/ERPDEV_orace_erp_host/admin/scripts$ ./adstrtal.sh

You are running adstrtal.sh version 120.15.12010000.3




f)Postclone steps for Colour change at site level:
===================================================

Change the profile options:
Site Name to “DEV Instance”
Java Color scheme to a color which is not same as PROD



g) Validation steps  and Sanity checks after Doing ERP Cloning:
=============================================================

1)Check all the Concurrent managers are up and reduce the number of processes for Standard managers.

2)Submit the Active user or Active Responsibilities Concurrent request.

3)Check the discovererer URL for viewer and Desktop and share DBC file with team.

4)Make sure to verify logs after starting the ERP Applications


5)Submit Gather schema stats request for all schemas to improve performance of ERP applications


This completes clonning of Database and Applications for Oracle EBS 12.2 .

Enjoy Apps DBA Tasks...

Thanks,

Rafi

“Two useful technologies for working from anywhere – Cloud Desktop and Cloud SharePoint.”

https://www.apps4rent.com