Thursday, October 29, 2020

ADOP online Patching

 

12.2 Patching

 

From R12.2 onwards oracle has introduced online patching functionality.


Online Patching
Online patching uses the latest feature of the Oracle database 11gR2 which is called “Edition Based 
Redefinition” and also uses multiple file systems on the application side. During online patching, business application users continue using the Oracle application and simultaneously a patch or a sequence of patches can be applied to another edition of the same database and application. Another edition here means another exact copy of database and application. And once the patching is complete the users are switched over to a patched file system/database in cutover phase by just bouncing middle tier services.

File System
A R12.2.0 is installed with three file Systems.

1.FS1 – Production file system that is used by application users when system is being patched.

2.FS2 – Exact copy of production used by the patching tool. This copy is patched by the patching tool. It gets synchronized with FS1 by the patching tool before it gets updated by a patch. When patching is complete, the patching tool swaps the FS1 and FS2 file systems. FS2 file system becomes FS1 and FS1 is switched to FS2. This way, FS2 is again ready to be used for any future patching tasks.

3.FS-NE – This is a non-edition file system which stores data that is stored in a file system like data import/export files, report out and log files.

 


Phases of ADOP(online patching)

ADPATCH utility is no longer used in R12.2.0 and is being replaced by ADOP – AD Online Patching. There are five phases or life cycles of ADOP which are:

 

a) PREPARE

b) APPLY

c) FINALIZE

d) CUTOVER

e) CLEANUP

 

 

Steps:-

1.                 Download the patch and unzip on patch_top and go through the read me to check,what its going to do.

 

A) Prepare phase

      Prepare the system for patching

a.     Run environment file(optional)

Note: The adop utility sets its own environment. There is therefore no need to source the environment before running it.

     b.   adop phase=prepare

 

B) Apply Phase -

adop phase=apply patches=, workers=<number_of_worker>

After patch has been successfully applied, complete the patch cycle

 

 C) Finalize phase - Used to perform the final patching operations that can be executed while the application is still online:

 

adop phase=finalize 

 

D) Cutover phase - Used to perform the transition to the patched environment:

adop phase=cutover  

 

E) Cleanup phase - Used to remove old objects that are no longer needed:

adop phase=cleanup 

 

 

-------------------------------------------------------------------------------------------

 

Now synchronise the technology level between patch and run fc_clone.

  adop phase=fs_clone

 

 

 

Abort phaseUsed only if the online patching cycle needs to be terminated before completion:

 

$ adop phase=abort

 

 

 

Important: The abort phase can only be run after the prepare phase and before completion of the cutover phase. After the cutover phase completes, it is no longer possible to abort the online patching cycle.

 

Last two commands for adop

a. adop -help

b. adop -examples

 

 

 

Patch Log Files:-

To review the relevant log files after any patching operation. The adop log files are located on the non-editioned file system (fs_ne), under:

 

$NE_BASE/EBSapps/log/adop//__//log

 

 

Phases:

1.adop phase= prepare --------copies the application code

2.adop phase =apply-------apply patches to patch environment

3.adop phase=finalize-------makes ready the system for cutover

4.adop phase=cutover--------bounce the system and does filesystem switchover fs2 to become Run environment

5.adop phase=cleanup------remove obsolete objects

6.adop phase=fs_clone-----syschronize file systems     

 

##########################   12.2.

 

 

 



How to use ADADMIN Utility

 

AD Admin


               Adadmin is a utility that performs a number of tasks required from maintaining and

administering an Oracle Applications instance. It performs two types of works one is performed at

the database level and other is performed at the file system level. The user is required to provides all the informations at the adadmin prompt.

To start the adadmin login to the APPL_TOP as the owner of the application file system.

..........................................................................

[applmgr@ranesh ~]$ adadmin

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

                     Oracle Applications AD Administration

                                 Version 11.5.0

NOTE: You may not use this utility for custom development
      unless you have written permission from Oracle Corporation.

Your default directory is '/ranesh/raneshappl'.
Is this the correct APPL_TOP [Yes] ?

AD Administration records your AD Administration session in a text file
you specify.  Enter your AD Administration log file name or press [Return]
to accept the default file name shown in brackets.

Filename [adadmin.log] :

You can be notified by email if a failure occurs.
Do you wish to activate this feature [No] ?

Please enter the batchsize [1000] :


Please enter the name of the Oracle Applications System that this
APPL_TOP belongs to.

The Applications System name must be unique across all Oracle
Applications Systems at your site, must be from 1 to 30 characters
long, may only contain alphanumeric and underscore characters,
and must start with a letter.

Sample Applications System names are: "prod", "test", "demo" and
"Development_2".

Applications System Name [ranesh] : ranesh *


Do you currently have files used for installing or upgrading the database
installed in this APPL_TOP [YES] ? YES *


Do you currently have Java and HTML files for HTML-based functionality
installed in this APPL_TOP [YES] ? YES *


Do you currently have Oracle Applications forms files installed
in this APPL_TOP [YES] ? YES *


Do you currently have concurrent program files installed
in this APPL_TOP [YES] ? YES *


You are about to use or modify Oracle Applications product tables
in your ORACLE database 'ranesh'
using ORACLE executables in '/ranesh/raneshora/8.0.6'.

Is this the correct database [Yes] ?

AD Administration needs the password for your 'SYSTEM' ORACLE schema
in order to determine your installation configuration.

Enter the password for your 'SYSTEM' ORACLE schema: manager


The ORACLE username specified below for Application Object Library
uniquely identifies your existing product group: APPLSYS

Enter the ORACLE password of Application Object Library [RANESH] : ranesh

AD Administration is verifying your username/password.
...........................................................................


Once all the answers are given, the adadmin main menu appears.
In this menu there are Six main options. The first two deals with maintaining application file system
eg: re-linking the application, generating the form, regenerating the JAR files etc.

The next two deals with maintaining database objects eg: compiling and validating the schema, compiling the flexfield etc. The fifth option changes the maintenance mode, and sixth is for exist


ADADMIN MAIN MENU:
The main menu adadmin present six options

AD ADMIN MENU
--------------------------------------------------

1. Generate Applications Files menu

2. Maintain Applications Files menu

3. Compile/Reload Applications Database Entities menu

4. Maintain Applications Database Entities menu

5. Change Maintenance Mode

6. Exit AD Administration

first two options are related to maintaining applications file system the second two options relate to database activities, the fifth option here is used to put the system in maintenance mode and bring it back from maintenance mode.



1: Generate Applications File Menu:

Under the Generate Applications Files Menu you can perform the following tasks

Generate Applications Files
----------------------------------------

1. Generate message files

2. Generate form files

3. Generate report files

4. Generate graphics files

5. Generate product JAR files

6. Return to Main Menu



1. Generate message file:

This option generates all the Oracle message files. Oracle Application uses this file to display message.This task generate message binary files (extension .msb) from Oracle Application Library tables.

2. Generating Forms files:

This options generates form files (extension .fmx) from binary forms file (extension .fmb). These files are normally located at AU_TOP, and the executable file are stored under each product directory.

3. Generate report files:

This option generates the Oracle report file (extension .rdf). You can generate report files of a specific products or you can generate reports files of all products.

4. Generate graphic files:

This option generates Oracle Graphic files (extension .ogd) from the graphic definition files.

5. Generate product JAR (Java Archive) files:
This the last option in the menu. It generates JAR files. It sings the JAR files and regenerate the product JAR files in JAVA_TOP and copies them to APPL_TOP.


2 : Maintain Application Files menu:
This menu takes care of the maintenance task required to keep your application files up-to-date. 

Under the Maintain Applications Files menu you can perform the following tasks

Maintain Applications Files
----------------------------------------

1. Relink Applications programs

2. Create Applications environment file

3. Copy files to destinations

4. Convert character set

5. Maintain snapshot information

6. Check for missing files

7. Return to Main Menu


1. Relink Application programs:

This option relinks Oracle Application programs with Oracle server libraries. This option should be use only when asked for specifically by Oracle.

2. Create Applications environment files:

This option create an environment file that defines your system configuration.

3. Copy files to destinations:

This option copies files from each product are to central location, where they can be easily referenced

by non-Application Programs. The file types copied to the respective destinations are

JAVA file to $JAVA_TOP
HTML file to $OAH_TOP
Media files to $OAM_TOP


4: Convert Character set:

This task converts the character set of all translatable files in the APPL_TOP. You should select this

task if you want to change the base language or add additional language to Oracle Applications.

This task has a sub menu.



It scans the APPL_TOP and creates files in $APPL_TOP/admin/$TWO_TASK/outdirectory

admanifest_excp.lst: lists files that will not be converted because of lossy conversion admanifest.lst: lists files that can be converted.

admainfest_lossy.lst: lists files with loss conversion , including line by line details.

Review the files listed in admanifest_excp.lst. Fix the files that report lossy conversion before you
convert the character set.

5: Maintain snapshot information:

Basically there are two types of snapshots 

APPL_TOP: It lists patches and version of files in the APPL_TOP.

Global snapshot: It lists patches and latest versions of files in the entire Application system. (i.e. across all APPL_TOP's)

Both APPL_TOP and global snapshots may be either

Current view snapshot: A Current view snapshot is created once and updated when appropriate to maintain a consistent view. 

named view snapshots: It is a copy of the current view snapshot at a particular time (not necessarily the latest) and it is not updated.

This menu has a sub menu.

 Maintain Snapshot Information menu options :


■ List snapshots (stored in the system)
■ Update current view snapshot (full or partial APPL_TOP and global)
■ Create named snapshot (select a current view snapshot to copy and name)
■ Export snapshot to file (select one to export to a text file)
■ Import snapshot from (a text) file
■ Delete named snapshot (select a snapshot for deletion)


6: Check for missing files:

This option verifies all the file required to run Oracle Applications for the present configuration are there in APPL_TOP, and checks if any are missing. The information about the missing files is written in admvrf.lstfile and its location is $APPL_TOP/admin$TWO_TASK/out.


 3: Compiled/Reload Application Database entities:


 Compile/Reload Applications Database Entities
---------------------------------------------------

1. Compile APPS schema

2. Compile menu information

3. Compile flexfields

4. Reload JAR files to database

5. Return to Main Menu

1: Compile APPS schema:

This option compiles invalid objects in the RANESH schema. Invalid objects in other schema as sys and system are not necessarily compiled. You can use multiple workers for parallel processing.

2: Compile menu information:

It compiles the menu data structure. It needs to be done if compile security concurrent requests submitted from the menu form fail or if you have uploaded menu entries to the FND_MENU_ENTRIES table.

3: Compile flex fields:

It compiles flex field data structure in Applications Object Library (AOL)tables. this needs to be done if the patch application changes the setup of flex field.

4: Reload JAR files to database:

It reloads all the Oracle Application JAR files to the database, choose this option if the patch readme says so or if all Oracle Application Java classes are removed from your database.


4: Maintain Application Database Entities:

Under the Maintain Applications Database Entities menu you can perform the following tasks

Maintain Applications Database Entities
---------------------------------------------------

1. Validate APPS schema

2. Re-create grants and synonyms for APPS schema

3. Maintain multi-lingual tables

4. Check DUAL table

5. Maintain Multiple Reporting Currencies schema

6. Return to Main Menu


1: Validate RANESH schema:

Validating RANESH schema means verifying the integrity of the RANESH schema. It checks whether the RANESH schema has proper roles and privileges or not. This task produces a report named 
<RANESH schema name>.lst, which is located at $APPL_TOP/admin/$TWO_TASK/out.

2: Re-create grants and synonyms for RANESH schema:

It recreates grants and synonyms for APPLSYSPUB, for RANESH schema and for recreating grants on some packages from system to RANESH. Each product's data objects are created in its own schema (such as AP schema) but the user accesses all data objects through the RANESH schema. therefore the RANESH schema must have the appropriate grants and synonyms for those objects.

3: Maintain multi-lingual tables:

This task need to be done after you add a new language. It maintains multilingual tables for Oracle Applications by adding missing, untranslated rows.

4:Check dual table:

It ensures that the dual table exists and has exactly one row. The dual table is created automatically by Oracle along with the data dictionary. This table has one column named "Dummy" of type Varchar2 and contains one row with a value of 'X'.

5: Maintain multiple reporting currencies schema:

It maintains multiple reporting currencies schema (MRC). If MRC functionality is not implements in your database, the option will read 'Convert to Multiple Reporting Currencies schema'.

6: Convert to multi-org:

This option appears as a menu choice only if multi-org is not installed in your database. Using this you can convert to multiple org architecture.


5: Changing Maintenance Mode:

This is the last option of adadmin menu. In Maintenance mode Oracle Application system is made accessible only for patching activities. This provides optimal performance for Auto Patch sessions. Maintenance mode is only needed for Auto Patch session.

Under the Change Maintenance Mode you can do the following

Change Maintenance Mode
----------------------------------------

Maintenance Mode is currently: [Disabled].


Maintenance mode should normally be enabled when patching Oracle Applications and disabled when users are logged on to the system. See the Oracle Applications Maintenance Utilities manual for more information about maintenance mode.

Please select an option:

1. Enable Maintenance Mode

2. Disable Maintenance Mode

3. Return to Main Menu

 

To enable Maintenance mode enter 1
To disable Maintenance mode enter 2 

 


The following table lists the menu options and the corresponding menu tasks:

Menu Option                                     Corresponding AD Administration Menu Choice
GEN_MESSAGES                            Generate message files
GEN_FORMS                                    Generate form files
GEN_REPORTS                                Generate reports files
GEN_JARS                                        Generate product JAR files
RELINK                                             Relink Applications programs
COPY_FILES                                    Copy files to destinations
CONVERT_CHARSET                    Convert character set
SCAN_APPLTOP                              Scan the APPL_TOP for exceptions
SCAN_CUSTOM_DIR                     Scan a CUSTOM directory for exceptions
LIST_SNAPSHOT                             List snapshots
UPDATE_CURRENT_VIEW          Update current view snapshot
CREATE_SNAPSHOT                     Create named snapshot
EXPORT_SNAPSHOT                     Export snapshot to file
IMPORT_SNAPSHOT                      Import snapshot from file
DELETE_SNAPSHOT                      Delete named snapshot
CHECK_FILES                                 Check for missing files
CMP_INVALID                                Compile APPS schema
CMP_MENU                                      Compile menu information
CMP_FLEXFIELDS                                     Compile flexfield data in AOL tables
RELOAD_JARS                                Reload JAR files to database
VALIDATE_APPS                            Validate APPS schema
CREATE_GRANTS                          Recreate grants and synonyms for APPS schema
Menu Option                                     Corresponding AD Administration Menu Choice
MAINTAIN_MLS                             Maintain multi-lingual tables
CHECK_DUAL                                 Check DUAL table
ENABLE_MAINT_MODE               Enable Maintenance Mode
DISABLE_MAINT_MODE                         Disable Maintenance Mode

 

Find Application URL From Database and Context File in Oracle App R12.2

 

Database Level:-

We can find Oracle apps URL from backend following three options

Option:-1

SELECT home_url FROM icx_parameters;

[oracle@ranesh ~]$ sqlplus apps/oracle

SQL*Plus: Release 12.1.0.2.0 Production on Wed Oct 14 18:37:28 2020
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Wed Oct 14 2020 18:34:51 +05:30
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> SELECT home_url FROM icx_parameters;

HOME_URL
——————————————————————————–
http://ranesh.oracle.com:8000/OA_HTML/AppsLogin

Option:-2

SELECT profile_option_value
FROM fnd_profile_option_values
WHERE profile_option_id = (SELECT profile_option_id
FROM fnd_profile_options WHERE profile_option_name = ‘APPS_FRAMEWORK_AGENT’)
AND level_value = 0;

[oracle@ranesh ~]$ sqlplus apps/oracle

SQL*Plus: Release 12.1.0.2.0 Production on Wed Oct 14 18:39:52 2020

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

Last Successful login time: Wed Oct 14 2020 18:37:28 +05:30

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> SELECT profile_option_value
FROM fnd_profile_option_values
WHERE profile_option_id = (SELECT profile_option_id
FROM fnd_profile_options WHERE profile_option_name = ‘APPS_FRAMEWORK_AGENT’)
AND level_value = 0; 2 3 4 5

PROFILE_OPTION_VALUE
——————————————————————————–
http://ranesh.oracle.com:8000

Context File:-

Option:-3

cat $CONTEXT_FILE | grep external

[applmgr@ranesh scripts]$ cat $CONTEXT_FILE | grep external
<soa_external_url oa_var=”s_soa_external_url”>%s_soa_external_url%</soa_external_url>
<externURL oa_var=”s_external_url”>http://ranesh.oracle.com:8000</externURL>

[applmgr@ranesh scripts]$ grep login $CONTEXT_FILE
<login_page oa_var=”s_login_page”>http://ranesh.oracle.com:8000/OA_HTML/AppsLogin</login_page>

 

adstrtal.sh: Database connection could not be established

 

[applmgr@ranesh scripts]$ sh adstrtal.sh apps/oracle


You are running adstrtal.sh version 120.24.12020000.6

Enter the WebLogic Server password:
adstrtal.sh: Database connection could not be established. Either the database is down or the APPS credentials supplied are wrong.

USAGE: adstrtal.sh <appsusername/appspassword> [-nothreading]
adstrtal.sh <applications_username/applications_password> -secureapps
adstrtal.sh -nodbchk

adstrtal.sh: exiting with status 1


Solution
********

 

 [oracle@ranesh ~]$ lsnrctl start

 

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 29-OCT-2020 17:44:41

Copyright (c) 1991, 2029, Oracle. All rights reserved.

Starting /u01/oracle/PROD/12.1.0/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 12.1.0.2.0 – Production
System parameter file is /u01/oracle/PROD/12.1.0/network/admin/PROD_ranesh/listener.ora
Log messages written to /u01/oracle/PROD/diag/tnslsnr/ranesh/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ranesh.oracle.com)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date 29-OCT-2020 17:44:57
Uptime 0 days 0 hr. 0 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/PROD/12.1.0/network/admin/PROD_ranesh/listener.ora
Listener Log File /u01/oracle/PROD/diag/tnslsnr/ranesh/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ranesh.oracle.com)(PORT=1521)))
The listener supports no services
The command completed successfully

 

[oracle@ranesh ~]$ lsnrctl status

 

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 29-OCT-2020 17:45:17

Copyright (c) 1991, 2029, Oracle. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date 29-OCT-2020 17:44:57
Uptime 0 days 0 hr. 0 min. 23 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/PROD/12.1.0/network/admin/PROD_ranesh/listener.ora
Listener Log File /u01/oracle/PROD/diag/tnslsnr/ranesh/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ranesh.oracle.com)(PORT=1521)))
Services Summary…
Service “PROD” has 1 instance(s).
Instance “PROD”, status READY, has 1 handler(s) for this service…
Service “ebs_patch” has 1 instance(s).
Instance “PROD”, status READY, has 1 handler(s) for this service…
The command completed successfully


[oracle@ranesh ~]$

 

Again start the EBSR12.2 Application Server.

 

[applmgr@ranesh scripts]$ sh adstrtal.sh apps/oracle


You are running adstrtal.sh version 120.24.12020000.6

Enter the WebLogic Server password: weblogic1

The logfile for this session is located at /u01/applmgr/PROD/fs1/inst/apps/PROD_ranesh/logs/appl/admin/log/adstrtal.log

Executing service control script:
/u01/applmgr/PROD/fs1/inst/apps/PROD_ranesh/admin/scripts/jtffmctl.sh start
script returned:
****************************************************

You are running jtffmctl.sh version 120.3.12020000.4

Table import and export.

Create Data Pump Directory. The first step in Oracle Data Pump is to create an OS level directory which will be used by Oracle for perform...