Users need to run shell scripts to submit concurrent jobs and then do other things. If you do not want to share the Applmgr password to other users, you can set up a separate OS account for users to run their scripts. Assume Oracle EBS is installed under /u01/app/ by OS user Applmgr.
$ hostname
hostname1q
$ echo $APPL_TOP
/u01/app/EBSQA/apps/apps_st/appl
$ echo $ORACLE_HOME
/u01/app/EBSQA/apps/tech_st/10.1.2
$ echo $TWO_TASK
EBSQA
1. create user batchuser on same host hostname1q
2. install Oracle client on the same host but under a different location
$ whoami
batchuser
$ echo $ORACLE_HOME
/batchu01/app/product/11.2.0/EBIZ
$ echo ORACLE_SID
EBSQA
3. create a file to setup the environment variables
$ whoami
batchuser
$ more setenv.ebsqa
export ORACLE_HOME=/batchu01/app/product/11.2.0/EBIZ
export ORACLE_SID=EBSQA
export TNS_ADMIN=/batchu01/app/product/11.2.0/EBIZ/network/admin
export LD_LIBRARY_PATH=/batchu01/app/product/11.2.0/EBIZ/lib
export PATH=/batchu01/app/product/11.2.0/EBIZ/bin:/usr/bin:/usr/local/bin:/etc
. /u01/app/EBSQA/apps/apps_st/appl/EBSQA_hostname1q.env
export PATH=$PATH:/batchu01/app/product/11.2.0/EBIZ/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
echo `which CONCSUB`
echo `which sqlldr`
$ . ./setenv.ebsqa
/u01/app/EBSQA/apps/apps_st/appl/fnd/12.0.0/bin/CONCSUB
/batchu01/app/product/11.2.0/EBIZ/bin/sqlldr
4. now, submit a concurrent job by $FND_TOP/bin/CONCSUB
$ CONCSUB APPS/appsPWD SYSADMIN "System Administrator" EBSadmin WAIT=Y CONCURRENT FND FNDSCURS PROGRAM_NAME='"Active Users"'
Submitted request 4654627 for CONCURRENT FND FNDSCURS PROGRAM_NAME="Active Users"
Normal completion
$ more $APPLCSF/log/l4654627.req
+---------------------------------------------------------------------------+
Application Object Library: Version : 12.0.0
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
FNDSCURS module: Active Users
+---------------------------------------------------------------------------+
Current system time is 28-JUL-2016 14:08:59
.. ... ...
5. Troubleshooting: if you get below error, the library file may be wrong or bad. Copy the file from EBS installation folder /u01/app/EBSQA/apps/tech_st/10.1.2/lib to current library folder /batchu01/app/product/11.2.0/EBIZ/lib.
CONCSUB: error while loading shared libraries: libclntsh.so.10.1: wrong ELF class: ELFCLASS64
CONCSUB: error while loading shared libraries: libnnz10.so: cannot open shared object file: No such file or directory
~~~~~~~~~~~~~~~~~~~~ A sample script ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/ksh
# Some variables
CONC_APPUSR=EBSBATCH # an EBS user who runs this cm job
CONC_LOGUSR=apps
MYFA_RESP_NAME=MY_FA_Resp
MYFA_SHORTNAME=MYFA
CONTROL_LOG=$APPLPTMP/log/${EBS_SYSCODE}.log
SECU_HOME=$HOME/ebsbatch # <- folder holds file orauser.pwd in which has apps password.
# That means who has permission to run this script will know apps password
# So, in production, put it a scheduler server with high security
date >> $CONTROL_LOG
print "CONCSUB $CONC_LOGUSR $MYFA_SHORTNAME $MYFA_RESP_NAME $CONC_APPUSR WAIT=Y CONCURRENT $MYFA_SHORTNAME FAB2RPT1" >> $CONTROL_LOG
## CONCSUB apps MYFA MY_FA_Resp EBSBATCH WAIT=Y CONCURRENT MYFA FAB2RPT1
submission=$(CONCSUB $CONC_LOGUSR $MYFA_SHORTNAME \
${MYFA_RESP_NAME} $CONC_APPUSR WAIT=Y CONCURRENT \
$MYFA_SHORTNAME FABLD2RPT1 "BEFORE" < $SECU_HOME/orauser.pwd)
if (( $? != 0 ))
then
print "Customization : CONCSUB invoke failed" >> $CONTROL_LOG
exit 99
fi
print "Customization: Invoking CM for invoice lines from AP/PO report" >> $CONTROL_LOG
#-------------------------------------------------------------------------
# Parse out request number from concsub output. Password prompt
# may be included depending on invoke style, so trim up to key words.
#-------------------------------------------------------------------------
reqno=$( echo ${submission#*Submitted request}|awk {'print $1'} )
#-------------------------------------------------------------------------
# Query Concurrent Mgr table selecting status code for this reqno
#-------------------------------------------------------------------------
MY_MASTER_PWD=apps/appsPWD@EBSQA #Or, use Oracle Wallet to hide the password
completion_code=$(sqlplus -s $MY_MASTER_PWD <<-EOF
set heading off
set verify off
select fcr.status_code
from applsys.fnd_concurrent_requests fcr
where fcr.request_id = $reqno
/
exit
EOF)
# Trim off white space that sometimes occurs
completion_code=$( echo $completion_code|awk {'print $1'} )
#-------------------------------------------------------------------------
# Exit based on completion code
#-------------------------------------------------------------------------
if [[ $completion_code = C ]]
then
print "Concurrent Manager job "$reqno" completed succesfully" >> $CONTROL_LOG
exit 0
else
print "Concurrent Manager job #"$reqno" did not complete succesfully" >> $CONTROL_LOG
cat $APPLCSF/$APPLLOG/l${reqno}.req $APPLCSF/$APPLOUT/o${reqno}.out >> $CONTROL_LOG
exit 1
fi
exit 0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 comment:
Post a Comment