Pages

Recently Viewed

Saturday, March 16, 2013

Generic UNIX script to import OAF personalizations

Below is the piece of UNIX which will import OAF personalization to system.  This is a common script and will work for all CO, VO extension or other OAF personalization.
 
 
# ***********************************************************************************************************
#  Import OAF Personalizations
# ***********************************************************************************************************
echo "# ******************************************************************************" >> $v_log
echo "# Import OAF Personalizations" >> $v_log
echo "# ******************************************************************************" >> $v_log
echo ""
echo "Immporting OAF Personalizations...."
 
########### Import CO Extension & Other Personalizations ################################
for file in `find unzipped_folder | grep PG.xml`
do
                                v_file_name=`echo $file | rev | cut -d "/" -f1 | rev`
                                lv=`echo $file | sed s/$v_file_name/"@"/g | cut -d "@" -f1`
                                v_MDS_RN=`echo $JAVA_TOP/$lv`
                                v_rootPackage=`echo $lv | sed s/" unzipped_folder "/"@"/g | cut -d "@" -f2`
                                                               
                                echo "File Name : $v_file_name" >>$v_log
                echo "lv :: $lv" >>$v_log
                                echo "MDS_RN : $v_MDS_RN" >>$v_log
                                echo "Root Package : $v_rootPackage" >>$v_log
     
                                 java oracle.jrad.tools.xml.importer.XMLImporter ${v_MDS_RN}${v_file_name} -username apps -password $v_apps_schema -dbconnection "$lv_jdbc" -rootdir ${v_MDS_RN} -rootPackage $v_rootPackage >>$v_log
 
                                if [ $? != 0 ];then
                                                echo "ERROR - Failed while importing $file"   >>$v_log
                                                echo "ERROR - Failed while importing $file"  
                                else
                                                echo "Import $file successfully "  >>$v_log
                                fi
                                echo " " >> $v_log
done
 
 
########### Import VO Extension################################
for file in `find xxxxx | grep .jpx`
do
                                v_file_name=`echo $file | rev | cut -d "/" -f1 | rev`
                                lv=`echo $file | sed s/$v_file_name/"@"/g | cut -d "@" -f1`
                                v_MDS_RN=`echo $JAVA_TOP/$lv`
                               
                                                               
                                echo "File Name : $v_file_name" >>$v_log
                                echo "lv :: $lv" >>$v_log
                                echo "MDS_RN : $v_MDS_RN" >>$v_log
                                      
                                 java oracle.jrad.tools.xml.importer.JPXImporter ${v_MDS_RN}/${v_file_name} -username apps -password $v_apps_schema -dbconnection "$lv_jdbc" >>$v_log
 
                                if [ $? != 0 ];then
                                                echo "ERROR - Failed while importing $file"   >>$v_log
                                                echo "ERROR - Failed while importing $file"  
                                else
                                                echo "Import $file successfully "  >>$v_log
                                fi
                                echo " " >> $v_log
done
fi
# ******************************************************************************
 
 
 
Prerequisite is to place all java,class & XML files at correct folder path. For example if we are extending the agreement CO.  File structures should be –
 
xxxx.oracle.apps.po.documents.agreement.webui
*.class
*.java
xxxx.oracle.apps.po.documents.agreement.webui.customization.site/responsibility.0/responsibility_id
*.xml
 

 

 

Sunday, March 3, 2013

FNDLOAD+

FNDLOAD+ is extended (customized) standard FNDLOAD utility to upload LDT files.
 
How to use -
  • Login to server
  • Go to any directory (/staging/Sandeep)
  • Place all your LDT files
  • Call FNDLOAD+
 
User Inputs -
 FNDLOAD+ will ask for Apps DB password
 
Syntax-
[Unix server sandeep] $ FNDLOAD+
 
What is  +  in this?
  • Not required to use complete FNDLOAD syntax
  • Not required to know the LCT file name for upload
  • Single run is required to upload all LDT files available in current dir
 
 
How to get FNDLOAD+ available in my environments –
  • Check the $PATH variable       (echo $PATH)
  • Go to any of the defined dir  (cd ….)
  • Create file Sandeep.sh
  • Create FNDLOAD+ (cp Sandeep.sh FNDLOAD+)                                                              
***** Only to UPLOAD ldt files*************


 
 

Saturday, March 2, 2013

UPLOAD LDT Files using shell script

Requirement is to migrate the configuration files (LDTs) across environments.
 
Resolution - FNDLOAD is Oracle provided utility to achieve this by passing certain inputs. The required inputs are
1)       DB credentials
2)       Respective LCT name
This is very commonly and frequently used utility in EBD development.
 
Through this post we are sharing a shell script which can exclude LCT name parameter knowledge for LDT migration.
 
# !/bin/sh
 
echo "Enter APPS password : "
stty -echo
read v_apps_schema
stty echo
 
for file in `ls *.ldt`
do
v_ext=`echo | cut -d "." -f2`
v_lct=`grep "patch/115/import/" $file | cut -d "@" -f2`
echo "File Name    :$file" 
echo "Control File :$v_lct"
FNDLOAD apps/$v_apps_schema 0 Y UPLOAD @$v_lct $file
if [ $? != 0 ];then
echo "ERROR - Failed while uploading $file" 
else
echo "Uploaded $file successfully " 
fi
done
 
  • Copy the above script and save this as Sandeep.sh
  • $Dos2unix Sandeep.sh
  • Place the source LDT files and Sandeep.sh
  • $sh Sandeep.sh
 

How to get JDBC Connection details

In EBS JDBC connection are required while migrating XML files to other environments. XML files are source for XML publisher reports and OAF personalization.
Like FNDLOAD Oracle has provided JPXimporter and XDOloder java utilities to inport XML data into standard database tables. Java utilities require JDBC connection in order to execute and hence below are 2 methods to get JDBC connection.
 
 
Method 1 > Using Database
Parameters
Oralce Functions
Host Name/IP Address
UTL_INADDR.get_host_address
SID
sys_context('userenv','instance_name')
Port
Hard Code
 
 
 
Method 2 > Using context files
Server has context file to store all context details. One can connect to server and extract the jdbc connection string using unix command.
 
lv_contxtfile=`echo $CONTEXT_FILE`
echo "CONTEXT_FILE  : $lv_contxtfile"
lv_jdbc=`grep '</jdbc_url>' $lv_contxtfile | cut -d "@" -f2 | cut -d "<" -f1`
echo "JDBC COnnection String : $lv_jdbc"
 
o    Echo $CONTEXT_FILE will list the context file name with full path
o    Grep will search string “</jdbc_url>” in context file and returned line will be cut from literal “@”. –f2 will return the right side portion from “@”.
o     Which will be cut further with literal “<” and -f1 will return the left side portion now.
o The final output should be complete JDBC_STRING, which can be used.
 
 
** Thanks to my colleagues Srini & Manish for above info **

 

 

SQL to find XML Files (RTF/Data Template/RTF ) Details

Given SQL is to fetch the files details uploaded through XML Publisher Administrator Responsibility
 
SELECT
 a.application_short_name,
  a.data_source_code,
  b.lob_code,
  b.lob_type,
  b.file_name,
  b.last_update_date
FROM
   XDO_DS_DEFINITIONS_VL a,
   XDO_LOBS b
WHERE a.data_source_code    =b.lob_code
AND a.application_short_name=’XXXXX’
AND a.data_source_code      =:ConCurrentProgram or Data Defintion Code;
;