Friday, 29 August 2014

adop utility in oracle apps R12.2

What is ADOP?
adop (Online Patching) Patching while End Users are accessing Applications. EBS R12.2 onwards all patching operations are online (system remains available during patching) unlike previous versions where system is unavailable for users during patching (Maintenance Mode).
Online Patching uses Edition Based Redefinition (EBR) which provides two copies of database objects (schema) pre and post patch.

A: Run Edition of database objects: used by online users and is not changed by patching
B: Patch Edition of database objects: used by patching tool and do not affect the running application

Note: There is third edition called Old Edition.
New Run Edition, previous Run Edition is marked as Old Edition. Full Cleanup Operation adop removes Old Edition.

Oracle provides this online patching system by using two Apps tier filesystems named fs1 and fs2 in Application tier, by using edition based redefinition feature of 11gR2 RDBMS in Database Tier.

Phases in adop
Normally, we have 5 phases when applying EBS patch. These phases are prepare, apply, finalize, cutover and cleanup.

Phases must be specified in the order they run, which is the order listed.
Prepareà Prepare the instance for online patching.
ApplyàApply patches to the patch edition.
FinalizeàReady the instance for cutover.
CutoveràPromote the patch edition to become the new run edition.
CleanupàDrop obsolete objects and seed data from old editions.

We start with prepare for synchronizing the patch file system for Applications and the patch version for db tier. Then we continue with apply phase. This phase is actual phase that the patch operations are done. adop uses patch file system to upload new apps tier files and uses the patch edition of the database to take db actions.  After apply we continue with adop=finalize. In this phase, application and database specific actions such as compilation takes place.

So those 3 phases require no downtime, but the next phase which is called cutover need a little downtime. It is automatic though. In cutover phase, adop switches the patched file system and db edition with the current/run file system and db edition. That's why Application Tier components are restarted in this phase. Downtime is coming from restarting the components.
The last phase is cleanup phase. It is self explanatory. In this phase ADOP starts cleaning up the old editions.

Examples of using adop:

To prepare instance for patching
$adop phase=prepare                      

To prepare instance for patching, specify patches, request merge, and apply with 4 workers.
$adop phase=prepare, apply patches=12345, 67890 merge=yes workers=4

To prepare instance for patching and apply patches interactively
$adop phase=prepare, apply

Running all phases in single command:
$adop phase=prepare, apply,finalize,cutover,cleanup patches=patch1,patch2

To apply patches with list of patches in the input_file.
$adop phase=apply input_file=adopsession20120702.txt

To fully automated patching with all parameters taken from input_file:
$adop input_file=adopsessions20120702.txt

To apply patches in hotpatch mode
$adop phase=apply input_file=adopsession20120702.txt hotpatch=yes

Parameters (all are optional):
$adop -status    (Status of the last or specific adop session)
$adop -help      (Provides usage details for the adop command)
cleanup_mode (optional cleanup processing control)
loglevel  (Takes values 'statement', 'exception', 'error', 'unexpected' [default: statement])
defaultsfile        (Path to custom adop defaults file)
patchtop             (Path to the user-specified directory where patches are unzipped)
mtrestart           (Takes values 'yes' or 'no' [default: yes]. Specifies whether to restart
the middle tier services at the end of cutover)

Parameters relevant for the apply phase
workers      (Specify number of parallel workers. If not specified, will be calculated automatically)
merge          (Merge patches before applying. Takes values 'yes' or 'no' [default: yes])
NOTE: This replaces AD Merge Patch

abandon
Abandon Used to specify whether to restart the previous run of adop. 
$adop phase=apply patches=10721639 abandon=yes

restart
Used to specify whether to restart the previous run of ADOP. May be useful if the previous action had an error.
$adop phase=apply patches=10721639 restart=yes

Note: If there was an error in the previous run, and 'abandon' is not set to 'yes', the same parameters will be re-used that were used in the failed run.
If you give a value for the 'restart' parameter, it cannot be the same as the value given for this parameter.

hotpatch
Applies patches in hotpatch mode. Takes values 'yes' or ‘no’ [default: no].
NOTE: This does not require or allow any other phases to be specified except 'apply'.

 How ADOP patches work on Multi node?
Adop patch is online "Patching Tool" uses remote APIs and ssh logging to execute patching operation on remote in a multi node environment. The Node that launch Adop become "Master node" and remote node become "salves".

NOTE: You only need to patch one node in a multi-node shared file system, but you must run AutoConfig manually on all the other nodes.

What is Adop Fs_Clone?
Fs_Clone is a command to copy the file system to the patch file system.
adop patching cycle in NON-INTERACTIVE mode
During apply phase, Non-interactive patching is a way to save time by avoiding some of the prompts and automating the patching process.
You can apply patches in non-interactive way by using a defaults file that contains much of the information you would have supplied at the adop prompts and by creating another file known as input file. Then, when you run adop, you specify the name of the input file. The location of the defaults file will also need to be included in the input file.
$ adop phase=apply input_file=<input_file.txt>

Locations of Default file on both the run APPL_TOP and patch APPL_TOP: $APPL_TOP/admin/<SID>_patch/adalldefaults.txt
NOTE: In R12.2, you don’t need to create this defaults file. The file is already created by oracle process. However you need to create one ‘input file’ to use with adop (The defaults file is not specified on the adop command line. It is the input file.) but in previous release we had to run autoconfig to create this file.
The input_file contents should include the following required parameters:
patches=<patch number>
workers=<number of workers>
patchtop=<directory where patches are staged>
defaultsfile=<defaults file on patch APPL TOP>
 To skip specific patching portion or action during apply phase
$adop phase=apply options=nodatabaseportion, nogenerateportion
In above command we are instructing adop to not run database and generate portion.
Other options can be
options=noactiondetails       (if you do not want the details to be printed.

options=noautoconfig 
if you are applying a number of patches in sequence and want to run AutoConfig only once in the
 end

options=nocheckfile  
to turn off the check file feature. Using check file adop skip some actions which are   already done

options=nocompiledb            when applying multiple NLS, documentations patches etc
options=nocompilejsp           when applying multiple NLS, documentations patches etc
options=nocopyportion        for skipping copy portion of the patch  


If adop phase=abort has run, then before proceeding further run below command

$adop phase=cleanup cleanup_mode=full


Error: Unable to continue as already another user is using adzdoptl.pl.
Previous session exist, cannot continue as per user input.

Workaround: Update the internal adop repository table for the latest session setting the status to completed.

Run the following statement to find out the session that is in running state:
SQL>select adop_session_id from ad_adop_sessions where status='R';

Set the status to 'C' (Completed) for that session, to re-try the phase that was interrupted:

SQL>update ad_adop_sessions set status='C' where status='R;

commit;


And try again!!!



Wednesday, 20 August 2014

Shared Appl_Top and Shared Application Tier file System

In a traditional oracle apps file system, each node had separate APPL_TOP, COMMON_TOP, apps stack components. With this configuration, if an oracle app patch had to be applied, it needs to apply on each node.

In a shared APPL_TOP- APPL_TOP and COMMON_TOP are shared among multiple nodes. Basically, the APPL_TOP and the COMMON_TOP file systems are installed on a shared disk resource which is mounted to each node. However, each node will have separated apps stack components (IAS_ORACLE_HOME and 8.0.6 ORACLE_HOME)

In a shared Application tier file system-APPL_TOP,COMMON_TOP and Apps tech stack (IAS_ORACLE_HOME and 8.0.6 ORACLE_HOME) are shared among multiple nodes. So basically, APPL_TOP,  COMMON_TOP, and the Applications technology stack (ORACLE_HOMEs) are installed on a shared disk resource which is mounted to each node.
Earlier it was shared APPL_TOP and then oracle came out with shared application tier.

All the machines sharing the file system must be configured to run the same Operating System with the same OS patch level. With shared APPL_TOP  and shared application tier file system, oracle apps patch had just to be applied once. However if the patch runs autoconfig (AD patch) then we need to run autoconfig on all the nodes.

Also, on a shared APPL_TOP, if we are applying any patch on 8.0.6 ORACLE_HOME or iAS ORACLE_HOME, then we need to apply it on each application node since the techstack is not shared.
There is a restriction that if you are on Windows, then you CANNOT use shared APPl_TOP/shared application tier.

Monday, 3 March 2014

AD Utilities

1. What are the AD utilities?
2. AD Utilities and their roles?
3. How could i run an AD utility (like adpatch, adadmin, adctrl)?
4. what are the restart files?


1. What are the AD Utilities?

AD Utilities (abbreviation from Applications DBA) are programs which perform a variety of tasks, including generating files, updating your system, merging and applying patches, installing off-cycle products.  
These AD Utilities are executable files in $AD_TOP/bin

  
2. AD Utilities and their roles?

Utility
Executable/ Interface
Role
AD Administration
adadmin
Performs maintenance tasks on the Oracle Applications file system and database.
AutoPatch 
adpatch
Applies patches to the Oracle Applications and Oracle database (also you can add new languages and products as a patch).
AD Controller
adctrl
Which this utility you can restart, see the status of parallel workers in AutoPatch, AD Administration and AutoUpgrade.
AutoUpgrade
adaimgr
Upgrades your database code and objects from an old version to the last 11i version. This is a time consuming step. 
AD Relink
adrelink
Used to re-link apps executables with product libraries. This must be done if some library definition is changed or an executable is corrupted.
AD Merge Patch
admrgpch
Used to merge multiple patches into a single one. This is useful when we have to apply many patches to reduce the patching time.  
AD Splicer
adsplice
Used to register the off-cycle products (a new oracle released product which is not delivered with the initial package). 
File Character Set Converter
adncnv
Used to convert a file from one character set to another.
AD Configuration
$AD_TOP/sql/adutconf.sql
Shows information about the installed configuration of the APPS. 
AD Job Timing Report
$AD_TOP/admin/sql/adtimrpt.sql
Shows timing statistics about the parallel workers. 

AD File Identification

adident

Shows the header file of one Oracle Application file. In the header we can see the version and the timestamp of the file.  
License Manager
Oracle Application Manager
Licenses products, country-specific functionalities or languages.
Patch Wizard
Oracle Application Manager
Determines which patches was applied and which need to be applied.
Applied Patches
Oracle Application Manager
Keeps a history of the patches which have been applied. 

3. How Could I run an AD utility (like adpatch, adadmin, adctrl)?
         AD utilities are like a normal executable files. Type the name of the file to execute press Enter and answer the prompts. Type “abort” to any prompt to exit.
Note:
You can restart the same utility after a failure by typing his name again at the prompt. However, the AD utilities, by default, will start running from the point where it was failed. The utility will ask you to confirm if you want to restart the utility from beginning (oracle recommends continuing a prior session to completion).
AD utilities accept arguments and flags to change the execution behaviour of the AD utility. The arguments must be typed in lowercase without space characters between them.
4. What are the restart files?

     The restart files are used by the managers or workers to restart a failed job. When a job complete the files are deleted, but backup files still are saved on the system with the extensions .bak, .bk2, bk3.
The restart files are located in the $APPL_TOP/admin/<SID>restart directory.

Auto startup an oracle database

1: switch user to oracle software owner
2: edit /etc/oratab file (Keep value as Y save and exit)
3: edit  /etc/rc file (login as root , go to last line and add parameter)

à[root@:server1 ~]# su - oracle

à[oracle@server1 ~]$ vi /etc/oratab
test:/u02/app/oracle/product/11.2.0/dbhome_1:Y
wq!

(Remove value :N and Keep value as :Y for database which you wants to start automatically)

à[oracle@server1 ~]su - root
     [oracle@server1 ~]# vi /etc/rc
su - oracle -c /u02/app/oracle/product/11.2.0/dbhome_1/bin/dbstart

(enter above parameter in /etc/rc file save and exit)

Thursday, 27 February 2014

Restart Failed EBS R12.1.1 installation



















conf_SID.txt This file stores the information collected by Rapid Install for
all database and Applications nodes.

Rapid Install stores copies of the conf_<SID>.txt file in three separate locations:
• Database 11gR1 <ORACLE_HOME>/appsutil: This copy is used on database
nodes, on Applications nodes in multi-node installs, and in upgrades. It is
permanently stored and not deleted.

• $INST_TOP: This copy is used on Applications nodes in multi-node installs, and in
upgrades. It is permanently stored and not deleted.

• /tmp/<time stamp>: This copy is used by Rapid Install during the installation run. It
is deleted when the installation is completed.