16 December, 2016

Archive generation over last one month

SELECT to_date(first_time) DAY,
to_char(sum(decode(to_char(first_time,'HH24'),'00',1,0)),'99') "00",
to_char(sum(decode(to_char(first_time,'HH24'),'01',1,0)),'99') "01",
to_char(sum(decode(to_char(first_time,'HH24'),'02',1,0)),'99') "02",
to_char(sum(decode(to_char(first_time,'HH24'),'03',1,0)),'99') "03",
to_char(sum(decode(to_char(first_time,'HH24'),'04',1,0)),'99') "04",
to_char(sum(decode(to_char(first_time,'HH24'),'05',1,0)),'99') "05",
to_char(sum(decode(to_char(first_time,'HH24'),'06',1,0)),'99') "06",
to_char(sum(decode(to_char(first_time,'HH24'),'07',1,0)),'99') "07",
to_char(sum(decode(to_char(first_time,'HH24'),'08',1,0)),'99') "08",
to_char(sum(decode(to_char(first_time,'HH24'),'09',1,0)),'99') "09",
to_char(sum(decode(to_char(first_time,'HH24'),'10',1,0)),'99') "10",
to_char(sum(decode(to_char(first_time,'HH24'),'11',1,0)),'99') "11",
to_char(sum(decode(to_char(first_time,'HH24'),'12',1,0)),'99') "12",
to_char(sum(decode(to_char(first_time,'HH24'),'13',1,0)),'99') "13",
to_char(sum(decode(to_char(first_time,'HH24'),'14',1,0)),'99') "14",
to_char(sum(decode(to_char(first_time,'HH24'),'15',1,0)),'99') "15",
to_char(sum(decode(to_char(first_time,'HH24'),'16',1,0)),'99') "16",
to_char(sum(decode(to_char(first_time,'HH24'),'17',1,0)),'99') "17",
to_char(sum(decode(to_char(first_time,'HH24'),'18',1,0)),'99') "18",
to_char(sum(decode(to_char(first_time,'HH24'),'19',1,0)),'99') "19",
to_char(sum(decode(to_char(first_time,'HH24'),'20',1,0)),'99') "20",
to_char(sum(decode(to_char(first_time,'HH24'),'21',1,0)),'99') "21",
to_char(sum(decode(to_char(first_time,'HH24'),'22',1,0)),'99') "22",
to_char(sum(decode(to_char(first_time,'HH24'),'23',1,0)),'99') "23",
COUNT (*) TOTAL
from
v$log_history
where to_date(first_time) > sysdate -30
GROUP by
to_char(first_time,'YYYY-MON-DD'), to_date(first_time)
order by to_date(first_time)
/

10 November, 2016

Script - Check Current Undo Configuration and Advise Recommended Setup (Doc ID 1579035.1)

Script - Check Current Undo Configuration and Advise Recommended Setup (Doc ID 1579035.1)


APPLIES TO:

Oracle Database - Enterprise Edition - Version 8.1.7.0 and later
Information in this document applies to any platform.

GOAL

 This document is intended to check the current undo configuration and provides recommendation based on the previous workload.AUTION
  
This sample code is provided for diagnosis and troubleshooting purposes only, and is NOT supported by Oracle Support. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
There are different scripts for database versions post 10g and prior to 10g. Ensure to execute the correct one to get the proper recommendation. Ensure to execute the script as SYS user.

SOLUTION

For database version 10g and above, use the following script. Ensure to execute the same as SYSDBA.

RDBMS version 10g and above:

SET SERVEROUTPUT ON
SET LINES 600
ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY HH24:MI:SS';

DECLARE
    v_analyse_start_time    DATE := SYSDATE - 7;
    v_analyse_end_time      DATE := SYSDATE;
    v_cur_dt                DATE;
    v_undo_info_ret         BOOLEAN;
    v_cur_undo_mb           NUMBER;
    v_undo_tbs_name         VARCHAR2(100);
    v_undo_tbs_size         NUMBER;
    v_undo_autoext          BOOLEAN;
    v_undo_retention        NUMBER(5);
    v_undo_guarantee        BOOLEAN;
    v_instance_number       NUMBER;
    v_undo_advisor_advice   VARCHAR2(100);
    v_undo_health_ret       NUMBER;
    v_problem               VARCHAR2(1000);
    v_recommendation        VARCHAR2(1000);
    v_rationale             VARCHAR2(1000);
    v_retention             NUMBER;
    v_utbsize               NUMBER;
    v_best_retention        NUMBER;
    v_longest_query         NUMBER;
    v_required_retention    NUMBER;
BEGIN
    select sysdate into v_cur_dt from dual;
    DBMS_OUTPUT.PUT_LINE(CHR(9));
    DBMS_OUTPUT.PUT_LINE('- Undo Analysis started at : ' || v_cur_dt || ' -');
    DBMS_OUTPUT.PUT_LINE('--------------------------------------------------');

    v_undo_info_ret := DBMS_UNDO_ADV.UNDO_INFO(v_undo_tbs_name, v_undo_tbs_size, v_undo_autoext, v_undo_retention, v_undo_guarantee);
    select sum(bytes)/1024/1024 into v_cur_undo_mb from dba_data_files where tablespace_name = v_undo_tbs_name;

    DBMS_OUTPUT.PUT_LINE('NOTE:The following analysis is based upon the database workload during the period -');
    DBMS_OUTPUT.PUT_LINE('Begin Time : ' || v_analyse_start_time);
    DBMS_OUTPUT.PUT_LINE('End Time   : ' || v_analyse_end_time);
  
    DBMS_OUTPUT.PUT_LINE(CHR(9));
    DBMS_OUTPUT.PUT_LINE('Current Undo Configuration');
    DBMS_OUTPUT.PUT_LINE('--------------------------');
    DBMS_OUTPUT.PUT_LINE(RPAD('Current undo tablespace',55) || ' : ' || v_undo_tbs_name);
    DBMS_OUTPUT.PUT_LINE(RPAD('Current undo tablespace size (datafile size now) ',55) || ' : ' || v_cur_undo_mb || 'M');
    DBMS_OUTPUT.PUT_LINE(RPAD('Current undo tablespace size (consider autoextend) ',55) || ' : ' || v_undo_tbs_size || 'M');
    IF V_UNDO_AUTOEXT THEN
        DBMS_OUTPUT.PUT_LINE(RPAD('AUTOEXTEND for undo tablespace is',55) || ' : ON');
    ELSE
        DBMS_OUTPUT.PUT_LINE(RPAD('AUTOEXTEND for undo tablespace is',55) || ' : OFF');
    END IF;
    DBMS_OUTPUT.PUT_LINE(RPAD('Current undo retention',55) || ' : ' || v_undo_retention);

    IF v_undo_guarantee THEN
        DBMS_OUTPUT.PUT_LINE(RPAD('UNDO GUARANTEE is set to',55) || ' : TRUE');
    ELSE
        dbms_output.put_line(RPAD('UNDO GUARANTEE is set to',55) || ' : FALSE');
    END IF;
    DBMS_OUTPUT.PUT_LINE(CHR(9));

    SELECT instance_number INTO v_instance_number FROM V$INSTANCE;

    DBMS_OUTPUT.PUT_LINE('Undo Advisor Summary');
    DBMS_OUTPUT.PUT_LINE('---------------------------');

    v_undo_advisor_advice := dbms_undo_adv.undo_advisor(v_analyse_start_time, v_analyse_end_time, v_instance_number);
    DBMS_OUTPUT.PUT_LINE(v_undo_advisor_advice);

    DBMS_OUTPUT.PUT_LINE(CHR(9));
    DBMS_OUTPUT.PUT_LINE('Undo Space Recommendation');
    DBMS_OUTPUT.PUT_LINE('-------------------------');

    v_undo_health_ret := dbms_undo_adv.undo_health(v_analyse_start_time, v_analyse_end_time, v_problem, v_recommendation, v_rationale, v_retention, v_utbsize);
    IF v_undo_health_ret > 0 THEN
        DBMS_OUTPUT.PUT_LINE('Minimum Recommendation           : ' || v_recommendation);
        DBMS_OUTPUT.PUT_LINE('Rationale                        : ' || v_rationale);
        DBMS_OUTPUT.PUT_LINE('Recommended Undo Tablespace Size : ' || v_utbsize || 'M');
    ELSE
        DBMS_OUTPUT.PUT_LINE('Allocated undo space is sufficient for the current workload.');
    END IF;
  
    SELECT dbms_undo_adv.best_possible_retention(v_analyse_start_time, v_analyse_end_time) into v_best_retention FROM dual;
    SELECT dbms_undo_adv.longest_query(v_analyse_start_time, v_analyse_end_time) into v_longest_query FROM dual;
    SELECT dbms_undo_adv.required_retention(v_analyse_start_time, v_analyse_end_time) into v_required_retention FROM dual;

    DBMS_OUTPUT.PUT_LINE(CHR(9));
    DBMS_OUTPUT.PUT_LINE('Retention Recommendation');
    DBMS_OUTPUT.PUT_LINE('------------------------');
    DBMS_OUTPUT.PUT_LINE(RPAD('The best possible retention with current configuration is ',60) || ' : ' || v_best_retention || ' Seconds');
    DBMS_OUTPUT.PUT_LINE(RPAD('The longest running query ran for ',60) || ' : ' || v_longest_query || ' Seconds');
    DBMS_OUTPUT.PUT_LINE(RPAD('The undo retention required to avoid errors is ',60) || ' : ' || v_required_retention || ' Seconds');

END;
/

Sample Output

- Undo Analysis started at : 30/08/2013 11:08:40 -
--------------------------------------------------
NOTE:The following analysis is based upon the database workload during the period -
Begin Time : 23/08/2013 11:08:40
End Time   : 30/08/2013 11:08:40

Current Undo Configuration
--------------------------
Current undo tablespace                                 : UNDOTBS2
Current undo tablespace size (datafile size now)        : 20M
Current undo tablespace size (consider autoextend)      : 20M
AUTOEXTEND for undo tablespace is                       : ON
Current undo retention                                  : 900
UNDO GUARANTEE is set to                                : FALSE

Undo Advisor Summary
---------------------------
Finding 1:Undo Tablespace is under pressure. Recommendation 1:Size undo tablespace to 26 MB

Undo Space Recommendation
-------------------------
Minimum Recommendation           : Size undo tablespace to 26 MB
Rationale                        : Increase undo tablespace size so that long running queries will not fail
Recommended Undo Tablespace Size : 26M

Retention Recommendation
------------------------
The best possible retention with current configuration is    : 9171 Seconds
The longest running query ran for                            : 2543 Seconds
The undo retention required to avoid errors is               : 2543 Seconds

PL/SQL procedure successfully completed.

Script - Check Current Undo Configuration and Advise Recommended Setup (Doc ID 1579035.1)

Script - Check Current Undo Configuration and Advise Recommended Setup (Doc ID 1579035.1)


APPLIES TO:

Oracle Database - Enterprise Edition - Version 8.1.7.0 and later
Information in this document applies to any platform.

GOAL

 This document is intended to check the current undo configuration and provides recommendation based on the previous workload.AUTION
  
This sample code is provided for diagnosis and troubleshooting purposes only, and is NOT supported by Oracle Support. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
There are different scripts for database versions post 10g and prior to 10g. Ensure to execute the correct one to get the proper recommendation. Ensure to execute the script as SYS user.

SOLUTION

For database version 10g and above, use the following script. Ensure to execute the same as SYSDBA.

RDBMS version 10g and above:

SET SERVEROUTPUT ON
SET LINES 600
ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY HH24:MI:SS';

DECLARE
    v_analyse_start_time    DATE := SYSDATE - 7;
    v_analyse_end_time      DATE := SYSDATE;
    v_cur_dt                DATE;
    v_undo_info_ret         BOOLEAN;
    v_cur_undo_mb           NUMBER;
    v_undo_tbs_name         VARCHAR2(100);
    v_undo_tbs_size         NUMBER;
    v_undo_autoext          BOOLEAN;
    v_undo_retention        NUMBER(5);
    v_undo_guarantee        BOOLEAN;
    v_instance_number       NUMBER;
    v_undo_advisor_advice   VARCHAR2(100);
    v_undo_health_ret       NUMBER;
    v_problem               VARCHAR2(1000);
    v_recommendation        VARCHAR2(1000);
    v_rationale             VARCHAR2(1000);
    v_retention             NUMBER;
    v_utbsize               NUMBER;
    v_best_retention        NUMBER;
    v_longest_query         NUMBER;
    v_required_retention    NUMBER;
BEGIN
    select sysdate into v_cur_dt from dual;
    DBMS_OUTPUT.PUT_LINE(CHR(9));
    DBMS_OUTPUT.PUT_LINE('- Undo Analysis started at : ' || v_cur_dt || ' -');
    DBMS_OUTPUT.PUT_LINE('--------------------------------------------------');

    v_undo_info_ret := DBMS_UNDO_ADV.UNDO_INFO(v_undo_tbs_name, v_undo_tbs_size, v_undo_autoext, v_undo_retention, v_undo_guarantee);
    select sum(bytes)/1024/1024 into v_cur_undo_mb from dba_data_files where tablespace_name = v_undo_tbs_name;

    DBMS_OUTPUT.PUT_LINE('NOTE:The following analysis is based upon the database workload during the period -');
    DBMS_OUTPUT.PUT_LINE('Begin Time : ' || v_analyse_start_time);
    DBMS_OUTPUT.PUT_LINE('End Time   : ' || v_analyse_end_time);
  
    DBMS_OUTPUT.PUT_LINE(CHR(9));
    DBMS_OUTPUT.PUT_LINE('Current Undo Configuration');
    DBMS_OUTPUT.PUT_LINE('--------------------------');
    DBMS_OUTPUT.PUT_LINE(RPAD('Current undo tablespace',55) || ' : ' || v_undo_tbs_name);
    DBMS_OUTPUT.PUT_LINE(RPAD('Current undo tablespace size (datafile size now) ',55) || ' : ' || v_cur_undo_mb || 'M');
    DBMS_OUTPUT.PUT_LINE(RPAD('Current undo tablespace size (consider autoextend) ',55) || ' : ' || v_undo_tbs_size || 'M');
    IF V_UNDO_AUTOEXT THEN
        DBMS_OUTPUT.PUT_LINE(RPAD('AUTOEXTEND for undo tablespace is',55) || ' : ON');
    ELSE
        DBMS_OUTPUT.PUT_LINE(RPAD('AUTOEXTEND for undo tablespace is',55) || ' : OFF');
    END IF;
    DBMS_OUTPUT.PUT_LINE(RPAD('Current undo retention',55) || ' : ' || v_undo_retention);

    IF v_undo_guarantee THEN
        DBMS_OUTPUT.PUT_LINE(RPAD('UNDO GUARANTEE is set to',55) || ' : TRUE');
    ELSE
        dbms_output.put_line(RPAD('UNDO GUARANTEE is set to',55) || ' : FALSE');
    END IF;
    DBMS_OUTPUT.PUT_LINE(CHR(9));

    SELECT instance_number INTO v_instance_number FROM V$INSTANCE;

    DBMS_OUTPUT.PUT_LINE('Undo Advisor Summary');
    DBMS_OUTPUT.PUT_LINE('---------------------------');

    v_undo_advisor_advice := dbms_undo_adv.undo_advisor(v_analyse_start_time, v_analyse_end_time, v_instance_number);
    DBMS_OUTPUT.PUT_LINE(v_undo_advisor_advice);

    DBMS_OUTPUT.PUT_LINE(CHR(9));
    DBMS_OUTPUT.PUT_LINE('Undo Space Recommendation');
    DBMS_OUTPUT.PUT_LINE('-------------------------');

    v_undo_health_ret := dbms_undo_adv.undo_health(v_analyse_start_time, v_analyse_end_time, v_problem, v_recommendation, v_rationale, v_retention, v_utbsize);
    IF v_undo_health_ret > 0 THEN
        DBMS_OUTPUT.PUT_LINE('Minimum Recommendation           : ' || v_recommendation);
        DBMS_OUTPUT.PUT_LINE('Rationale                        : ' || v_rationale);
        DBMS_OUTPUT.PUT_LINE('Recommended Undo Tablespace Size : ' || v_utbsize || 'M');
    ELSE
        DBMS_OUTPUT.PUT_LINE('Allocated undo space is sufficient for the current workload.');
    END IF;
  
    SELECT dbms_undo_adv.best_possible_retention(v_analyse_start_time, v_analyse_end_time) into v_best_retention FROM dual;
    SELECT dbms_undo_adv.longest_query(v_analyse_start_time, v_analyse_end_time) into v_longest_query FROM dual;
    SELECT dbms_undo_adv.required_retention(v_analyse_start_time, v_analyse_end_time) into v_required_retention FROM dual;

    DBMS_OUTPUT.PUT_LINE(CHR(9));
    DBMS_OUTPUT.PUT_LINE('Retention Recommendation');
    DBMS_OUTPUT.PUT_LINE('------------------------');
    DBMS_OUTPUT.PUT_LINE(RPAD('The best possible retention with current configuration is ',60) || ' : ' || v_best_retention || ' Seconds');
    DBMS_OUTPUT.PUT_LINE(RPAD('The longest running query ran for ',60) || ' : ' || v_longest_query || ' Seconds');
    DBMS_OUTPUT.PUT_LINE(RPAD('The undo retention required to avoid errors is ',60) || ' : ' || v_required_retention || ' Seconds');

END;
/

Sample Output

- Undo Analysis started at : 30/08/2013 11:08:40 -
--------------------------------------------------
NOTE:The following analysis is based upon the database workload during the period -
Begin Time : 23/08/2013 11:08:40
End Time   : 30/08/2013 11:08:40

Current Undo Configuration
--------------------------
Current undo tablespace                                 : UNDOTBS2
Current undo tablespace size (datafile size now)        : 20M
Current undo tablespace size (consider autoextend)      : 20M
AUTOEXTEND for undo tablespace is                       : ON
Current undo retention                                  : 900
UNDO GUARANTEE is set to                                : FALSE

Undo Advisor Summary
---------------------------
Finding 1:Undo Tablespace is under pressure. Recommendation 1:Size undo tablespace to 26 MB

Undo Space Recommendation
-------------------------
Minimum Recommendation           : Size undo tablespace to 26 MB
Rationale                        : Increase undo tablespace size so that long running queries will not fail
Recommended Undo Tablespace Size : 26M

Retention Recommendation
------------------------
The best possible retention with current configuration is    : 9171 Seconds
The longest running query ran for                            : 2543 Seconds
The undo retention required to avoid errors is               : 2543 Seconds

PL/SQL procedure successfully completed.

06 November, 2016

Online Patching (ADOP) in Oracle EBS R12.2

Online patching is supported by the capability of storing multiple application editions in the database, and the provision of a dual application tier file system. At any given point in time, one of these file systems is designated as run (part of the running system) and the other as patch (either being patched or awaiting the start of the next patching cycle).

For applying a patch in R12.2 you need to use adop and run through all below phases in sequence mentioned below.
1) adop phase=prepare
2) adop phase=apply patches=<patch_number1>,<patch_number2> workers=<number_of_worker>
3) adop phase=finalize workers=<number_of_worker> (called automatically)
4) adop phase=cutover workers=<number_of_worker>
5) adop phase=cleanup (called automatically)
OR
Running all phases in single command:
adop phase=prepare,apply,finalize,cutover,cleanup patches=<patch_number1>,<patch_number2>
——————————————————————————————————————–

DESCRIPTION OF EACH PHASE

1) PREPARE PHASE DETAILS
Used to start a new online patching cycle
How to execute:
A) Set the environment by executing (sourcing) the run file system environment file:
$ source <EBS install base>/EBSapps.env run
B) Verify envirionment
You can confirm that the environment is properly set by examining the relevant environment variables:
$ echo $FILE_EDITION
 run
$ echo $TWO_TASK
 dbSID
C) Download Patches
Download patches to be applied and place then in the $PATCH_TOP directory of your system. This directory is pre-created by the install in the non-editioned file system (fs_ne) and should not be changed.
Important: On a multi-node system with non-shared file systems, you must copy the patch files to each separate $PATCH_TOP directory, so that the patch files are available from the same location on all nodes.
D) Unzip the patch
$ unzip <patch>.zip
E) Run Prepare Command
Prepare the system for patching by running the following command to start a new patching cycle:
$ adop phase=prepare

What it will do:
• Checks whether to perform a cleanup, which will be needed if the user failed to invoke cleanup after the cutover phase of a previous online patching cycle.
• Checks the integrity of the database data dictionary. If any corruption is found, adop exits with an error.
• Checks system configuration on each application tier node. A number of critical settings are validated to ensure that each application tier node is correctly registered, configured, and ready for patching.
• Checks for the existence of the “Online Patching In Progress” (ADZDPATCH) concurrent program. This program prevents certain predefined concurrent programs from being started, and as such needs to be active while a patching cycle is in progress (that is, while a database patch edition exists). If the ADZDPATCH program has not yet been requested to run, a request is submitted.
Note: ADZDPATCH is cancelled later on when the cutover phase is complete.
• Checks to see if the patch service has been created. adop requires that a special database service exists for the purpose of connecting to the patch edition. This service is created automatically, but its continued existence is validated on each prepare.
It can be checked by the database parameter SERVICE_NAME
SQL> show parameter service_name
NAME TYPE VALUE
 ------------------------------------ ----------- --------------- 
service_names string dba, ebs_patch
Here dba is the SID of our database and ebs_patch is additional service_name which is required by online patching tool.
If you look at tnsnames.ora file in the Application tier $TNS_ADMIN directory you will find below kind of entry:
<SID>_patch=
 (DESCRIPTION=
 (ADDRESS=(PROTOCOL=tcp)(HOST=<your_database_server_name>)(PORT=<your_database_port>))
 (CONNECT_DATA=
 (SERVICE_NAME=ebs_patch)
 (INSTANCE_NAME=<your_database_SID>)
 )
 )
During patching phase, adop will use this tns entry to connect to database.
• Invokes the TXK script $AD_TOP/patch/115/bin/txkADOPPreparePhaseSynchronize.pl to synchronize the patches which have been applied to the run APPL_TOP, but not the patch APPL_TOP.
• Checks the database for the existence of a patch edition, and creates one if it does not find one.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2) APPLY PHASE DETAILS
In the apply phase, adop applies the specified patches to the system. Patches are applied to the patch edition of the database and file system.
How to execute:
Example:
$ adop phase=apply patches=1234,7891 workers=8
Where 1234 and 7891 are the patch numbers
What it will do:
If a post-installation patch step mentions any tasks that need to be performed explicitly, where they are run from depends on the type of patching:
• In a normal online patching cycle, the steps should be executed from the patch file system after the apply phase.
• If the patch is being applied in hotpatch mode or downtime mode, the steps should be executed from the run file system after the apply phase.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3) FINALIZE PHASE DETAILS
The finalize phase will be executed while the application is still online. It is used to perform any remaining processing that is needed to ensure the system is ready for the fastest possible cutover.
Used to perform the final patching operations that can
How to execute:
$ adop phase=finalize
What it will do:
• Pre-compute DDL that needs to be run at cutover.
• Compile all invalid objects.
• Validate that the system is ready for cutover.
If finalize_mode=full, compute statistics for key data dictionary tables for improved
performance.
VERY IMPORTANT 1 : Up to this phase, you can run a special phase called abort, which will undo the changes made so far in the patching cycle. After cutover is complete, however, you cannot do this.
VERY IMPORTANT 2 : In an online patching cycle, the requisite JAR files are initially stored in the $APPL_TOP/admin/<SID>/out directory, and then uploaded into the database during the cutover phase. Therefore, the out directory must not be deleted at least until cutover (next phase) is complete.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4) CUTOVER PHASE DETAILS
Used to perform the transition to the patched environment. Shuts down application tier services, makes the patch edition the new run edition, and then restarts application tier services. This is the only phase the involves a brief downtime.
Important: No users should remain on the system during cutover, as there will be a short downtime period while the application tier services are restarted. Also, any third-party processes connected to the
old run edition of the database should be shut down, or they will be terminated automatically.
How to execute:
$ adop phase=cutover
What it will do:
• Shut down internal concurrent manager. The adop utility signals the internal concurrent manager to shut down, but will wait for any existing concurrent requests to finish before it proceeds with cutover actions.
Note: Cutover will take longer if it has to wait for long-running concurrent processes to complete. In such a case, you can expect to see an informational message of the form: [STATEMENT] [END 2013/10/28 23:47:16] Waiting for ICM to go downIf you do not want to wait for in-progress concurrent requests to finish normally, you can terminate the internal concurrent manager by executing the adcmctl.sh abort command from a different shell.
• Shut down application tier services: All application tier services are brought down. During this period, the system is unavailable to users.
• Cutover database: Promote patch database edition to become the new run database edition, using adzdpmgr.pl script.
• Cutover file system: Promote patch file system to become the new run file system, switching the $FILE_EDITION values in the patch and run enviroments. The current patch APPL_TOP becomes the new run APPL_TOP, and the current run APPL_TOP becomes the new patch APPL_TOP. Terminate old database sessions: Terminate any database connections to the old run edition of the database.
• Start application tier services: Application tier services are restarted, on the new run edition. The system is now available again to users
• ADZDPATCH concurrent program is cancelled when the cutover phase is complete.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5) CLEANUP PHASE DETAILS
Important: If you fail to run the cleanup phase explicitly, it will be run automatically on the next prepare cycle, but this will cause a delay in starting your next online patching cycle.
This adop phase is used to remove obsolete code and data from old editions.
How to execute:
$ adop phase=cleanup
What it will do:
• Various actions are performed during cleanup, including dropping (removing) obsolete: Crossedition triggers, Seed data, Editioned code objects (covered objects), Indexes, Columns, Editions.
Using parameter cleanup_mode:
a) cleanup_mode=quick – Performs minimum cleanup, including removal of obsolete crossedition triggers and seed data.
Use quick cleanup when you need to start the next patching cycle as soon as possible. For example, if you want to start a new patching cycle right away, but have not yet run cleanup from the previous patching cycle, you can use quick cleanup mode to complete the essential cleanup tasks as fast as possible.
b) cleanup_mode=standard – Does the same as quick mode, and also drops (removes) obsolete editioned code objects (covered objects).
This is the default mode , so does not need to be specified.
c) cleanup_mode=full – Performs maximum cleanup, which drops all obsolete code and data from earlier editions
Use full cleanup when you want to recover the maximum amount of space in the database. If you have run a large number of patching cycles, or applied a very large patch such as a rollup, significant space may be consumed by obsolete table columns and recovered by running a full cleanup. A full cleanup should only be performed when there is no immediate need to start a new patching cycle.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
THERE ARE TWO SPECIAL PHASES:
A) ABORT PHASE DETAILS
Abort PHASE is conditional phase. This phase cannot be specified with any other phase.
If for some reason either the prepare or apply phase failed or gave problems, you can abort the patching cycle at either of these points by running a special phase with the Command. The actions taken will be discarded (rollbacked).
IMPORTANT: This abort command is only available up to (but not including) the cutover phase. After cutover, the system is running on the new edition, and abort is no longer possible for that patching cycle.
How to execute:
The command to perform this operation is:
$ adop phase=abort
What it will do:
• Confirms that there is an in-progress online patching cycle, so the abort call is therefore valid.
• Checks for the existence of a patch edition and drops one if it exists.
• Cancels the ADZDPATCH concurrent program, if it is running.
• Deletes the rows inserted for the pending session ID from the ad_adop_sessions and ad_adop_session_patches tables.
VERY IMPORTANT: After running abort, a full cleanup must be performed. The cleanup command is: adop phase=cleanup cleanup_mode=full). This will remove any columns that were added by the patch but are no longer needed because of the abort. If they are not removed, they may cause problems in a later patching cycle.
Alternatively, you can run a combined command to abort the patching cycle and perform a full cleanup:
$ adop phase=abort,cleanup cleanup_mode=full
If any attempt was made to apply patches to the patch edition, after abort you must run the fs_clone phase (adop phase=fs_clone) to recreate the patch file system.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
B) FS_CLONE PHASE DETAILS
The fs_clone phase is a command (not related to adcfgclone.pl) that is used to synchronize the patch file system with the run file system. The fs_clone phase should only be run when mentioned as part of a specific documented procedure.
How to execute:
The fs_clone phase is run using the following command:
$ adop phase=fs_clone
What it will do:
This phase is useful if the APPL_TOPs have become very unsynchronized (meaning that there would be a large number of delta patches to apply). It is a heavyweight process, taking a backup of the entire current patch APPL_TOP and then cloning the run APPL_TOP to create a new patch APPL_TOP. As this method requires more time and disk space, it should only be used when the state of the patch file system is unknown. This command must be invoked from the run file system, before the next prepare phase is run.
Note: The patch file system requires at least 25 GB of free disk space to be available for adop operations, including fs_clone. If there is insufficient free space, the adop operation will fail.
If an fs_clone operation fails, you can rerun it with the option force=yes to restart it from the beginning (with the same session ID), or force=no to restart it from the point where it failed.
——————————————————————————————————————–
IMPORTANT POINTS REGARDING ONLINE PATCHING:
1. adop utility is put under $APPL_TOP_NE/ad/bin. It is a wrapper script which calls internally the perl script $AD_TOP/bin/adzdoptl.pl which does actual work of applying the patch.
2. adop will automatically set its environment as required, but it is the user’s responsibility to set the environment correctly for any other commands that may be run. Set the run edition environment whenever executing commands that you intend to affect the run edition.
For example:
$ . <EBS_ROOT>/EBSapps.env run
 $ adstrtal.sh
Set the patch edition environment whenever you intend to execute commands that affect the patch edition.
For example:
$ . <EBS_ROOT>/EBSapps.env patch
 $ sqlplus apps/apps @my_custom_patch_script.sql
3. All the phases need to be completed and you can’t skip any of these. For example, if you try to skip prepare phase, you may get error message like “Apply phase can only be run while in a patching cycle, i.e. after prepare phase.”
4. After an online patching cycle is started, you should not perform any configuration changes in the run edition file system. Any that are made will not be propagated and will therefore be lost after cutover is complete.
5. You should not attempt to clone an Oracle E-Business Suite system while an online patching cycle is in progress.
6. The prepare, apply, and fs_clone phases all require at least 10GB of free disk space. All other phases require 1GB of free space. A warning message will be displayed if less than the needed amount is available.
7. The directories where you extracted the patches applied in a given patching cycle must be retained, in the same location and with the same contents, until the next prepare phase completes. This is also a requirement for patches applied in a hotpatch session.
8. Maintenance Mode is not needed for online patching, and so Maintenance Mode is not available in Oracle E-Business Suite Release 12.2.
——————————————————————————————————————-
ADOP ON MULTI-NODE
In a multi-node environment, one application tier node will be designated as the primary node. This is the node where the Admin Server is located, and will usually also be the node that runs Oracle HTTP Server. All other application tier nodes are designated as secondary nodes.
adop commands are invoked by a user on the primary node. Internally, adop uses Secure Shell (ssh) to automatically execute required patching actions on all secondary nodes. You must set up passwordless ssh connectivity from the primary node to all secondary nodes.
If a node unexpectedly becomes inaccessible via ssh, it will be abandoned by adop, and the appropriate further actions taken. Consider a scenario where the adop phase=prepare command is run in a system with ten application tier nodes. The command is successful on nine nodes, but fails on the tenth. In such a case, adop will identify the services enabled on nodes 1-9. If they are sufficient for Oracle E-Business Suite to continue to run normally, adop will mark node 10 as abandoned and then proceed with its patching actions. If they are not sufficient, adop will proceed no further.
——————————————————————————————————————–

28 October, 2016

How to clone a database manually, without using RMAN

Steps to clone the database

The following steps can be used to clone a database on the same server or on another server,

We will clone a database with name proddb the cloned database will have the name clonedb,and clonedb will reside on the same server as proddb,

The cloning process mainly has 2 steps,
1. Take a cold backup of the production database
2. Restore the backup on to the clone destination and startup the clone database

Optionally you can rename the clone database, before starting it up.the steps below describe the process of cloning a database and also renaming the database.


Perform Cold Backup of the Production database

1. Note down the datafile, controlfile and redologfile locations on proddb

OS> sqlplus / as sysdba

SQL> select name from v$datafile;
SQL> select member from v$logfile;
SQL> show parameter control_files

2. Shutdown the production database proddb

OS> sqlplus / as sysdba

SQL> shutdown immediate

NOTE : Ensure clean shutdown.

3. Copy the database files (datafiles, logfiles, controlfiles and parameter file) into the clone destination.

Using the information gathered in step 1, change directory to the production database directories

OS> cd /u01/<path_to_proddb_files>

Note : for simplicity sake we'll assume all files are in the same directory

OS> cp /u01/<path_to_proddb_files>/<filename> /u01/<path_to_clonedb_files>/

repeat the same for all datafiles, controlfiles and redologfiles

OS> cp $ORACLE_HOME/dbs/initproddb.ora $ORACLE_HOME/dbs/initclonedb.ora

4. Modify the parameter CONTROL_FILES in the pfile for clonedb to reflect the new path of the control files.

Using your favorite text editor edit the pfile to reflect the new path of the control files

vi initclonedb.ora

CONTROL_FILES = '/u01/clonedb/control/control01.ctl','/u01/clonedb/control/control02.ctl'

Rename the database as per requirements and start the clone database. We rename the database only if needed, if you plan to retain the same name, the whole process simplifies to taking a cold backup
and restoring it in the target location and starting up the database,however renaming becomes mandatory if the cloning happens on the same server and in the same Oracle Home.

If the database version is less than version 9.2,please go to section "Renaming database with version lower than 9.2"


Note :
Ensure DB_NAME is still proddb in initclonedb.ora, clonedb pfile,Please note that the production database should be shutdown throughout the clone process, this is because we are cloning the database on the same server
and using the same Oracle Home, if either one is different, database can be started immediately after copying the files.


1. Mount the database and rename the datafiles and redolog files.

export ORACLE_SID=clonedb

OS> sqlplus / as sysdba
OS> startup mount
OS> alter database rename file '/u01/<path_to_proddb_files>/<filename>' to '/u01/<path_to_clonedb_files>/<filename>'

2. Rename the database with the dbnewid (nid) utility
For information on how to use the DBNEWID utility, please refer this note Note 224266.1 Title: How to Change the DBID and the DBNAME by using NID
NOTE : If you are using a database of version lesser than 9.2 then the DBNEWID (NID) utility cannot be used as it was introduced only from 9.2


3. Edit the pfile and update the new database name

vi initclonedb.ora

---> Modify parameter DB_NAME to reflect the new database name.

also ensure you make necessary changes to the environment for ORACLE_SID, ORACLE_HOME
as needed.

4. Open the clone database.
5. Startup and open the production database.

Note : These steps may not be applicable to databases using OMF files as there are restrictions on renaming the datafiles, controlfiles and logfiles when they are Oracle Managed, it is Likely that you will receive a ORA-1276 when you rename a OMF file.

Renaming database with version lower than 9.2

Note : In this case it is not required to copy controlfiles or redologfiles
as they will be created newly, also note that when using this method to rename the database, the production database can be started immediately following the copying of the datafiles to the clone location.

1. Generate a controlfile backup trace file with the command
SQL> alter database backup controlfile to trace as '/path/filename.trc';

2. Edit the pfile and update the new database name

vi initclonedb.ora

---> Modify parameter DB_NAME to reflect the new database name.
also ensure you make necessary changes to the environment for ORACLE_SID, ORACLE_HOME
as needed.

3. Make a script to create a new controlfile

Editing the trace generated in
step 1 of this section, ensure to use the SET option to set the new database name.

Example
CREATE CONTROLFILE SET DATABASE "CLONEDB" RESETLOGS NOARCHIVELOG
-- SET STANDBY TO MAXIMIZE PERFORMANCE
MAXLOGFILES 16
MAXLOGMEMBERS 2
MAXDATAFILES 30
MAXINSTANCES 1
MAXLOGHISTORY 454
LOGFILE
GROUP 1 '/home/oracle/databases/clonedb/redo1.ora' SIZE 100M,
GROUP 2 '/home/oracle/databases/clonedb/redo2.ora' SIZE 100M,
GROUP 3 '/home/oracle/databases/clonedb/redo3.ora' SIZE 100M
-- STANDBY LOGFILE
DATAFILE
'/home/oracle/databases/clonedb/system.dbf',
'/home/oracle/databases/clonedb/undo.dbf',
'/home/oracle/databases/clonedb/data.dbf'
CHARACTER SET WE8ISO8859P1
;

File saved as createcontrol.sql

4. Connect to the clone instance and start in the NOMOUNT stage.

export ORACLE_SID=clonedb
sqlplus /nolog
SQL> conn / as sysdba
SQL> startup nomount
SQL> @createcontrol.sql

Control File Created.

SQL> alter database open resetlogs ;

Please note you may have to add tempfiles to temporary tablespaces
as needed.

These steps complete the cloning process.

A note about temporary tempfiles

In this process of cloning especially when using the method where control files have to be recreated generally the temporary tablespace tempfiles get disassociated from the database, in this case the
tempfile just needs to be added back to the respective tablespace with this command alter tablespace <temp_tablespace_name> add tempfile '/path/filename';

Please see this metalink note for more details

Note 178992.1 Title: How to Recover from Missing Tempfiles or an Empty Temporary Tablespace

09 October, 2016

R12.2.5 single node cloning

Hello all,
After long time I am updating my blog with R12.2.5 cloning.
There is a slight difference between R12.2.4 and R12.2.5.
With the introduction of dualfs in R12.2.5 we can even configure patch filesystem with single run of adcfgclone on the target node.
r1225_clone
Here in the above picture, if run filesystem is on fs2 on the source then on the target also we should configure fs2 as run filesystem and automatically fs1 will become patch filesystem
we copy only EBSApps folder from source fs2 filesystem which is RUN filesystem, to target fs2 filesystem
NOTE: DO NOT COPY EBSApps folder from source fs2 run filesystem to target fs1 folder, this resulted in error.
IF FS2 FILESYSTEM IS RUN THEN WE SHOULD COPY SOURCE EBSApps FOLDER FROM FS2 of source TO TARGET FS2. THIS SHOULD BE DONE AFTER RUNNINGadpreclone.pl ON SOURCE RUN FILESYSTEM.
[applcrp4@crp4app1 fs2]$ cd /d01/oracle/CRP1/fs1
[applcrp4@crp4app1 fs1]$ ls -l
drwxr-xr-x 5 applcrp4 dba 4096 Nov 6 04:49 EBSapps
[applcrp4@crp4app1 fs1]$
[applcrp4@crp4app1 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] :
Running: Context clone...
Log file located at /d01/oracle/CRP1/fs2/EBSapps/comn/clone/bin/CloneContext_1116040449.log
Provide the values required for creation of the new APPL_TOP Context file.
Target System Hostname (virtual or normal) [crp4app1] :
Target System Database SID : CRP1
Target System Database Server Node [crp4app1] : crp4db1
Target System Database Domain Name [ora.ad] :
Target System Base Directory : /d01/oracle/CRP1
Target System Base Directory set to /d01/oracle/CRP1
Target System Current File System Base set to /d01/oracle/CRP1/fs2
Target System Other File System Base set to /d01/oracle/CRP1/fs1
Target System Fusion Middleware Home set to /d01/oracle/CRP1/fs2/FMW_Home
Target System Other File System Fusion Middleware Home set to /d01/oracle/CRP1/fs1/FMW_Home
Target System Web Oracle Home set to /d01/oracle/CRP1/fs2/FMW_Home/webtier
Target System Other File System Web Oracle Home set to /d01/oracle/CRP1/fs1/FMW_Home/webtier
Target System Appl TOP set to /d01/oracle/CRP1/fs2/EBSapps/appl
Target System Other File System Appl TOP set to /d01/oracle/CRP1/fs1/EBSapps/appl
Target System COMMON TOP set to /d01/oracle/CRP1/fs2/EBSapps/comn
Target System Other File System COMMON TOP set to /d01/oracle/CRP1/fs1/EBSapps/comn
Target System Instance Home Directory [/d01/oracle/CRP1] :
Target System Current File System Instance Top set to /d01/oracle/CRP1/fs2/inst/apps/d01_crp4app1
Do you want to preserve the Display [app-upg-app1:0.0] (y/n) : n
Target System Display [crp4app1: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] : enabled
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] : 0
Checking the port pool 0
done: Port Pool 0 is free
Report file located at /d01/oracle/CRP1/fs2/inst/apps/CRP1_crp4app1/admin/out/portpool.lst
UTL_FILE_DIR on database tier consists of the following directories.
1. /usr/tmp
2. /tmp
3. /d01/oracle/d01/11204/appsutil/outbound/CRP1_crp4db1
4. /usr/tmp
Choose a value which will be set as APPLPTMP value on the target node [1] :
The new APPL_TOP context file has been created :
/d01/oracle/CRP1/fs2/inst/apps/CRP1_crp4app1/appl/admin/CRP1_crp4app1.xml
Check Clone Context logfile /d01/oracle/CRP1/fs2/EBSapps/comn/clone/bin/CloneContext_1116040449.log for details.
Creating Patch file system context file.....
Log file located at /d01/oracle/CRP1/fs2/EBSapps/comn/clone/bin/CloneContextPatch_1116040654.log
Target System Other File System Instance Top set to /d01/oracle/CRP1/fs1/inst/apps/CRP1_crp4app1
Target System Port Pool [0-99] : 1
Checking the port pool 1
done: Port Pool 1 is free
Report file located at /d01/oracle/CRP1/fs1/inst/apps/CRP1_crp4app1/admin/out/portpool.lst
The new APPL_TOP context file has been created :
/d01/oracle/CRP1/fs1/inst/apps/CRP1_crp4app1/appl/admin/CRP1_crp4app1.xml
Check Clone Context logfile /d01/oracle/CRP1/fs2/EBSapps/comn/clone/bin/CloneContextPatch_1116040654.log for details.
FMW Pre-requisite check log file location : /d01/oracle/CRP1/fs2/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running: FMW pre-req check...
Configuring: Run file system....
LogFile located at /d01/oracle/CRP1/fs2/inst/apps/CRP1_crp4app1/admin/log/clone/run/RCloneApplyAppstier_11160407.log
Configuring: Patch file system....
LogFile located at /d01/oracle/CRP1/fs2/inst/apps/CRP1_crp4app1/admin/log/clone/patch/RCloneApplyAppstier_11160433.log
Do you want to startup the Application Services for CRP1? (y/n) [n] : n

Services not started

R12.2. Cloning Step-by-Step

Here we go………………….
My First R12.2. Clone
clone_ora
newclone
STEP1:Prepare Souce Node for Cloning
Run adpreclone.pl from RUN File System
cd /d01/oracle/R122/fs1/inst/apps/PROD_idbaprod-appl/admin/scripts/
[applprod@idbaprod-appl scripts]$ adpreclone.pl appsTier
Copyright (c) 2011 Oracle Corporation
 Redwood Shores, California, USA
Oracle E-Business Suite Rapid Clone
Version 12.2
adpreclone Version 120.31.12020000.7
Enter the APPS User Password:
Enter the Weblogic AdminServer password :
Checking the status of the Oracle WebLogic Administration Server....
Running perl /d01/oracle/R122/fs1/EBSapps/appl/ad/12.0.0/patch/115/bin/adProvisionEBS.pl ebs-get-serverstatus -contextfile=/d01/oracle/R122/fs1/inst/apps/PROD_idbaprod-appl/appl/admin/PROD_idbaprod-appl.xml -servername=AdminServer -promptmsg=hide
The Oracle WebLogic Administration Server is up.
Running:
perl /d01/oracle/R122/fs1/EBSapps/appl/ad/12.0.0/bin/adclone.pl java=/d01/oracle/R122/fs1/FMW_Home/jrockit64 mode=stage stage=/d01/oracle/R122/fs1/EBSapps/comn/clone component=appsTier method= appctx=/d01/oracle/R122/fs1/inst/apps/PROD_idbaprod-appl/appl/admin/PROD_idbaprod-appl.xml showProgress

Setting the wls environment
Beginning application tier Stage - Wed Oct 23 04:32:22 2013
/d01/oracle/R122/fs1/FMW_Home/jrockit64/bin/java -Xmx600M -DCONTEXT_VALIDATED=false -Doracle.installer.oui_loc=/oui -classpath /d01/oracle/R122/fs1/FMW_Home/webtier/lib/xmlparserv2.jar:/d01/oracle/R122/fs1/FMW_Home/webtier/jdbc/lib/ojdbc6.jar:/d01/oracle/R122/fs1/EBSapps/comn/java/classes:/d01/oracle/R122/fs1/FMW_Home/webtier/oui/jlib/OraInstaller.jar:/d01/oracle/R122/fs1/FMW_Home/webtier/oui/jlib/ewt3.jar:/d01/oracle/R122/fs1/FMW_Home/webtier/oui/jlib/share.jar:/d01/oracle/R122/fs1/FMW_Home/webtier/../Oracle_EBS-app1/oui/jlib/srvm.jar:/d01/oracle/R122/fs1/FMW_Home/webtier/jlib/ojmisc.jar:/d01/oracle/R122/fs1/FMW_Home/wlserver_10.3/server/lib/weblogic.jar:/d01/oracle/R122/fs1/FMW_Home/oracle_common/jlib/obfuscatepassword.jar oracle.apps.ad.clone.StageAppsTier -e /d01/oracle/R122/fs1/inst/apps/PROD_idbaprod-appl/appl/admin/PROD_idbaprod-appl.xml -stage /d01/oracle/R122/fs1/EBSapps/comn/clone -tmp /tmp -method CUSTOM -showProgress -nopromptmsg
Log file located at /d01/oracle/R122/fs1/inst/apps/PROD_idbaprod-appl/admin/log/StageAppsTier_10230432.log
| 20% completed
Completed Stage...
Wed Oct 23 04:40:32 2013

Step2:WHAT NEEDS TO BE COPIED
----------------------------
Choose only RUN FILE SYSTEM for copying
what1
Prepare Target
mkdir -p /u01/oracle/R122/fs1/
mkdir -p /u01/oracle/R122/fs2/
mkdir -p /u01/oracle/R122/fs_ne/
STEP3:After finishing the copy CONFIGURE TARGET RUN FILE SYSTEM
Go to clone directory
cd /u01/oracle/R122/fs1/EBSapps/comn/clone/bin
RUN perl adcfgclone.pl appsTier
[appltest@rel-dem-test01 bin]$ perl adcfgclone.pl appsTier
Copyright (c) 2011 Oracle Corporation
 Redwood Shores, California, USA
Oracle E-Business Suite Rapid Clone
Version 12.2
adcfgclone Version 120.63.12020000.22
Enter the APPS password :
Running:
/u01/oracle/R122/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper -encryptpwd /u01/oracle/R122/fs1/EBSapps/comn/clone/bin/../FMW/tempinfoApps.txt
Enter the Weblogic AdminServer password :
Running:
/u01/oracle/R122/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper /u01/oracle/R122/fs1/EBSapps/comn/clone/bin/../FMW/tempinfo.txt
Running:
/u01/oracle/R122/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper /u01/oracle/R122/fs1/EBSapps/comn/clone/bin/../FMW/EBSDataSource

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

Running:
/u01/oracle/R122/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -cp /u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/xmlparserv2.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/ojdbc5.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.context.CloneContext -e /u01/oracle/R122/fs1/EBSapps/comn/clone/bin/../context/apps/CTXORIG.xml -validate -pairsfile /tmp/adpairsfile_17052.lst -stage /u01/oracle/R122/fs1/EBSapps/comn/clone 2> /tmp/adcfgclone_17052.err; echo $? > /tmp/adcfgclone_17052.res
Log file located at /u01/oracle/R122/fs1/EBSapps/comn/clone/bin/CloneContext_1023030803.log
Target System File Edition type [run] :run
Provide the values required for creation of the new APPL_TOP Context file.
Target System Hostname (virtual or normal) [rel-dem-test01] :
Target System Database SID : TEST
Target System Database Server Node [rel-dem-prodas01] : rel-dem-testdb01
Target System Database Domain Name [ora.ad] :
Target System Base Directory : /u01/oracle/R122
Target System Base Directory set to /u01/oracle/R122
Target System Current File System Base set to /u01/oracle/R122/fs1
Target System Other File System Base set to /u01/oracle/R122/fs2
Target System Fusion Middleware Home set to /u01/oracle/R122/fs1/FMW_Home
Target System Web Oracle Home set to /u01/oracle/R122/fs1/FMW_Home/webtier
Target System Appl TOP set to /u01/oracle/R122/fs1/EBSapps/appl
Target System COMMON TOP set to /u01/oracle/R122/fs1/EBSapps/comn
Target System Instance Home Directory [/u01/oracle/R122] :
Target System Instance Top set to /u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01
Do you want to preserve the Display [rel-dem-prod01:0.0] (y/n) : n
Target System Display [rel-dem-test01:0.0] : rel-dem-test01:1.0
Target System Root Service [enabled] :
Target System Web Administration [enabled] :
Target System Web Entry Point Services [enabled] :
Target System Web Application Services [enabled] :
Target System Batch Processing Services [enabled] :
Target System Other Services [enabled] :
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] : 0
Checking the port pool 0
done: Port Pool 0 is free
Report file located at /u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01/admin/out/portpool.lst
Complete port information available at /u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01/admin/out/portpool.lst
UTL_FILE_DIR on database tier consists of the following directories.
1. /usr/tmp
2. /tmp
3. /u01/oracle/product/11.2.0/appsutil/outbound/TEST_rel-dem-proddb01
4. /usr/tmp
Choose a value which will be set as APPLPTMP value on the target node [1] :
Creating the new APPL_TOP Context file from :
 /u01/oracle/R122/fs1/EBSapps/comn/clone/context/apps/adxmlctx.tmp
The new APPL_TOP context file has been created :
 /u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-prodas01/appl/admin/TEST_rel-dem-test01.xml
Log file located at /u01/oracle/R122/fs1/EBSapps/comn/clone/bin/CloneContext_1023030803.log
Check Clone Context logfile /u01/oracle/R122/fs1/EBSapps/comn/clone/bin/CloneContext_1023030803.log for details.
Running Rapid Clone with command:
Running:
perl /u01/oracle/R122/fs1/EBSapps/comn/clone/bin/adclone.pl java=/u01/oracle/R122/fs1/EBSapps/comn/clone/bin/../jre mode=apply stage=/u01/oracle/R122/fs1/EBSapps/comn/clone component=appsTier method=CUSTOM appctxtg=/u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01/appl/admin/TEST_rel-dem-test01.xml showProgress contextValidated=true

FMW Pre-requisite check log file location : /u01/oracle/R122/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running: /u01/oracle/R122/fs1/EBSapps/comn/clone/FMW/t2pjdk/bin/java -classpath /u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/engine.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereq.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereqChecks.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstaller.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstallerNet.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/srvm.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl2.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl-log4j.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/xmlparserv2.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/share.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/java oracle.apps.ad.clone.util.FMWOracleHomePreReqCheck -prereqCheckFMW -e /u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01/appl/admin/TEST_rel-dem-test01.xml -stage /u01/oracle/R122/fs1/EBSapps/comn/clone -log /u01/oracle/R122/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Beginning application tier Apply - Wed Oct 23 03:09:54 2013
/u01/oracle/R122/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true -Doracle.installer.oui_loc=/oui -classpath /u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/xmlparserv2.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/ojdbc6.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/oui/OraInstaller.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/oui/ewt3.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/oui/share.jar:/u01/oracle/R122/fs1/FMW_Home/webtier/../Oracle_EBS-app1/oui/jlib/srvm.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/oracle/R122/fs1/FMW_Home/wlserver_10.3/server/lib/weblogic.jar:/u01/oracle/R122/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar oracle.apps.ad.clone.ApplyAppsTier -e /u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01/appl/admin/TEST_rel-dem-test01.xml -stage /u01/oracle/R122/fs1/EBSapps/comn/clone -showProgress -nopromptmsg
Log file located at /u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01/admin/log/ApplyAppsTier_10230309.log
 | 100% completed
Completed Apply...
Wed Oct 23 03:28:43 2013

 Executing command: /u01/oracle/R122/fs1/EBSapps/10.1.2/bin/sqlplus @/u01/oracle/R122/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/truncate_ad_nodes_config_status.sql

Do you want to startup the Application Services for TEST? (y/n) [n] :
Services not started
STEP4:Once we are done with everything. Start the application Tier using adstral.sh
———————————————————————————–
RUN the ENV for the Applciation tier
cd $ADMIN_SCRIPTS_HOME
adstral.sh apps/apps
Provide Weblogic Password:
Once application is up do a sample Health Check.
STEP4:RUN adpreclone on TARGET RUN FILESYSTEM
[appltest@rel-dem-test01 scripts]$ adpreclone.pl appsTier
Copyright (c) 2011 Oracle Corporation
Redwood Shores, California, USA
Oracle E-Business Suite Rapid Clone
Version 12.2
adpreclone Version 120.31.12020000.7
Enter the APPS User Password:
Enter the Weblogic AdminServer password :
Checking the status of the Oracle WebLogic Administration Server....
Running perl /u01/oracle/R122/fs1/EBSapps/appl/ad/12.0.0/patch/115/bin/adProvisionEBS.pl ebs-get-serverstatus -contextfile=/u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01/appl/admin/TEST_rel-dem-test01.xml -servername=AdminServer -promptmsg=hide
The Oracle WebLogic Administration Server is up.
Running:
perl /u01/oracle/R122/fs1/EBSapps/appl/ad/12.0.0/bin/adclone.pl java=/u01/oracle/R122/fs1/FMW_Home/jrockit64 mode=stage stage=/u01/oracle/R122/fs1/EBSapps/comn/clone component=appsTier method= appctx=/u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01/appl/admin/TEST_rel-dem-test01.xml showProgress

Setting the wls environment
Beginning application tier Stage - Wed Oct 23 04:32:22 2013
/u01/oracle/R122/fs1/FMW_Home/jrockit64/bin/java -Xmx600M -DCONTEXT_VALIDATED=false -Doracle.installer.oui_loc=/oui -classpath /u01/oracle/R122/fs1/FMW_Home/webtier/lib/xmlparserv2.jar:/u01/oracle/R122/fs1/FMW_Home/webtier/jdbc/lib/ojdbc6.jar:/u01/oracle/R122/fs1/EBSapps/comn/java/classes:/u01/oracle/R122/fs1/FMW_Home/webtier/oui/jlib/OraInstaller.jar:/u01/oracle/R122/fs1/FMW_Home/webtier/oui/jlib/ewt3.jar:/u01/oracle/R122/fs1/FMW_Home/webtier/oui/jlib/share.jar:/u01/oracle/R122/fs1/FMW_Home/webtier/../Oracle_EBS-app1/oui/jlib/srvm.jar:/u01/oracle/R122/fs1/FMW_Home/webtier/jlib/ojmisc.jar:/u01/oracle/R122/fs1/FMW_Home/wlserver_10.3/server/lib/weblogic.jar:/u01/oracle/R122/fs1/FMW_Home/oracle_common/jlib/obfuscatepassword.jar oracle.apps.ad.clone.StageAppsTier -e /u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-prodas01/appl/admin/TEST_rel-dem-test01.xml -stage /u01/oracle/R122/fs1/EBSapps/comn/clone -tmp /tmp -method CUSTOM -showProgress -nopromptmsg
Log file located at /u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01/admin/log/StageAppsTier_10230432.log
| 20% completed
Completed Stage...
Wed Oct 23 04:40:32 2013

STEP5:SHUTDOWN THE APPLICATION which is running on RUN FILESYSTEM
------------------------------------------------------------------
cd $ADMIN_SCRIPTS_HOME
adstpal.sh apps/apps
provide Weblogic admin password:

STEP6:COPY THE TARGET RUN FILESYSTEM to TARGET PATCH FILESYSTEM
----------------------------------------------------------------
make sure you already created the directory structure like

mkdir -p /u01/oracle/R122/fs1/
mkdir -p /u01/oracle/R122/fs2/<-------------------Here We need to copy EBSapps from /u01/oracle/R122/fs1/
mkdir -p /u01/oracle/R122/fs_ne/
UNSET the application Enviroment.Previously we have executed env.
Before we run adcfgclone.pl dont run any env's, Directly go to /u01/oracle/R122/fs2/EBSapps/comn/clone/bin/ and execute adcfgclone.pl
STEP7:Once Finished copying START CONFIGURING TARGET PATCH FILESYSTEM
---------------------------------------------------------------------
[appltest@rel-dem-test01 bin]$ perl adcfgclone.pl appsTier
Copyright (c) 2011 Oracle Corporation
 Redwood Shores, California, USA
Oracle E-Business Suite Rapid Clone
Version 12.2
adcfgclone Version 120.63.12020000.22
Enter the APPS password :
Running:
/u01/oracle/R122/fs2/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper -encryptpwd /u01/oracle/R122/fs2/EBSapps/comn/clone/bin/../FMW/tempinfoApps.txt
Enter the Weblogic AdminServer password :
Running:
/u01/oracle/R122/fs2/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper /u01/oracle/R122/fs2/EBSapps/comn/clone/bin/../FMW/tempinfo.txt
Running:
/u01/oracle/R122/fs2/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper /u01/oracle/R122/fs2/EBSapps/comn/clone/bin/../FMW/EBSDataSource

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

Running:
/u01/oracle/R122/fs2/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -cp /u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/xmlparserv2.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/ojdbc5.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.context.CloneContext -e /u01/oracle/R122/fs2/EBSapps/comn/clone/bin/../context/apps/CTXORIG.xml -validate -pairsfile /tmp/adpairsfile_4606.lst -stage /u01/oracle/R122/fs2/EBSapps/comn/clone 2> /tmp/adcfgclone_4606.err; echo $? > /tmp/adcfgclone_4606.res
Log file located at /u01/oracle/R122/fs2/EBSapps/comn/clone/bin/CloneContext_1023054232.log
Target System File Edition type [run] : patch
Enter the full path of Run File System Context file : /u01/oracle/R122/fs1/inst/apps/TEST_rel-dem-test01/appl/admin/TEST_rel-dem-test01.xml
Provide the values required for creation of the new APPL_TOP Context file.
Target System Fusion Middleware Home set to /u01/oracle/R122/fs2/FMW_Home
Target System Web Oracle Home set to /u01/oracle/R122/fs2/FMW_Home/webtier
Target System Appl TOP set to /u01/oracle/R122/fs2/EBSapps/appl
Target System COMMON TOP set to /u01/oracle/R122/fs2/EBSapps/comn
Target System Instance Top set to /u01/oracle/R122/fs2/inst/apps/TEST_rel-dem-test01
Target System Port Pool [0-99] : 1
Checking the port pool 1
done: Port Pool 1 is free
Report file located at /u01/oracle/R122/fs2/inst/apps/TEST_rel-dem-test01/admin/out/portpool.lst
Complete port information available at /u01/oracle/R122/fs2/inst/apps/TEST_rel-dem-test01/admin/out/portpool.lst
UTL_FILE_DIR on database tier consists of the following directories.
1. /usr/tmp
2. /tmp
3. /u01/oracle/product/11.2.0/appsutil/outbound/TEST_rel-dem-testdb1
4. /usr/tmp
Choose a value which will be set as APPLPTMP value on the target node [1] :
Creating the new APPL_TOP Context file from :
 /u01/oracle/R122/fs2/EBSapps/comn/clone/context/apps/adxmlctx.tmp
The new APPL_TOP context file has been created :
 /u01/oracle/R122/fs2/inst/apps/TEST_rel-dem-prodas01/appl/admin/TEST_rel-dem-test01.xml
Log file located at /u01/oracle/R122/fs2/EBSapps/comn/clone/bin/CloneContext_1023054232.log
Check Clone Context logfile /u01/oracle/R122/fs2/EBSapps/comn/clone/bin/CloneContext_1023054232.log for details.
Running Rapid Clone with command:
Running:
perl /u01/oracle/R122/fs2/EBSapps/comn/clone/bin/adclone.pl java=/u01/oracle/R122/fs2/EBSapps/comn/clone/bin/../jre mode=apply stage=/u01/oracle/R122/fs2/EBSapps/comn/clone component=appsTier method=CUSTOM appctxtg=/u01/oracle/R122/fs2/inst/apps/TEST_rel-dem-test01/appl/admin/TEST_rel-dem-test01.xml showProgress contextValidated=true

FMW Pre-requisite check log file location : /u01/oracle/R122/fs2/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running: /u01/oracle/R122/fs2/EBSapps/comn/clone/FMW/t2pjdk/bin/java -classpath /u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/engine.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereq.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereqChecks.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstaller.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstallerNet.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/srvm.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl2.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl-log4j.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/xmlparserv2.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/share.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/java oracle.apps.ad.clone.util.FMWOracleHomePreReqCheck -prereqCheckFMW -e /u01/oracle/R122/fs2/inst/apps/TEST_rel-dem-test01/appl/admin/TEST_rel-dem-test01.xml -stage /u01/oracle/R122/fs2/EBSapps/comn/clone -log /u01/oracle/R122/fs2/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Beginning application tier Apply - Wed Oct 23 05:43:35 2013
/u01/oracle/R122/fs2/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true -Doracle.installer.oui_loc=/oui -classpath /u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/xmlparserv2.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/ojdbc6.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/java:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/oui/OraInstaller.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/oui/ewt3.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/oui/share.jar:/u01/oracle/R122/fs2/FMW_Home/webtier/../Oracle_EBS-app1/oui/jlib/srvm.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/oracle/R122/fs2/FMW_Home/wlserver_10.3/server/lib/weblogic.jar:/u01/oracle/R122/fs2/EBSapps/comn/clone/jlib/obfuscatepassword.jar oracle.apps.ad.clone.ApplyAppsTier -e /u01/oracle/R122/fs2/inst/apps/TEST_rel-dem-test01/appl/admin/TEST_rel-dem-prodas01.xml -stage /u01/oracle/R122/fs2/EBSapps/comn/clone -showProgress -nopromptmsg
Log file located at /u01/oracle/R122/fs2/inst/apps/TEST_rel-dem-test01/admin/log/ApplyAppsTier_10230543.log
 / 100% completed
Completed Apply...
Wed Oct 23 06:03:53 2013
Looking for incomplete CLONE record in ad_adop_session_patches table
The CLONE record status is no rows selected
Updating incomplete CLONE record to COMPLETED
STEP8:Once we are done with everything. Start the application Tier using adstral.sh
This time set the env to RUN File System
. /u01/oracle/R122/EBSapps.env run
cd $ADMIN_SCRIPTS_HOME
adstral.sh apps/apps
Hope so this Helps…………………

Useful Scripts

To Find session details using SID. set verify off col sid format 99999 col machine format a10 col program format a25 trunc col username form...