Saturday, June 6, 2009

Simple Maintenance

Some of the important utilities for maintenance activities are adadmin, adpatch, adctrl and adident.
This is command line utility which can be invoked as Application owner who is ‘applmgr’ in our case.
Prompts: Many adutilities prompt for necessary information for completing a task
Prompts typically include a description of the information needed, and may include a default answer (in square brackets).
For example:
The ORACLE username specified below for Application Object Library uniquely identifies your existing product group: APPLSYS
Enter the ORACLE password of Application Object Library [APPS] :
Press [Return] to accept the default value, or type a new value after the colon and press [Return].
Some prompts don’t give a default value .For example:
Enter the system user password for Database:
Log Files:
All AD utilities record their processing actions and any errors that they encounter in log files
Many utilities prompt you for the name of the log file that will record the processing session
Filename [.log] :
The default file name is .log
For example, for AD Administration, the default log file is adadmin.log, and for AutoPatch, it is adpatch.log
If a utility stops during processing due to an error, or you use AD Controller (in the case of parallel processing) to shut down workers while they are performing processing tasks, you can restart the utility. If you do, it looks for restart files to determine if there was a previous session. If the files exist, the utility prompts you to continue where the processing left off, or to start a new process. If you choose to continue, it reads the restart files to see where the process left off, and continues the process from that point.
Starting a Utility
To start an AD utility, type the utility’s executable name (start command) on the command line.
For example,
To start AD Administration, you would type:
$ adadmin
When you run AD Administration, the first screen you see is the main menu

If you choose option 1 and press Return you get the following options
1. Generate message files
2. Generate form files
3. Generate report files
4. Generate product Jar files
5. Return to Main Menu
Option 2 in Main Menu gives you the following options:
1. Relink Application programs
2. Copy files to Destinations
3. Convert Character Set
4. Maintain Snapshot Information
5. Check for missing files
6. Return to Main Menu
Option 3 Gives
1. Compile APPS Schema
2. Compile Menu Information
3. Compile Flex fields
4. Reload Jar files to Database
5. Return to Main Menu
Option 4 Gives
1. Validate APPS Schema
2. Recreate grants and synonyms for APPS Schema
3. Maintain Multi-lingual Tables
4. Check Dual table
5. Return to Main Menu
Option 5 Gives
1. Enable Maintenance Mode
2. Disable Maintenance Mode
3. Return to Main Menu

Restarting a Utility
When you restart, the utility prompts you to enter a new log file, or to specify the log file from the interrupted session. When you reuse the log file from a previous session, the utility adds the message “Start of session” to the end of the file and appends messages from the continued session as it generates them.

The utility prompts you to do one of the following:
Continue Session (the default) The utility checks the progress of the previous session in the restart files, and begins processing at the point where your last session stopped.

Start New Session The utility asks you to confirm your choice if you choose not to continue the previous session. It starts the process from the beginning

Exiting or Stopping a Utility
When menu-driven utilities complete a processing task, they return you to the main menu, where you either choose another process or Exit
Before it begins processing tasks, you can stop a utility by typing abort at any prompt. You can use this command only for utilities that display prompts, and only when a prompt is displayed on the screen


Monitoring and Controlling Parallel Processes

AD sessions that use parallel processing may run to completion without user intervention.
However, it is often useful to determine how many jobs have been completed or whether processing has stopped for some reason.
AD Controller is a utility that you can use to determine the status of AD Administration or AutoPatch workers and to control their actions.
Run this utility in its own window, not in the same window as AD Administration or AutoPatch.

Running AD Controller

1. Log in as applmgr
2. Start AD Controller with the adctrl command.
It prompts you to:
■ Confirm the value of APPL_TOP.
■ Specify an AD Controller log file (the default is adctrl.log). The AD Controller log file is written in the current working directory.
■ Supply the Oracle Application Object Library user name and password.
Choose an option from the main menu.
Once you respond to the prompts, the main menu appears.


Use AutoPatch to apply patches to the Oracle Applications file system or database. It gathers necessary information about your system through a series of prompts Once you have completed the prompts, AutoPatch performs all the tasks required to apply the patch, including the following
■ Unloads patch metadata
■ Uploads patch information from a prior patch session to the database (if needed)
■ Reads and validates the patch driver file and reads the product driver files
■ Compares version numbers of object modules from the product libraries and version numbers of the existing files against the patch files ■ Backs up all existing files that will be changed by the patch
■ Copies files
■ Archives the files in libraries
■ Relinks executables
■ Generates forms, reports, message, graphics, and Java archive (JAR) files
■ Compiles JSP files and invalid database objects
■ Updates database objects
■ Runs AutoConfig to update configuration files, if any template files are introduced or updated by the patch
■ Saves patch information to the database so that it is accessible to other patching tools

You run AutoPatch from the command line. It relies on prompts for information, not input screens.

Running AutoPatch

Once you download the patch, copy it to the patch directory created in APPL_TOP and change the ownership to applmgr:dba
Unzip the patch by typing
$ unzip
This creates a directory with the patch number
Go to the directory created by typing
$ cd
Before you run AutoPatch, you must perform some preparatory tasks,
including setting the environment,
shutting down services, and
enabling maintenance mode.
a) Setting the environment is done automatically as we have sourced the consolidated environment file in .bash_profile
as one of the post installation steps
b) Shut down the application services by typing
$ apps/apps
as applmgr user
c) Maintenance mode can be enabled using adadmin
Once you get into adadmin interface , choose the option 5 Change Maintenance mode and Press Return
It returns you another screen with options to enable and disable maintenance mode,choose the appropriate option and enable the maintenance mode

You start AutoPatch with this command:
$ adpatch
Respond to the prompts appropriately.
Specific prompts that need to be taken care of are
a) System password for database
b) Patch log file : The best practice to give a log file is .log
c) Driver file:
Check the driver files the patch is bringing,
by going to the patch directory and type $ ls *.drv
It gives you the driver files and then respond to the prompt for driver file in adpatch session relevantly.
In general the driver file in Applications R12 is u.drv
If there are other drivers present in patch like c.drv ,d.drv and g.drv then adpatch has to be invoked three times one after the other in the following sequence:
c.drv ,
d.drv and

The patch session runs and finishes and finally shows ‘Autopatch is complete’ and shows the log file location also.
Open the log file and check if there are any errors.
Go to the location and type vi .log and go to the end of log file and check.


To check if a patch is applied or not ,login as application owner (applmgr) and type
$ sqlplus /
It returns you SQL prompt. At this prompt type the following query and press Return key
SQL> select bug_number,status from ad_bugs where bug_number=6728000;
Where 6728000 is the patch number
It returns you one row if the patch is applied and No rows selected if the patch is not applied.


Once a patch is applied, disable the maintenance mode using adadmin utility
Start the application services by typing
$ apps/apps
as applmgr user
Once services are up check the front-end by logging into application and opening the forms services.


Sometimes it may be needed to check file versions when taking Oracle support or for debugging any issues with the application.
ADIDENT is the utility to find the file versions.This can be done by typing following command as applmgr user
Go to the location where the file is located
$adident Header
This returns you a line with header of the file consisting of the file version you are looking for .
Let us take an example:
We need to find the file version of POASTDCM.fmx which is located in PO_TOP/forms/US directory
Go to the directory by typing
$cd $PO_TOP/forms/US (note the $ sign before PO_TOP)

Now type
$adident Header POASTDCM.fmx

This returns you one or more lines

$Header APPSSTAND.fmb 120.6.12000000.3 2008/08/01 09:42 mzasowsk ship
$Header POASTDCM.fmb 120.3 2006/08/25 07:02 sdiwakar noship

In general, the first line would be the latest version of the file
The red color number is the file version.
Note that the file name is different because the file name returned to us is the source file and we are searching for the runtime file version.


  1. In R12 how many tables are created while applying patch?

  2. ad_differed_jobs and fnd_install_process these two tables are updated and then it will be automatically droped after the assigned jobs are completed by the workers.