Thursday, January 8, 2009

AutoPatch modes, arguements and options

Filed under: Oracle Application R12, Oracle Applications 11i

Tags: adpatch, adpatch options, patching options

Here are the various options for applying the patch in Oracle apps 11i and R12. ADpatch comes with lots of option that can be used, especially when we are applying the patch in production.

Modes of ADPATCH

If we talk about the mode of applying patch, there are 3 modes

1) Pre-Install Mode

Pre-install mode is used to update AD utilities before an upgrade and to apply family consolidated upgrade packs.
AutoPatch Pre-AutoInstall mode allows you to apply patches when your installation is missing database information and/or filesystem information that AutoPatch requires to run in normal mode.

Examples of when you would run AutoPatch in Pre-AutoInstall mode (and cannot run it in normal mode) include:

Prior to installing Oracle Applications for the first time
Prior to upgrading Oracle Applications to the latest release.
During an upgrade (to apply a bug fix that stopped your upgrade)

Applying patch in pre-install mode performs following tasks:

1.Version checking
2.File copy actions
3.Relink FND and AD executables
4.Save patch history information to file system
5.AutoPatch in pre-install mode will NOT:
6.Run SQL of EXEC command
7.Generate files
8.Read product driver files
9.Apply maintenance pack

To apply patch in pre-install mode, run

$adpatch preinstall=y



2) Test Mode

AutoPatch provides a test mode in which it tells you everything it would have done in applying a patch, but doesn’t actually apply the patch.
To run AutoPatch in Test Mode, you must include ‘apply=no’ on the AutoPatch command line.

For example:
$ adpatch apply=no

Instead of performing an action, AutoPatch indicates that it is not performing the action because “Apply=No”. In general, AutoPatch lists each file it would have copied, generated, relinked, or executed. This shows you exactly what actions it would have performed.

AutoPatch test mode works the same as normal mode, with the following exceptions:

1.It does not copy any files from your patch directory into your installation area.
2.It does not copy any files from your APPL_TOP to JAVA_TOP or OAH_TOP.
3.It does not archive any object modules into your product libraries.
4.It does not generate any forms or reports.
5.It does not relink any executables.
6.It does not run any ’sql’ or ‘exec’ commands.
7.It does not update the release version in the database.
8.It does not update the patch history file.

AutoPatch asks you the same initial questions in test mode as in normal mode. It performs the following actions to determine what it would have done if run in normal mode:

1.Reads and validates the patch driver file.
2.Reads product file driver files.
3.Extracts object modules from your product libraries (so it can perform version checking on the object modules it extracts).
4.Performs version checking.
5.Looks in the database to determine what ’sql’ and ‘exec’ comands it would have run.

Its a good practice to run the patch in test mode and analyze the things before applying the patch in normal mode.

3) Non-Interactive Mode

Starting in Release 11.5, you can run AutoPatch non-interactively.

Creating a defaults file

Before you can run AutoPatch non-interactively, you must first create an AutoPatch defaults file for your current environment.

Here is a simple way to create an AutoPatch defaults file for your current environment:


1. Specify defaultsfile= on the AutoPatch command line. The defaults file must be located under $APPL_TOP/admin/.

For example:
adpatch defaultsfile=$APPL_TOP/admin/testdb1/my_def.txt

2. Run AutoPatch up to the point where it asks you for the directory where your Oracle Applications patch has been unloaded. Then type ‘abort’ at this prompt.

3. Verify that your defaults file exists.
Once you have an AutoPatch defaults file for your current environment, you can run AutoPatch non-interactively.

Applying a single patch driver file non-interactively

Before applying any Oracle Applications patch, either interactively or non-interactively, you should read the README file (usually called readme.txt) supplied with the patch. You should also read the documentation supplied with the patch (if any).

It is possible to apply just a single patch driver file non-interactively using AutoPatch. Here is an example:

Assume the following:

1. defaults file is $APPL_TOP/admin/spin/def.txt
2. Applying copy driver for patch 123456, which is located in directory $APPL_TOP/patch/123456.
3. Using three parallel workers
AutoPatch log file name is cpy123456.log

The AutoPatch command line would be:

adpatch defaultsfile=$APPL_TOP/admin/spin/def.txt \
logfile=cpy123456.log \
patchtop=$APPL_TOP/patch/123456 \
driver=c123456.drv \
workers=3 \
interactive=no


If we dont give any of the mode as mentioned above and apply the patch simply using adpatch command then its a normal mode of patch application.

Having seen the modes of patch application, now we will see various arguements for applying patch.

1) defaultsfile
Purpose: This option is used when we are running the patch in non interactive mode. In that case we create defaults file and provide that file as an option for running patch in non-interactive mode.
Default: none. No default file read or written.

2) logfile
Purpose: This is the name of adpatch log file which it will write during patch application.
Default: none. Adpatch prompts for this value.

3) workers
Purpose: Specifies the number of workers to run. This value depends on number of CPU and other factors.
Default: none. Adpatch prompts for this value.

4) patchtop
Purpose: Top-level directory for the current patch. This is the directory after unzipping the patch. This directory will a patch number.
Default: none. Adpatch prompts for this value.

5) driver
Purpose: Name of the patch driver file. This comes with the patch and is present in patch directory.
Default - none. Adpatch prompts for this value.

6) restart
Purpose: To restart an existing session. Only valid when interactive=no is also specified
Default: No

7) localworkers
Purpose: Used in Distributed AD to specify the number of workers to be run on the current machine. If you have multi node instance (example RAC and shared APPL_TOP), then you can utilize this paramter to run the patch parallely in multiple nodes. You can start few workers on node 1, few on node 2 and so on. The way this can be done is that, you can start adpatch on one node with localworker=. Then run adctrl on other node in distributed mode and start some mode workers. This will speed up the process and utilized the resources effectively.
Default: Value specified for workers.

8. printdebug
Purpose: To display extra debugging information.
Default: No.

Now lets consider some common options that can be used with adpatch options=

1) checkfile
Purpose: To skip running exec, SQL, and exectier commands if they are recorded as already run. Indicates that Autopatch should run the command *only* if a certain file is newer than the version of it that was last run. The idea behind it is to reduce the duration of an Autopatch session by skipping actions that don’t really need to be performed. When used in the right manner, it can dramatically improve Autopatch performance, especially for big patches and/or long running actions.
Default: checkfile (use ‘nocheckfile’ to skip)

2) compiledb
Purpose: To compile invalid objects in the database after running actions in the database driver.
Default: compiledb (use ‘nocompiledb’ to skip)

3) compilejsp
Purpose: To compile out-of-date JSP files, if the patch has copy actions for at least one JSP file.
Default: compilejsp (use’nocompilejsp’ to skip)

4) copyportion
Purpose: To run commands found in a copy driver. This will copy the higher version files from patch to product top.
Default: copyportion (Use ‘nocopyportion’ to skip. Use it only when mentioned in readme of patch)

5) databaseportion
Purpose: To run commands found in a database driver. This portion includes applying the files (like sql, pls etc) to database.
Default: databaseportion (use ‘nodatabaseportion’ to skip. Use it only when mentioned in readme of patch)

6) generateportion
Purpose: To run commands found in a generate driver. This portion will generate new executable files from the copied code of patch. For example if will generate new forms files (fmx) from new .fmb files.
Default: generateportion (use ‘nogenerateporation’ to skip)

7) integrity
Purpose: To perform patch integrity checking. Tells adpatch whether to perform patch integrity checking, which verifies that the version of each file referenced in a copy action matches the version present in the patch.
Default: nointegrity (By default the integrity is not checked)

8. maintainmrc

Purpose: To maintain the MRC schema after running actions found in the database driver.
Default: maintainmrc (use ‘nomaintainmrc’ to skip)

9) autoconfig
Purpose: Tells adpatch to run Autoconfig after patch installation.
Default: autoconfig (use ‘noautoconfig’ to skip)

10) parallel
Purpose: To run actions that update the database or actions (like SQL) that generate files in parallel (like genform).
Default: parallel (use ‘noparallel’ to skip)

11) prereq
Purpose: Tells adpatch whether to perform prerequisite patch checking prior to running patch driver files that contain actions normally found in the copy driver.
Default: prereq (use ‘noprereq’ to skip)

12) validate

Purpose: To connect to all registered Oracle Applications schemas at the start of the patch. Adpatch validates the passwords for each schema.
Default: novalidate (use ‘validate’ to validate schema passwords)

Following flags can be passed to adpatch:

1) hidepw
Purpose: This argument is used to hide the passwords in log files
Default: nohidepw

2) trace
Purpose: Tells the adpatch utility whether to log all database operations to a trace file
Default: notrace

3) logging
Purpose: Tells the adpatch utility whether to create indexes using the logging or nologging mode.
Default: logging

Hope this helps !!

Important tables for ADPATCH

Filed under: Oracle Application R12, Oracle Applications 11i
Tags: ad tables, adpatch tables, etrm

Here are some of the important tables used by and updated by ADPATCH utility.

AD_APPL_TOPS

This table holds the various APPL-TOP’s in the Oracle Applications installation that have ever been patched.


AD_APPLIED_PATCHES


AD_APPLIED_PATCHES holds information about the “distinct” Oracle Applications patches that have been applied. If 2 patches happen to have the same name but are different in content (eg. “merged” patches), then they are considered distinct and this table will therefore hold 2 records.

AD_BUGS

AD_BUGS holds information about the various Oracle Applications bugs whose fixes have been applied (ie. patched) in the Oracle Applications installation.

AD_PATCH_DRIVERS

This table holds information about the patch drivers that comprise a patch.

AD_FILE_VERSIONS
This table holds the various versions of Oracle Applications files (real files, not “pseudo-files”), that have ever been patched or executed in the Oracle Applications installation.

AD_FILES

AD_FILES is the “files repository”. It contains information about the various files that have been patched in the Oracle Applications installation.
Some entries are “pseudo-files” and not real files, (eg. directories) in which case some of the columns are not applicable and would then hold the value “DUMMY”

AD_PATCH_DRIVER_LANGS

NLS patches (or more specifically, NLS patch drivers) pertain to a language or multiple languages. This table holds that language (or multiple languages).

AD_PATCH_DRIVER_MINIPKS

This table holds information about the various Mini Packs contained in a patch (driver)

AD_PATCH_RUN_BUG_ACTIONS

holds the various actions present in “applied” bug (fix). If Autopatch determined not to apply a bug (fix), then this table will not hold any records for that “unapplied” bug fix.

AD_PATCH_RUN_BUG_ACTIONS

Even though a patch may have been applied on an Oracle Applications installation, some actions in some of its included bugs (fixes) may not have got executed if the “Autopatch” utility determined that it was not necessary to execute those actions. In such cases, EXECUTED_FLAG is set to N.

AD_PATCH_RUN_BUGS

This table holds information about the bugs fixed in a specific run of Autopatch.
AD_PATCH_RUN_BUGS holds information about the various bugs fixed in a specific run of Autopatch.
Even though a patch may have been applied on an Oracle Applications installation, some bugs (fixes) contained in it may not get applied due to some reason. In such cases, the REASON_NOT_APPLIED column holds the reason.

AD_PATCH_RUNS

AD_PATCH_RUNS holds information about the various invocations of Autopatch for applying Oracle Applications patches to a specific release of an Oracle Applications installation.
If multiple drivers are run in one invocation of Autopatch, they result in multiple records in this table. These multiple records will all have the same SESSION_ID (because they arose from one Autopatch invocation), but different TASK_NUMBER’s. The TASK_NUMBER’s in this case will be numbered sequentially as 1, 2, 3, etc.
Note that when the database driver of a Maintenance Pack is applied, it bumps up the release version by creating a new record in AD_RELEASES, which is then pointed to by the UPDATED_TO_RELEASE_ID column of the old record.

AD_RELEASES

AD_RELEASES holds the various Oracle Applications releases that an installation of Oracle Applications has gone through in its entire life cycle.
It should be noted that START_DATE_ACTIVE, END_DATE_ACTIVE and BASE_RELEASE_FLAG are loosely-maintained informational columns and are not accurately maintained, and therefore should not be relied upon heavily.

AD_PATCH_COMMON_ACTIONS

This table holds distinct information about the various actions that are (often repeatedly) performed by Autopatch as part of applying patches.

References:

Metalink ETRM DIRECT ACCESS DOCUMENT 150230.1

Hope this helps!!

Monday, January 5, 2009

EBS Forms problem in Windows Vista / Server 2008

This is the problem with JInitiator. The DLL (Dynamic Link Libraries) file present in the JInitiator is not supported by VISTA / Windows Server 2008. Need to replace them with the latest one.
1. Go to (JInitiator installed location)\bin\hotspot
(Default JInitiator installed location: C:\Program Files\Oracle\JInitiator 1.1.8.16)
2. Find ‘jvm.dll’ file
3. Replace this with the latest one

Latest version of this file can be found here.
1. If you have latest Java / JRE installed on your system, go to 
(JRE installed location)\bin\client -> here you can find the jvm.dll file, copy this file and paste it in \bin\hotspot, click yes, when prompts for replace.
(Default JRE installed location: C:\Program Files\Java\jre1.6.0_07)

Note: Update the jre to the latest version before replacing jvm.dll file to ensure that you are replacing with the latest one.
 

Invalid range "a-Z" in transliteration operator

Error while running Pre-Clone Script.

Environment : Linux A.S.4
Bit : 32
Version : 11.5.10


[applspin@spinner SPIN_spinner]$ ./adpreclone.pl appsTier
Invalid range "a-Z" in transliteration operator at /d02/applspin/spinora/iAS/Apache/perl/lib/5.00503/vars.pm line 17.
Compilation failed in require at /d02/applspin/spinora/iAS/Apache/perl/lib/5.00503/File/Copy.pm line 13.
BEGIN failed--compilation aborted at /d02/applspin/spinora/iAS/Apache/perl/lib/5.00503/File/Copy.pm line 13.
Compilation failed in require at ./adpreclone.pl line 36.
BEGIN failed--compilation aborted at ./adpreclone.pl line 36.


Solution:

Open $IAS_ORACLE_HOME/Apache/perl/lib/5.00503/vars.pm and change (line 17):

if ($sym =~ tr/A-Za-Z_0-9//c) {

change to
if ($sym =~ tr/A-Za-z_0-9//c) {

(The change is the single character Z->z)

[applspin@spinner SPIN_spinner]$ ./adpreclone.pl appsTier
Completed Successfully


Reference: From Forums.

https://metalink2.oracle.com/metalink/plsql/f?p=200:27:7385154415821451567::::p27_id,p27_show_header,p27_show_help:677071.993,1,1