Wednesday, September 5, 2012

So... you have a duplicate Context File... now what?


Trying to pre-validate an EBS System (12.0.6) to work with Oracle Enterprise Manger Cloud Control 12c, I was having some issue with my EBS.  


Context variable details: 
**********************************************************************
|EBS Hostname| Context Variable| Context Value | 
**********************************************************************
|apps01 | s_hostname | apps01 | 
----------------------------------------------------------------------
|apps01 | s_appsuser | apporia | 
----------------------------------------------------------------------
|apps01 | s_appsgroup | oaa | 
----------------------------------------------------------------------
|apps01 | s_port_pool | 20 | 
----------------------------------------------------------------------
|apps01 | s_config_home | /u01/oria/inst/apps/oria_apps01
----------------------------------------------------------------------
|apps01 | s_atName | dbs01 | 
----------------------------------------------------------------------
|dbs01 | s_hostname | dbs01 | 
----------------------------------------------------------------------
|dbs01 | s_appsuser | apporia | 
----------------------------------------------------------------------
|dbs01 | s_appsgroup | oaa | 
----------------------------------------------------------------------
|dbs01 | s_port_pool | 20 | 
----------------------------------------------------------------------
|dbs01 | s_config_home | /u01/oria/inst/apps/oria_dbs01 | 
----------------------------------------------------------------------
|dbs01 | s_atName | dbs01 | 
----------------------------------------------------------------------
|apps01 | s_hostname | apps01 | 
----------------------------------------------------------------------
|apps01 | s_appsuser | apporia | 
----------------------------------------------------------------------
|apps01 | s_appsgroup | oaa | 
----------------------------------------------------------------------
|apps01 | s_port_pool | 20 | 
----------------------------------------------------------------------
|apps01 | s_config_home | /u05/oria/inst/apps/oria_apps01|  (This is NOT right)
----------------------------------------------------------------------
|apps01 | s_atName | dbs01 | 
----------------------------------------------------------------------


Well, happened that this EBS is a Shared File System Configuration and for some reason when they made the cloning process, they change the mounting point of the file system on the apps server, like this:


On DBS01 (where is my dbTier)


Mouting point: /u01

On APPS01 (where is running Forms, Reports and Web Tier)

Mounting point: /u05 (it should be /u01 as well)

So in first instance you may be facing some "adconfig.txt" issues, regarding the expected path (the one on the "adconfig.txt" and the one that it really is.) This is when you tried to run adadmin or adpatch.

Now, what next? Of course you may want to change this paths to make sure all your ad Utilities run the way they should.

You need to change the paths of the file system in the Context File, if you don't know where it is you can execute an (remember this is in our APPS01):

echo $CONTEXT_FILE

you should get an output like this:

/u05/oria/inst/apps/ORIA_apps01/appl/admin/ORIA_apps01.xml

You may want to take a backup of the context file before edit it (you know... just in case)


cp -p /u05/oria/inst/apps/ORIA_apps01/appl/admin/ORIA_apps01.xml 
/u05/oria/inst/apps/ORIA_apps01/appl/admin/ORIA_apps01.xml.old

after this, edit the file with the correct file system, you can do this with this command in the "vi"


:%s/u05/u01/g 


The next thing you need to do, is mount the file system on APPS01 in the right directory, in this case /u01.


The next step you thing you should be doing is run autoconfig, but if you want to save you a little headache, you will need to follow the next steps, referenced in Note Duplicate Entries Exists In FND_OAM_CONTEXT_FILES During Ebs Discovery From Amp/Grid Control [ID 1053869.1]

1. Backup the fnd_oam_context_files table in the EBS env:

sqlplus applsys/pwd 

create table fnd_oam_context_files_bkp as select * from fnd_oam_context_files;

2. Truncate this table:

truncate table fnd_oam_context_files;

3. Run autoconfig in the DB tiers to populate fnd_oam_context_files table with the database information;

4. Run autoconfig in each Apps tier to populate fnd_oam_context_files with the application tier information;

5. From the EBS agent home, run:

./emctl upload

This will upload the information from the EBS system to Grid Control

6. Re-run the Discovery process.


I'm still having other issues regarding the next pre-validation step. 
So, I'll keep you posted.