Wednesday, 12 May 2021

𝘿𝙖𝙩𝙖 𝙂𝙪𝙖𝙧𝙙 𝙎𝙮𝙣𝙘𝙝𝙧𝙤𝙣𝙞𝙯𝙖𝙩𝙞𝙤𝙣 𝙘𝙝𝙖𝙣𝙜𝙚𝙨 𝙞𝙣 𝙙𝙞𝙛𝙛𝙚𝙧𝙚𝙣𝙩 𝙋𝙧𝙤𝙩𝙚𝙘𝙩𝙞𝙤𝙣 𝙈𝙤𝙙𝙚: 𝘾𝙤𝙢𝙥𝙡𝙚𝙩𝙚 𝙜𝙪𝙞𝙙𝙚 !!

                                ░D░a░t░a░ ░G░u░a░r░d░























Data Guard:  It is a setup in which you can have one or more standby database available for a production database. Data guard ensures that another database is available as a copy of production database at almost real time. As a result, we have higher protection for enterprise data and the new database is available very quickly without the need to actually restore and recover from backup. Therefore, data guard offers an excellent disaster recovery solution.

 

§  Architecture:- 

Ø  Primary database – It refers to the production database.

Ø  Standby database – It refers to a copy of primary/Production database. Data guard architecture must have at least one or more than one standby database.


Ø  Log transport service –It manages transfer of archive log files from primary to standby database.


Ø  Network configuration – It refers to the network connection between primary and standby database. This connection is based on Oracle Net.


Ø  Log apply services – It applies archived logs to the standby database.


Ø  Role management services – It manages the role change between primary and standby database.


Ø  Data guard broker – It manages data guard creation process and monitors the data guard.




  §  Data Guard Protection Modes:-

Ø  Maximum Protection Mode:

It specifies that a data change on primary Database is acknowledged only when it is available to standby database at least in the form of redo log information.In this mode, primary database shuts down if at least one standby database cannot be updated.So in MAXIMUM PROTECTION mode, user don't get a commit acknowledgment until transactions are successfully written to at least one standby destination.

Redo Archival Process: LGWR

Network Transmission mode: SYNC

Disk Write Option: AFFIRM

Standby Redo Logs: Yes

Standby Database Type: Physical standby database And Logical standby database.

Ø  Maximum Availability Mode:

 It Specifies that a transaction cannot be committed unless redo logs of at least one standby database are completely synchronized with primary database. However, this mode is more tolerant in terms of fault in updating standby database. It allows the primary database to function temporary in maximum performance mode until such error is resolved and gaps are analysed.


Unlike maximum protection mode, the primary database

will not shut down if a fault prevents it from writing its redo stream to a synchronized standby database. Instead, the primary

database will operate in RESYNCHRONIZATION until the fault is corrected and all log gaps have been resolved. When all log gaps

have been resolved, the primary database automatically resumes operating in maximum availability mode.


Redo Archival Process: LGWR

Network Transmission mode: SYNC

Disk Write Option: AFFIRM / NO AFFIRM

Standby Redo Logs: Yes

Standby Database Type: Physical standby database, Logical standby database and Snapshot standby database.

 

Ø  Maximum Performance Mode:

 It allows slight delay in updating standby database and therefore, it offers certain performance gain. In this mode, transaction can be committed as long as the change is written to an online redo log of the primary database without waiting to transfer the redo log to the standby database.


Redo Archival Process: LGWR or ARCH (ARCH is not recommended)

Network Transmission mode: ASYNC

Disk Write Option: NO AFFIRM

Standby Redo Logs: NO (But it is recommended for Real-Time Apply)

Standby Database Type: Physical standby database, Logical standby database and Snapshot standby database.

 




 §  Services Required on Standby database:

Ø  Fetch Archive Log (FAL) – Standby database requires Fetch Archive Log (FAL) client to request and fetch archive log files from primary database.

Ø  Remote File Server (RFS) – RFS to receive archived log files   from primary database,

Ø  Archiver process – It is used to archive redo logs applied to standby database.

Ø  Managed Recovery Process (MRP) – MRP is used to apply redo logs to the standby database.




§  Role Transition:

v  Role Transition is the change of role between primary and standby database.

It can happen in the following two cases:

Ø  Switchover – When primary database is switched to standby database and standby database is switched to primary database (Vice-Versa).

 

Ø  Failover – Where Standby database can be used as a disaster recover solution in case of a failure in the primary database.



§  Changing the Data Guard Protection Mode:

By default protection mode is MAXIMUM PERFORMANCE. So we will change it to MAXIMUM PROTECTION Mode. But we have to make Primary database in mount stage to change the existing protection mode.

The data protection mode can be set to MAXIMUM PROTECTION on an open database only if the current data protection mode is MAXIMUM AVAILABILITY and if there is at least one synchronized standby database. 

[oracle@PRODDB~]$ sqlplus / as sysdba

SQL*Plus:

Release 19.0.0.0.0 - Production on Wed May 12 01:05:27 2021

Version 19.3.0.0.0

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

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

SQL> select name,db_unique_name,open_mode,database_role,protection_mode from v$database;

SQL> show pdbs
 
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
 
         3 PRODDB_PDB                     READ WRITE NO
 
SQL> show parameter log_archive_dest_2 

NAME

TYPE

VALUE

log_archive_dest_2

string

service=PRODDR NOAFFIRM LGWR ASYNC VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PRODDR

SQL> shut immediate;

 Database closed.

Database dismounted.

ORACLE instance shut down.


SQL> startup mount;

 ORACLE instance started.

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE {AVAILABILITY | PERFORMANCE | PROTECTION};

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PROTECTION;

 Database altered.

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=PRODDR AFFIRM LGWR SYNC VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLE)  DB_UNIQUE_NAME=PRODDR' scope=both;

SQL> show parameter log_archive_dest_2

NAME

TYPE

VALUE

log_archive_dest_2

string

service=PRODDR AFFIRM LGWR SYNC VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PRODDR

SQL> alter database open;

Database altered.


SQL> select

name,db_unique_name,open_mode,database_role,protection_mode from v$database.

NAME

DB_UNIQUE_NAME

OPEN_MODE

DATABASE_ROLE

PROTECTION_MODE

PRODDB

PRODDB

READ WRITE

PRIMARY

MAXIMUM PERFORMANCE


Tuesday, 4 May 2021

𝙀𝙍𝙍𝙊𝙍: 𝘾𝙤𝙣𝙩𝙚𝙭𝙩 𝙘𝙧𝙚𝙖𝙩𝙞𝙤𝙣 𝙣𝙤𝙩 𝙘𝙤𝙢𝙥𝙡𝙚𝙩𝙚𝙙 𝙨𝙪𝙘𝙘𝙚𝙨𝙨𝙛𝙪𝙡𝙡𝙮(../𝙟𝙧𝙚/𝙗𝙞𝙣/𝙟𝙖𝙫𝙖: /𝙡𝙞𝙗/𝙡𝙙-𝙡𝙞𝙣𝙪𝙭.𝙨𝙤.2) 𝙬𝙝𝙚𝙣 𝙧𝙪𝙣𝙣𝙞𝙣𝙜 𝙖𝙙𝙘𝙛𝙜𝙘𝙡𝙤𝙣𝙚.𝙥𝙡 𝙤𝙣 𝘼𝙥𝙥𝙨𝙏𝙞𝙚𝙧

    


Solution:

Step 1: Check java

[applprod@apps]$ which java

/usr/bin/java

 

Now, Go to java directory:

[applprod@apps]$ cd $COMMON_TOP/clone/jre/bin

 

[applprod@apps bin]$  ls

ControlPanel  java  java_vm  javaws  jcontrol  keytool  orbd  pack200  policytool  rmid  rmiregistry  servertool  tnameserv  unpack200

 

[applprod@ndrapps ~]$ mv java java_old

 

[applprod@apps bin]$ ln -s /usr/bin/java java



Step 2:  Now,  Check Again->  Run perl adcfgclone.pl appsTier 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Issue Resolved...!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Wednesday, 7 April 2021

𝐎𝐫𝐚𝐜𝐥𝐞 𝐄𝐁𝐒 𝐑𝟏𝟐.𝟐 ( 𝐄-𝐁𝐮𝐬𝐢𝐧𝐞𝐬𝐬 𝐒𝐮𝐢𝐭𝐞 ) 𝐒𝐭𝐞𝐩 𝐛𝐲 𝐒𝐭𝐞𝐩 𝐂𝐥𝐨𝐧𝐢𝐧𝐠

 



Step 1:  Run Pre-Clone on the Source Apps Tier and DB Tier

  • Application Preclone

$ /apdata/erp/fs2/inst/apps/UAT_vm3uat/admin/scripts/adpreclone.pl appsTier pwd=apps

Make tar file :

$  tar -zcPf /apdata/Binary_BKP/apps.tar.gz /apdata/erp/fs2/EBSapps

  • Database Preclone

$ /dbuat/erp/12.1.0/appsutil/scripts/UAT_vm4db/adpreclone.pl dbTier pwd=apps

Make tar file:

$ tar --exclude='/dbuat/erp/12.1.0/admin' -cvf /dbuat/archbackup/Binary/UAT_db.tar.gz /dbuat/erp/12.1.0/


Step 2:  Take Full RMAN Backup (Include current control file & Archive log) at Source Server

 

Step 3:  Copy the Application Tier binary tar file from Source to Target.

Step 4:  Copy the Database binary tar file & RMAN backup from Source to Target.



Step 5: Now, Prepare file system at target server

  • Create the following directories in Target DB server

            mkdir –p /dbdev/erp/12.1.0

            mkdir p /dbdev/erp/data

            chown -Rf  oradev:dba  /dbdev/erp/

            chmod -Rf 775 /dbdev/erp/

             ***Here ,

             RDBMS_ORACLE_HOME=/dbdev/erp/12.1.0

             ORACLE BASE=/dbdev/erp/

             DATA_TOP Directory=/dbdev/erp/data

 

·         Create the following directories in Target EBS Application server 

            mkdir p /apdata/erp/fs2/EBSapps  (Run File system)

            mkdir p /apdata/erp/fs1/   (Patch File system)

            chown -Rf  appldev:dba  /apdata/erp/

            chmod  -Rf 775 /apdata/erp/

 

·         Untar DB binary and copy to target file system

Ø  tar –xvf  UAT_db.tar.gz

Ø  cp –rf  /dbuat/erp/12.1.0/* /dbdev/erp/12.1.0

 

·         Untar Application binary and copy to target file system

Ø   tar –xvf  apps.tar.gz

Ø  cp –rf   /apdata/erp/fs2/EBSapps/* /apdata/erp/fs2/EBSapps/

  



 

Step 6: Configure the Oracle home on Target Database Server

 

[oradev@vm4db bin]$ 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.60

 

Enter the APPS password :

 

Running: Context clone...

 

Log file located at /dbdev/erp/12.1.0/appsutil/clone/bin/CloneContext_0405185655.log

 

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

 

Target System Hostname (virtual or normal) [vm4db] : vm4db.alam.com

 

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

 

Target System Database SID : DEV

 

Target System Base Directory : /dbdev/erp/

 

Role separation is supported y/n [n] ? : n

 

Target System utl_file_dir Directory List : /tmp

 

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

 

Target System DATA_TOP Directory 1 [/dbdev/erp/data] :

 

Target System RDBMS ORACLE_HOME Directory [/dbdev/erp/12.1.0] :

 

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

 

Target System Display [vm4db:0.0] :

 

Target System Port Pool [0-99] : 20

 



 

Step 7: Start the database in nomount mode.

Before starting check the pfile and make sure all the paths are pointing as per target

server directory structure.

 

Add below entry in InitDEV.ora (files are to be restored to a different location):

 

*.db_file_name_convert=’<source_path>’,’<target_path>’

*.db_file_name_convert='/dbuat/erp/data/','/dbdev/erp/data/' 

 

*.log_file_name_convert=’<source_path>’,’<target_path>’

*.log_file_name_convert='/dbuat/erp/data/','/dbdev/erp/data/'

SQL> startup nomount pfile='initDEV.ora';

SQL> create spfile from pfile='initDEV.ora';

SQL> shu immediate;

SQL> startup nomount;

 

Step 8. Rman backup Restoration at target DB server

 

$ rman auxiliary / log=rman_output_060421.txt

Recovery Manager: Release 12.1.0.2.0- Production on Tue Apr 05 18:10:49 2021

Copyright (c) 1991, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: uattest (not mounted)

 

RMAN> run{

allocate auxiliary channel C1 DEVICE TYPE DISK;

allocate auxiliary channel C2 DEVICE TYPE DISK;

allocate auxiliary channel C3 DEVICE TYPE DISK;

allocate auxiliary channel C4 DEVICE TYPE DISK;

allocate auxiliary channel C5 DEVICE TYPE DISK;

allocate auxiliary channel C6 DEVICE TYPE DISK;

allocate auxiliary channel C7 DEVICE TYPE DISK;

allocate auxiliary channel C8 DEVICE TYPE DISK;

duplicate database to 'DEV' backup location '/dbuat/BACKUP/rman05042021_BKP/databkp' nofilenamecheck;

}

 




v   Change database to Noarchivelog mode

            SQL> shut immediate;

            SQL> startup mount;

            SQL> alter database noarchivelog;

            SQL> alter database open;

 

v  Now, login to application user.

         $ sqlplus apps/apps  [Use Source apps user password]

  • Run the below command to remove the Source Instance entries.

          SQL>  EXEC FND_CONC_CLONE.SETUP_CLEAN;

          SQL> commit;

 

v  Run Autoconfig on DBTier:-

         $ cd /dbdev/erp/12.1.0/appsutil/scripts/DEV_vm4db

          [oradev@vm4db DEV_vm4db]$  adautocfg.sh

          Enter the APPS user password:

 

 



Step 9. Now login to application server, run adcfgclone on appstier.

#[RUN FILE SYSTEM]

$ cd /apdata/erp/fs2/EBSapps/comn/clone/bin

[appldev@vm2dev bin]$  perl adcfgclone.pl appsTier

 

                     Copyright (c) 2002, 2015 Oracle Corporation

                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adcfgclone Version 120.63.12020000.60

                ***********************************************************

                In AD-TXK Delta 7, we recommend you clone the run and patch

                file systems in a single operation using the 'dualfs' option.

                Separate cloning of the run and patch file systems will be deprecated

                ************************************************************

 

Enter the APPS password :

 

Enter the Weblogic AdminServer password :

 

Do you want to add a node (yes/no) [no] :

 

Running: Context clone...

 

Log file located at /apdata/erp/fs2/EBSapps/comn/clone/bin/CloneContext_0406034543.log

 

Target System File Edition type [run] :

 

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

 

Target System Hostname (virtual or normal) [vm2dev] : vm2dev.alam.com

 

Target System Database SID : DEV

 

Target System Database Server Node [vm2dev] : vm4db.alam.com

 

Target System Base Directory : /apdata/erp/

 

Target System Base Directory set to /apdata/erp

 

Target System Current File System Base set to /apdata/erp/fs2

 

Target System Other File System Base set to /apdata/erp/fs1

 

Target System Fusion Middleware Home set to /apdata/erp/fs2/FMW_Home

 

Target System Web Oracle Home set to /apdata/erp/fs2/FMW_Home/webtier

 

Target System Appl TOP set to /apdata/erp/fs2/EBSapps/appl

 

Target System COMMON TOP set to /apdata/erp/fs2/EBSapps/comn

 

Target System Instance Home Directory [/apdata/erp] :

 

Target System Instance Top set to /apdata/erp/fs2/inst/apps/DEV_vm2dev

 

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

 

Target System Display [vm2dev: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 /apdata/erp/fs2/inst/apps/DEV_vm2dev/admin/out/portpool.lst

 

UTL_FILE_DIR on database tier consists of the following directories.

 

1. /usr/tmp

2. /tmp

3. /dbdev/erp/12.1.0/appsutil/outbound/DEV_vm4db

4. /usr/tmp

Choose a value which will be set as APPLPTMP value on the target node [1] :

 

Step 10:  (i) Start the Application tier.

                 $ cd $ADMIN_SCRIPTS_HOME

                 $ sh adstrtal.sh apps/<apps-password>

                 (ii)Run adpreclone on TARGET RUN File System

                 $ /apdata/erp/fs2/inst/apps/UAT_vm3uat/admin/scripts/adpreclone.pl appsTier pwd=apps

               (iii) Shutdown application on TARGET RUN File System

                 $ cd $ADMIN_SCRIPTS_HOME

                 $ sh adstpall.sh apps/<apps-password>

                (iv) Copy Target RUN File System to Target Patch File System

                  $ cp -rf  /apdata/erp/fs2/* /apdata/erp/fs1/

 



v Patch Edition File System cloning

Step 11:   (i) UNSET the application Enviroment. Previously we have executed env.

                 (ii) Before we run adcfgclone.pl dont run any env’s

                  

 Now, Directly go to /apdata/erp/fs1/EBSapps/comn/clone/bin/ and execute adcfgclone.pl

[appldev@vm2dev bin]$ perl adcfgclone.pl appsTier

 

                     Copyright (c) 2002, 2015 Oracle Corporation

                        Redwood Shores, California, USA

 

                        Oracle E-Business Suite Rapid Clone

 

                                 Version 12.2

 

                      adcfgclone Version 120.63.12020000.60

 

                ***********************************************************

                In AD-TXK Delta 7, we recommend you clone the run and patch

                file systems in a single operation using the 'dualfs' option.

                Separate cloning of the run and patch file systems will be deprecated

                ************************************************************

 

Enter the APPS password :

 

Enter the Weblogic AdminServer password :

 

Do you want to add a node (yes/no) [no] :

 

 

Running: Context clone...

 

Log file located at /apdata/erp/fs1/EBSapps/comn/clone/bin/CloneContext_0406115635.log

 

Target System File Edition type [run] : patch

 

Enter the full path of Run File System Context file : /apdata/erp/fs2/inst/apps/DEV_vm2dev/appl/admin/DEV_vm2dev.xml

 

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

 

Target System Fusion Middleware Home set to /apdata/erp/fs1/FMW_Home

 

Target System Web Oracle Home set to /apdata/erp/fs1/FMW_Home/webtier

 

Target System Appl TOP set to /apdata/erp/fs1/EBSapps/appl

 

Target System COMMON TOP set to /apdata/erp/fs1/EBSapps/comn

 

Target System Instance Top set to /apdata/erp/fs1/inst/apps/DEV_vm2dev

 

Target System Port Pool [0-99] : 21



v POST CLONING STEPS

Update the Sitename & Date:

SQL>DECLARE

stat boolean;

BEGIN

dbms_output.disable;

dbms_output.enable(100000);

stat := FND_PROFILE.SAVE('SITENAME', 'DEV(Data Till 05-APR-21)', 'SITE');

IF stat THEN

dbms_output.put_line( 'Stat = TRUE - profile updated' );

ELSE

dbms_output.put_line( 'Stat = FALSE - profile NOT updated' );

END IF;

commit;

END;

/

 

Change the profile name:

SQL> DECLARE

stat boolean;

BEGIN

dbms_output.disable;

dbms_output.enable(100000);

stat := FND_PROFILE.SAVE('FS_SVC_PREFIX', 'FNDFS_DEV_', 'SITE');

IF stat THEN

dbms_output.put_line( 'Stat = TRUE - profile updated' );

ELSE

dbms_output.put_line( 'Stat = FALSE - profile NOT updated' );

END IF;

commit;

END;

/

 

 To change color of the site:

SQL>DECLARE

stat boolean;

BEGIN

dbms_output.disable;

dbms_output.enable(100000);

stat := FND_PROFILE.SAVE('FND_COLOR_SCHEME', 'BLUE', 'SITE');

IF stat THEN

dbms_output.put_line( 'Stat = TRUE - profile updated' );

ELSE

dbms_output.put_line( 'Stat = FALSE - profile NOT updated' );

END IF;

commit;

END;

/

 

Clear the schedule concurrent program:

SQL> UPDATE  fnd_concurrent_requests

   SET phase_code = 'C', status_code = 'X'

 WHERE phase_code = 'P'

       AND request_id NOT IN

              (SELECT request_id

                 FROM fnd_conc_req_summary_v

                WHERE program IN

                         ('WIP Move Transaction Manager',

                          'Process transaction interface',

                          'Manager: Lot Move Transactions',

                        'Workflow Background Process',

                          'Cost Manager')

                      AND (phase_code = 'P' OR phase_code = 'R'));

 

 

 

SQL> UPDATE  fnd_concurrent_requests

   SET phase_code = 'C', status_code = 'X'

 WHERE phase_code = 'R' AND status_code = 'R'

       AND request_id NOT IN

              (SELECT request_id

                 FROM fnd_conc_req_summary_v

                WHERE program IN

                         ('WIP Move Transaction Manager',

                          'Process transaction interface',

                          'Manager: Lot Move Transactions',

                        'Workflow Background Process',

                          'Cost Manager')

                      AND (phase_code = 'P' OR phase_code = 'R'));

 

SQL>  COMMIT;

 

 

v Run autoconfig on dbtier and then on appstier.

 

DB tier:

           $ cd $ORACLE_HOME/appsutil/scripts/DEV_vm4db

          $  adautocfg.sh


          Apps tier:

          $  cd $ADMIN_SCRIPTS_HOME

          $  adautocfg.sh

 

 

v Start the Application tier. Check OPMN status and from front end.

           $  cd $ADMIN_SCRIPTS_HOME

           $ ./adstrtal.sh  apps/apps

             Enter the weblogic user password:

~~~~~~~~~~~~~~~~~~EBS R12.2 Cloning is completed!!~~~~~~~~~~~~~~~~~~