Monday, October 17, 2016

Autoconfig

Autoconfig:

Oracle Applications has a complex architecture with many pieces of technology. For example Apache Web server, Apache Jserv, Forms Listener servlet (or forms server) etc. each of these has its own set of configuration files , which need to be set up correctly to function properly. Moreover Oracle Applications uses many profile options (e.g. Applications Web Agent, Applications Framework Agent etc) and other bits of information in the database to make the navigation seamless. These also need to be set correctly to function properly.

Managing these profile options and configuration files manually may give errors.So Autoconfig is a tool provided by the Oracle E-Business Suite to maintain these files and profile options. We can say AutoConfig is a collection of template configuration files that are used in combination with the appropriate database and applications context files to produce standardized environments.

Autoconfig maintains the environment specific values for the  environment in an xml file (stored in $INST_TOP/appl/admin). When autoconfig run it overwrites the existing configuration files with new ones that it creates by merging the templates and the context file, it also updates the database by running the script it instantiates (merging a template with the values in the context file is termed as instantiating the template in Oracle parlance) from the script templates. That’s essentially what autoconfig does i.e. Instantiating configuration files from templates and updating database with values from the xml file. It does not move directories, check for availability of ports, update DNS entries and so on. These have to be done manually

How does it work?

Each configuration file has one corresponding template file (provided by autoconfig patches, stored in $PROD_TOP/admin/template directory). Profile options and other instance specific information in the database is maintained by many sql scripts, called from shell/perl scripts. These scripts also have corresponding template files (also provided by autoconfig patches, in $PROD_TOP/admin/templates).
In these template files all the environment specific values are replaced by placeholders (like %s_webhost%).






How to customize the template for autoconfig files:

First of all we need to decide which file need to be customized and if it is possible to do it

You cannot customize all AutoConfig template files.The AutoConfig template file cannot be customized if the "LOCK" keyword appears in the template file's entry in the product driver file. AutoConfig ignores custom template files that are marked with "LOCK".

For example, the following entry in /admin/driver/adtmpl.drv would prevent customization of the file adconfig.txt:
ad admin/template adconfig.txt INSTE8 /admin adconfig.txt 600 LOCK

Steps to customize the Autoconfig unlock files

1) You must be knowing the product top for the file.So Create the custom directory in $PROD_TOP/admin/template
 Example
a. mkdir $FND_TOP/admin/template/custom
b. chmod 777 $FND_TOP/admin/template/custom

2) Determine the AutoConfig template file one wants to customize:
Execute the following command to find out the corresponding AutoConfig template file for the configuration file one want to customize:

Application /bin/adtmplreport.sh contextfile= target=
Database /appsutil/bin/adtmplreport.sh contextfile= target=

For example
$AD_TOP/bin/adtmplreport.sh contextfile=/appl/admin/.xml
target=$FND_TOP/admin/template/appsweb.cfg

The above command would return "$FND_TOP/admin/template/forms_web_1012_cfg.tmp", means
the "appsweb.cfg" file was created from the source Autoconfig template $FND_TOP/admin/template/forms_web_1012_cfg.tmp.

 3) Copy the "forms_web_1012_cfg.tmp" into custom directory created earlier  and then edit it to your requirements

a.Copy the template $FND_TOP/admin/template/forms_web_1012_cfg.tmp  to  $FND_TOP/admin/template/custom

b. Amend this template file and then run autoconfig ensuring that all applications middle tier processes are not running prior to running autoconfig

Some important points to remember:

1) If new templates comes ,the changes would be lost.  If the patch which replaces the file runs the autoconfig,it would show any complain for new template. But if you run autoconfig manually and you have new version of customized template in admin/template,then it will complain about it

2) We can list all the customized template done through the command

$AD_TOP/bin/adtmplreport.sh contextfile= listcustom



Important Questions:

1.What is the location of adconfig log file?
$INST_TOP/admin/log/

2. Is it possible to restore a autoconfig run?
Partially. Adconfig will create a restore script at $INST_TOP/admin/out/. This restore.sh will copy the backed up files before autoconfig run to its original locations. But the profile values updated in the database can’t be restored back.

3. How to run autoconfig in test mode?
adchkcfg.sh script at $AD_TOP/bin. This script will run autoconfig in test
mode and create the difference file which tells us what is going to change, when u actually run autoconfig.

4. In how many phases autoconfig will run?

Ans : Autoconfig will run in 3 phases.

1.INIT     – Instantiate the drivers and templates
2.SETUP   – Fill the templated with values from xml and create files
3.PROFILE  – Update the profile values in database.

5. Execute the following command to find out the corresponding AutoConfig template file for the configuration file one want to customize:

Application /bin/adtmplreport.sh contextfile= target=
Database /appsutil/bin/adtmplreport.sh contextfile= target=

For example
$AD_TOP/bin/adtmplreport.sh contextfile=/appl/admin/.xml
target=$FND_TOP/admin/template/appsweb.cfg

6.How to Create context file in R12?

Invoke adbldxml.pl from  Database Tier only. A new context file on the database tier can be created using the following command :
perl $ORACLE_HOME/appsutil/bin/adbldxml.pl [template=<contextfile_template>][out=<contextfile_name>

In order to generate the Applications context file on Applications tier, run the adclonectx.pl script.
perl [COMMON_TOP]/clone/bin/adclonectx

7.How to retrieve context file if we lost/corrupted?

To retrieve the applications tier context file ( if it is lost or deleted accidentally) , execute the following command on the applications tier :
perl <COMMON_TOP>/clone/bin/adclonectx.pl retrieve

8. What is driver file and its role?
The driver files list the names and locations of the template files that need to have context variables replaced. They also define the phases into which instantiation is divided, and specify the commands that are to be executed for specific products. When AutoConfig runs, it cycles through the various <PROD>_TOP/admin/driver directories looking for driver files such as adtmpl.drv, fndtmpl.drv, and icxtmpl.drv.

Phases of Operation

As AutoConfig parses the driver files, it carries out a series of actions, grouped into several distinct phases:

INSTE8 - Instantiates AutoConfig template files to the AutoConfig configuration files specified in the relevant template driver files.

INSTE8_SETUP - Executes setup scripts that carry out activities not involving connection to the database.

INSTE8_PRF - Executes setup scripts that update profile options.

INSTE8_APPLY - Executes setup scripts that carry out activities involving updates to the database.

BINCPY - Copies the file mentioned from the source file to the configuration file, creating parent directories for the latter if necessary. AutoConfig will report an error if the source file cannot be found.

BINCPY_IGERR - Copies the file mentioned from the source file to the configuration file, creating parent directories for the latter if necessary. AutoConfig will not report an error if the source file cannot be found.

AutoConfig carries out these actions in the following order:

All INSTE8 and BINCPY actions - Carries out all file instantiations called for during INSTE8, INSTE8_SETUP, INSTE8_PRF and INSTE8_APPLY, and all copying from source files to target configuration files.

INSTE8_SETUP actions - For the files that were instantiated in Step 1, AutoConfig runs all SETUP scripts.

INSTE8_PRF actions - For the files that were instantiated in Step 1, AutoConfig runs all PRF scripts.

INSTE8_APPLY actions - For the files that were instantiated in Step 1, AutoConfig runs all APPLY scripts.

At the end of this process, the required configuration files and profile options have been created for the E-Business Suite installation.


FNDCPASS

What is FNDCPASS?

To change the password in Oracle Applications 11i & R12, The FND binary which will help us is doing these things is FNDCPASS. This is present in $FND_TOP/bin directory.

Below is the usage for FNDCPASS.You can just type FNDCPASS and press enter , it will give you these details.

$ FNDCPASS

Usage: FNDCPASS logon 0 Y system/password mode username new_password

where logon is username/password[@connect]

system/password is password of the system account of that database

mode is SYSTEM/USER/ORACLE

username is the username where you want to change its password

new password is the new password in unencrypted format.

Few Imp Points to Note:


a.The tables that FNDCPASS uses are FND_USER and FND_ORACLE_USERID.
All the application passwords and schema passwords are stored in these two tables along with DBA_USERS.so always backup the above 3 tables before using FNDCPASS.

b. Ensure that the entire Oracle Applications system has been shut down before changing any schema passwords.
       
c.Never update apps, applsys and other product schema password directly from database using the alter command.Database core schema's like sys,system passwords can be changed using ALTER command in database.Applsyspub is a public database schema used in Oracle Applications , This account password can be changed using FNDCPASS.

d.In Oracle Apps 11i (Not needed in R12( when changing the password for APPS it is important to manually change the APPS password in the following:

$IAS_ORACLE_HOME\Apache\modplsql\cfg\wdbsvr.app file
$FND_TOP/resource/wfmail.cfg
$AD_TOP/admin/template/CGIcmd.dat

e.FND_USER and FND_ORACLE_USERID. The FND_USER table stores application user account passwords and the FND_ORACLE_USERID table stores internal Oracle Applications database account passwords.



example:

FNDCPASS apps/apps 0 Y system/manager SYSTEM APPLSYS WELCOME

FNDCPASS apps/apps 0 Y system/manager ORACLE GL GL1

FNDCPASS apps/apps 0 Y system/manager USER VISION WELCOME

0 & Y are flags for FND Executable like FNDCPASS & FNDLOAD where

0 is request id (request ID 0 is assigned to request ID's which are not submitted via Submit Concurrent Request Form. 

'Y' indicates the method of invocation. i.e. it is directly invoked from the command-line not from the Submit Request Form.


1)FNDCPASS apps/apps 0 Y system/manager SYSTEM APPLSYS WELCOME

The above syntax is used for changing the password for apps and applsys.Apps and applsys are database schemas of Oracle Applications.Alter user command should never be used to change the apps & applsys accounts.Oracle recommends using FNDCPASS only to change apps and applsys password.Please note that above command will change the password for both apps and applsys.

When we try to change the password, internally the following will take place.

a.Validations of current applsys & system password
b.Re-encrypt all password in FND_USER & FND_ORACLE_USERID
c.Update apps & applsys password in FND_ORACLE_USERID table.
d.Update DBA_USERS table as well.

2)FNDCPASS apps/apps 0 Y system/manager ORACLE GL GL1

The above syntax is used for changing password for any other product schema like AP,AR,GL etc.

When we try to change the password, internally the following will take place.

a.Validations of current applsys & system password
b.update GL new password in FND_ORACLE_USERID table
c.Update DBA_USERS table as well.

3)FNDCPASS apps/apps 0 Y system/manager USER VISION WELCOME

The above syntax is used for changing the application level passwords like sysadmin etc. front end applications user password.

When we try to change the password, internally the following will take place.

a.Validations of current applsys & system password
b.Update VISION NEW password in FND_USER table.

How to Compile Forms , Reports & Custom.pll in R12.2

How to Compile Custom.pll   cd $AU_TOP/resource  cp CUSTOM.plx CUSTOM.plx_bkup  cp CUSTOM.pll CUSTOM.pll_bkup  frmcmp_batch module=CUSTOM.pl...