Thursday, March 31, 2022

Missing PATCH FS CONTEXT FILE in FND_OAM_CONTEXT_FILES Table

When running adop validate command we get the below error,

ERROR

# adop -validate

Use of uninitialized value $result in split at /u01/fs1/EBSapps/appl/au/12.0.0/perl/TXK/ADOPValidationUtils.pm line 1294.

No such file or directory at /u01/fs1/EBSapps/appl/au/12.0.0/perl/TXK/ADOPValidationUtils.pm line 230.

VERIFICATION:

SQL> select distinct(PATH) from FND_OAM_CONTEXT_FILES 

where NAME not in ('TEMPLATE','METADATA','config.txt') 

and CTX_TYPE='A' 

and (status is null or upper(status) in ('S','F')) 

and EXTRACTVALUE(XMLType(TEXT),'//file_edition_type') = 'patch';

NO ROWS RETURNED

NOTE: Never apply the below solution if the above query return an rows. 

This means PATCH FS CONTEXT FILE IS MISSING IN FND_OAM_CONTEXT_FILES TABLE.

SOLUTION

Source the patch file system environment file

$ echo $FILE_EDITION

Patch

$ echo $CONTEXT_FILE

/u01/inst/apps/TESTPDB_ed-olapplin1/appl/admin/TESTPDB_ed-olapplin1.xml

Now sourcing the run file system upload the patch file system’s context file to the database

$ADJVAPRG oracle.apps.ad.autoconfig.oam.CtxSynchronizer action=upload contextfile='/u01/inst/apps/TESTPDB_ed-olapplin1/appl/admin/TESTPDB_ed-olapplin1.xml
' logfile=/tmp/patchctxupload.log

Enter the APPS password:

SQL> select distinct(PATH) from FND_OAM_CONTEXT_FILES 

where NAME not in ('TEMPLATE','METADATA','config.txt') 

and CTX_TYPE='A' 

and (status is null or upper(status) in ('S','F')) 

and EXTRACTVALUE(XMLType(TEXT),'//file_edition_type') = 'patch';

PATH:

/u01/inst/apps/TESTPDB_ed-olapplin1/appl/admin/TESTPDB_ed-olapplin1.xml

Now re-run adop -validate and it will work fine.