Process Flow - User Defined object calling Unix Shell script not working
Hi, I have a User Defined Object in a Process Flow with the following parameters :-
Command: /usr/bin/ksh
Parameter List:
Result Code:
Script: cd /shell_scripts
./dwh_get_datafile.sh param1 param2 param3
Success Threshold: 0
The script executes but it does not correctly interpret all the Unix commands within it e.g command such as FTP, DATE, GREP etc.
In the job details I can see :-
./dwh_get_datafile.sh: date: not found
./dwh_get_datafile.sh: ftp: not found
./dwh_get_datafile.sh: grep: not found
./dwh_get_datafile.sh: rm: not found
./dwh_get_datafile.sh: ls: not found
./dwh_get_datafile.sh: awk: not found
Anyone know what I have done wrong ?
The script runs fine when run as a Unix script while logged into Telnet.
Thanks.
Paul
The shell script is executed by the oracle user in the unix environment so make sure that the directorie where you can find the unix commands exists in the path for the oracle user in .profile as you can se in my example below.
PATH=$PATH:$ORACLE_HOME/bin:$OWBHOME/bin:/ASW/ora_script:/local/bstat:/usr/bin:/opt/bin:/usr/local/bin; export PATH
/JZ
Similar Messages
-
User defined workflow calling unix shell script
Hi
I have defined a workflow in OWB 10GR2 which calles a user defined object before calling the actual mapping.
The user defined object calls a unix shell script which sets things right in the shell before the mapping can run.
When executing the shell script from a unix shell myself it does exactly what I want
However if I call the same script from workflow it does not recognize any of the commands not even internal shell commands like ls, touch.
I've created a small test.sh script
#! /bin/bash
ls -l > listing.txt
Created a flow with a user_defined object of which property is set:
COMMAND.Value /home/oracle/test.sh
If I then deploy and start the flow get the following:
PF_WEB_00:TEST Success
/home/oracle/test.sh: line 2: ls: command not found
Anyone has any clue why this is or what I'm doing wrong?
GeertHi Lew,
Thanks for the reply.
This basically confirms what I've figured out so far.
I noticed I was able to get my script running by using absolute paths everywhere, after which my only problem was it could not resolve the TNS.
To bypass this I ended up copying all the path settings out of the .profile of my oracle user into my script after which the script ran fine.
At least now I know for sure what's causing it and that by making my scripts a bit more extensive then usual I can do what I please :)
Geert -
Calling UNIX shell script from ODI package?
Hi,
How Can we call UNIX shell script from ODI package?
I have a ftp_ss.sh script which which ftps a file from remote server to local server, archives the last file and renames new file to the standard (ie file data store)name.
I want to run the above script and interfaces from a package.
Any help is greately appreciated.
Thanks,
RDIn the package window, put "OS Command" from the toolbox.
Provide the command parameters to this tool in form of "/path/to/script/ftp_ss.sh" -
Call Unix Shell Script From OBIEE
Hi All,
Is it possible to do a call to a Unix Shell Script with the Action Framework from OBIEE.
Thanks in AdvanceI dont think so but we can go for it instead of BI side. Try to port the same functionality on shell script side, so that the script can identify your report using tail of nqquery log and execute the rest of your lines in shell script.
This can doable and works as expected. If at all you are going with my suggestion you can go for a small key word to identify your report instead of that lengthy logical query.
Pls mark if helps -
Calling Unix shell script from PL/sql code
Hi
I need to call a shell script from a procdeure which i need to run in toad. Let me kno whow can i do that and connect to unix box with an example.Thanks Avinash,
That on was very useful.
When I try to execute I got the following error.
Could you let me now What privileges are required?
SQL> BEGIN
dbms_scheduler.create_job(job_name => 'myjob',
job_type => 'executable',
job_action => '/home/rananto/a.sh',
enabled => TRUE,
auto_drop => TRUE);
END;
/ 2 3 4 5 6 7 8
BEGIN
ERROR at line 1:
ORA-27486: insufficient privileges
ORA-06512: at "SYS.DBMS_ISCHED", line 99
ORA-06512: at "SYS.DBMS_SCHEDULER", line 262
ORA-06512: at line 2
SQL> exec dbms_scheduler.run_job('myjob');
BEGIN dbms_scheduler.run_job('myjob'); END;
ERROR at line 1:
ORA-27475: "CRDM.MYJOB" must be a job
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1 -
Calling Unix shell script for some GUI interface
Hi,
I'm preparing a shell script, which would check for the syntax of a bteq script.
I want this shell script to be called from a GUI interface...
Is it possible to call this shell script from any GUI interface..
If yes, could you please help me out.
Thanks,
Harshad.Harshad (user524171) wrote:
I'm not aware of OEM grid control. Can i use it without Oracle or Oracle is must for this...Er.. this is an Oracle forum... and if you are not using Oracle s/w then why are you using Oracle support forums?
I'm using teradata database and unix here...And what part of ORACLE Database General Forum+ do you not understand that makes you ask Teradata questions here?
Teradata is not Oracle. Oracle is not Teradata. Please use the correct forum for your subject matter. -
Can i call unix shell script from B2B callout.
Hi,
We had a requirement to invoke a unix shell script from B2B callout implemented class. Here is the code in implementation class:
public void execute(CalloutContext context,List input,List output)
throws CalloutDomainException, CalloutSystemException {
try {
CalloutMessage cmIn = (CalloutMessage)input.get(0);
FileOutputStream fos = null;
String inputFile = "/home/orasoad/digitalsign/input/test.txt";
String outputFile = "/home/orasoad/digitalsign/output/test.txt.gpg";
File outFile = new File(inputFile);
String str =cmIn.getBodyAsString();
fos = new FileOutputStream(outFile);
Writer out = new OutputStreamWriter(fos);
out.write(str);
out.close();
String shellFile = "/home/orasoad/digitalsign/dg.sh";
String cmd[] = new String[] { shellFile, inputFile, outputFile };
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(cmd);
int i = pr.waitFor();
BufferedReader br = new BufferedReader(new InputStreamReader(pr.getInputStream()));
StringBuffer sb = new StringBuffer();
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
CalloutMessage cmOut = new CalloutMessage(sb.toString());
output.add(cmOut);
} catch (Exception e) {
throw new CalloutDomainException(e);
We were able to execute the unix shell script from standalone java class with same code. But some how it is not working as expected while invoking the B2B java callout.
Is it possible to invoke unix shell script from B2B callout?
Please give inputs.
Regards,Though it's not a good idea to invoke shell scripts from java callout but technically it will work.
But some how it is not working as expected while invoking the B2B java callout.What is not working as expected? Any error in the log (server-diagnostic.log or server.out)?
Regards,
Anuj -
Hi,
i havea requirement where in i should be able to call my shell script through oracle stored procedure.i tried the following way..but iam unable to get the result.please find the details below.
new.sh - my shell script - lctfile (LCTFILE) is the input pa
v_config_file=`find $FND_TOP -name LCTFILE
FNDLOAD apps/s0ccer@$dxbs1 0 Y DOWNLOAD $v_config_file /home/bir4163/RPT33/bin/menu.ldt MENU MENU_NAME='AR_NAVIGATE_GUI'
if [ $? != 0 ];then
echo "$DATE $0 FNDLOAD DOWNLOAD Failed!" | tee -a $LOG_FILE
else
echo "SUCCESS" | tee -a $LOG_FILE
fi
CREATE OR REPLACE PROCEDURE test_dbms_scheduler
AS
v_text VARCHAR2 (255) := 'AR_NAVIGATE_GUI';
BEGIN
DBMS_OUTPUT.put_line ('I am in Procedure');
DBMS_SCHEDULER.create_job (
job_name => 'test_dbms_scheduler',
job_action => '/home/bir4163/RPT33/bin/new.sh',
number_of_arguments => 1,
job_type => 'executable',
start_date => SYSDATE,
repeat_interval => 'FREQ=SECONDLY; INTERVAL=1',
enabled => FALSE,
auto_drop => FALSE,
comments => 'run shell script'
DBMS_SCHEDULER.set_job_argument_value (job_name => 'test_dbms_scheduler',
argument_position => 1,
argument_value => v_text);
DBMS_SCHEDULER.enable ('test_dbms_scheduler');
DBMS_OUTPUT.put_line ('I am back in Procedure');
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SQLCODE || SQLERRM);
END;
But iam unable to test it as i do not have permissions to access dbms_scheduler.can anybody tell me how to solve this using DBMS_PIPE with a sample code.
please do help its very urgent
thanks
ramyaHi,
Register your Shell Script as a concurrent program, Executable execution method "Host", then use fnd_request.submit_request to submit the program.
Regards,
Andries -
Parameter process flow user defined process
Hello
i try to start Oracle Import imp.exe on a user-defined process. If I type in the parameters as a literal value, i.e. ?USERID=.../... PARFILE=d:/import/import.par?
it works well, also if i replace this value by a bind variable. But when I add the userid setting to the value of the parameter, it can't be read properly as I get the error "invalid userid/password".
Any ideas?I mistyped sth, now it works
-
How can I call unix shell script from database using triggers
Hi everyone,
can anybody help me to solve my problem.
we have one table and records are getting inserted into table.
when the record is inserted with 'C',I need to fetch that record-id which is primary key and then by passing that id as an argument I need to execute a shell script which is there in Unix using triggers.
please note DB and Scripts are in different servers.4159efc6-cffb-4496-bd1a-68859f6ce776 wrote:
Hi everyone,
can anybody help me to solve my problem.
we have one table and records are getting inserted into table.
when the record is inserted with 'C',I need to fetch that record-id which is primary key and then by passing that id as an argument I need to execute a shell script which is there in Unix using triggers.
please note DB and Scripts are in different servers.
PL/SQL can only interact with objects on the local DB Server.
PL/SQL can initiate OS local script via any of the following mechanisms: EXTERNAL PROCEDURE, JAVA, DBMS_SCHEDULER
The local script then will need to launch the remote script. -
Hi
All,
I have oracle 9i and 10g on unix. now i have 920.env and 1020.en file to set p respective enviornment.
when I excecute this commnad
. $HOME/920.env from the shell prompt it is working fine. and also same for 1020.env .
Now same command . $HOME/920.env i am putting in shell script and trying to execute that script but it is not executing.
i don't know what to do.
Thank you
vishalnow as i understand that statement is executing but it's scope is only with in the script. when it complete it's execution all varialble reset to it's by defualt .profile so that statement in the script set variable with in the scope of the script only.
Thanks for your help
Vishal -
Hardcode password in a do shell script not working
I have been trying to solve something i have wanted to do for a long time, that is get a script that changes the ammount of time before the display goes to sleep. I tried GUi scripting but in system preferences the changes made to the slider did not stay. So i have now come onto a do shell script. Found below. I would prefer to just hardcode my password into it however this does not seem to work. Any ideas ?
set exitflag to false
try
repeat until exitflag is true
set {text returned:Sleeptime, button returned:sleepstate} to (display dialog "Minutes before display sleep" & return & "Between 1 and 180 mintues" & return & "Greater than 180 means never sleep" default answer "1" buttons {"Cancel", "OK"} default button 2)
set Sleeptime to Sleeptime as number
if Sleeptime is less than 1 then
set exitflag to false
else if Sleeptime is greater than 180 then
set Sleeptime to 0
set exitflag to true
else
set exitflag to true
end if
end repeat
end try
set Sleeptime1 to Sleeptime as string
set Sleeptime1 to quoted form of Sleeptime1
set psswd to quoted form of "XXXXX"
do shell script "sudo pmset -a displaysleep " & Sleeptime1 password psswd
set pete to do shell script "sudo pmset -g"
set xx to text -2 thru -1 of pete
if xx - Sleeptime = 0 then
tell application "SEC Helper"
show screen message "Worked:" & return & xx & " mintues"
end tell
else
tell application "SEC Helper"
show screen message "Failed!"
end tell
end if1) don't use 'sudo' in a 'do shell script'. It isn't necessary and will sometimes break.
2) do not use 'sudo' in a 'do shell script'
3) do not use... I'm sure you get the idea.
It is not necessary to use 'sudo' in a 'do shell script' command. 'do shell script' itself takes care of the authentication element when you use 'with administrator privileges'. Therefore the appropriate way of doing this is:
<pre class=command>do shell script "pmset -g displaysleep " & sleeptime1 with administrator privileges password psswd</pre>
If you omit the 'password psswd' element the user will be prompted to authenticate using the standard system authentication dialog.
The problem you're running into is that the 'password' parameter is only valid when you use 'with adminitrator privileges', and is therefore getting ignored in your current script. -
My cold backup shell script not working
I have written a shell script for cold backup but. It says that line 42 has unexpected syntex error '{' and line 57 unexpected end of file. Please help
BKUP_DIR=/u03/backups/abu/nightly_backup
LOG_FILE=/u03/backups/abu/backup.log
ORACLE_HOME= /u01/app/oracle/product/10.2; export ORACLE_HOME
ORACLE_SID=SEED; export ORACLE_SID
PATH="$PATH:$ORACLE_HOME/bin";export PATH
# Execute the backup procedure
echo ymd=`date +%Y%m%d` >> $LOG_FILE
echo "Database BACKUP starting." >> $LOG_FILE
ORACLE_HOME=/u01/app/oracle/product/10.2; export ORACLE_HOME
ORACLE_SID=SEED; export ORACLE_SID
PATH="$PATH:$ORACLE_HOME/bin";export PATH
rman target=/ << EOF
shutdown immediate
EOF
if [ $? -eq 0 ]
then
mkdir -p ${BKUP_DIR} # make directory
echo "Database shut down.">> $LOG_FILE
else echo "not shutdown".>> $LOG_FILE
fi
if [ ! -d ${BKUP_DIR} ]
then
echo "Not a directory: ${BKUP_DIR}">> $LOG_FILE
exit 1
fi
echo "Previous Backup is being removed." >> $LOG_FILE
rm ${BKUP_DIR}/${ymd-${seed}.gz >>$LOG_FILE
echo "Cold backup being performed." >> $LOG_FILE
cp /u01/app/oracle/admin/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz #copying database files into new dir
cp /u02/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
cp /u03/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
echo "Cold backup of archive logs being performed." >> $LOG_FILE
mv /u01/app/oracle/product/10.2/dbs/arch/* ${BKUP_DIR}/$ymd-${cmsv}.gz
gzip ${BKUP_DIR}/$ymd-${cmsv}
echo "Restarting Database" >> $LOG_FILE
rman target=/ << EOF
startup
EOF
else
echo "Database will NOT start up." >> $LOG_FILE
fi
echo 'ymd='date +%Y%m%d' >> $LOG_FILE
echo "Database BACKUP has completed." >> $LOG_FILE
exitI trying to write that script for our new production database. My script will create a folder automatically and will copy all database files into the folder. Now my script dont copy the files into the direcory that automatically create. I want my directory name with timestamp that i already speciy in my code. The scripts now generate an error that now such files or directory. I mean when it tries to copy files from source to destination folder. Please give me some suggestions.
if [ $? -eq 0 ]
then
mkdir -p ${BKUP_DIR} # make directory
echo "Database shut down.">> $LOG_FILE
else echo "not shutdown".>> $LOG_FILE
fi
if [ ! -d ${BKUP_DIR} ]
then
echo "Not a directory: ${BKUP_DIR}">> $LOG_FILE
exit 1
fi
echo "Previous Backup is being removed." >> $LOG_FILE
rm ${BKUP_DIR}/${ymd-${seed}.gz >>$LOG_FILE
echo "Cold backup being performed." >> $LOG_FILE
cp /u01/app/oracle/admin/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz #copying database files into new dir
cp /u02/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
cp /u03/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gzecho "Cold backup of archive logs being performed." >> $LOG_FILE -
Calling unix shell script from SAP
Hi,
1. i created command in SM69 as Zshell.
2. i pass this command to FM SXPG_COMMAND_EXECUTE. it is working fine when the file is having read write execute permisson on unix level.
but the problem is my unix administrator he don't want to give this permission. because of some security reason.
he want's to execute with ROOT.
anyone knows how i can handle this situation?
if the file is doesnot have read write execute permission, then FM give permission error.
Thanks.could i pass like this.
my script name is ZRECOVERY_RPT.
p_comm = ZRECOVERY_RPT.
in the function module i passed like this.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = p_comm
ADDITIONAL_PARAMETERS =
OPERATINGSYSTEM = SY-OPSYS
TARGETSYSTEM = p_host
DESTINATION =
STDOUT = 'X'
STDERR = 'X'
TERMINATIONWAIT = 'X'
TRACE =
DIALOG =
IMPORTING
STATUS =
EXITCODE =
TABLES
EXEC_PROTOCOL = it_exec_pro
EXCEPTIONS
NO_PERMISSION = 1
COMMAND_NOT_FOUND = 2
PARAMETERS_TOO_LONG = 3
SECURITY_RISK = 4
WRONG_CHECK_CALL_INTERFACE = 5
PROGRAM_START_ERROR = 6
PROGRAM_TERMINATION_ERROR = 7
X_ERROR = 8
PARAMETER_EXPECTED = 9
TOO_MANY_PARAMETERS = 10
ILLEGAL_COMMAND = 11
WRONG_ASYNCHRONOUS_PARAMETERS = 12
CANT_ENQ_TBTCO_ENTRY = 13
JOBCOUNT_GENERATION_ERROR = 14
OTHERS = 15
IF sy-subrc EQ 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
how i can pass along with SH. -
Connect internal in shell script not working
Oracle: 11.2.0.1 in AIX env
I export ORACLE_SID and then try to connect internal but I get connected to idle instance. What am I missing???
this block is in a .sh script
export ORACLE_SID=ufms203
$ORACLE_HOME/bin/sqlplus /nolog <<EOF
connect / as sysdba
WHENEVER SQLERROR EXIT;
select instance_name from v$instance;
OUTPUT *********************
SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 29 09:43:05 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> Connected to an idle instance.
SQL> SQL> SQL> select instance_name from v
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
DisconnectedThe instance is started:
k801ora@jd1su143 in /a0143/d01/scripts : ps -ef | grep ufms203
k801ora 8794340 1 0 12:32:46 - 0:00 oracleufms203 (LOCAL=NO)
k801ora 8929434 1 0 09:33:52 - 0:00 ora_w001_ufms203
k801ora 10248348 1 0 Mar 22 - 2:24 ora_pmon_ufms203
k801ora 10359024 1 0 Mar 22 - 0:15 ora_gen0_ufms203
k801ora 10379478 1 0 Mar 22 - 7:50 ora_vktm_ufms203
k801ora 10399748 1 0 Mar 22 - 0:40 ora_dbw0_ufms203
k801ora 10408158 1 0 Mar 22 - 1:19 ora_psp0_ufms203
k801ora 10420478 1 0 Mar 22 - 0:16 ora_mman_ufms203
k801ora 10428426 1 0 Mar 22 - 0:16 ora_diag_ufms203
k801ora 10436840 1 0 Mar 22 - 0:17 ora_dbrm_ufms203
k801ora 10440938 1 0 Mar 22 - 12:00 ora_dia0_ufms203
k801ora 10445048 1 0 Mar 22 - 2:51 ora_ckpt_ufms203
k801ora 10449134 1 0 Mar 22 - 0:38 ora_dbw1_ufms203
k801ora 10453232 1 0 Mar 22 - 0:35 ora_dbw2_ufms203
k801ora 10457330 1 0 Mar 22 - 0:35 ora_dbw3_ufms203
k801ora 10461428 1 0 Mar 22 - 0:47 ora_lgwr_ufms203
k801ora 10465530 1 0 Mar 22 - 0:04 ora_reco_ufms203
k801ora 10469624 1 0 Mar 22 - 0:55 ora_smon_ufms203
k801ora 10473726 1 0 Mar 22 - 4:42 ora_mmnl_ufms203
k801ora 10477820 1 0 Mar 22 - 2:43 ora_mmon_ufms203
k801ora 10485770 1 0 Mar 22 - 0:08 ora_q002_ufms203
k801ora 10489864 1 0 Mar 22 - 0:07 ora_qmnc_ufms203
k801ora 10506270 1 0 Mar 22 - 0:04 ora_q000_ufms203
k801ora 10530842 1 0 Mar 22 - 0:04 ora_q001_ufms203
k801ora 10588214 1 0 Mar 22 - 0:19 ora_smco_ufms203
k801ora 11124888 10510484 2 09:54:04 pts/0 0:00 grep ufms203
k801ora 11796592 1 0 09:35:19 - 0:00 ora_w000_ufms203
k801ora 12431386 1 0 09:53:53 - 0:00 ora_w002_ufms203
k801ora 12484794 1 0 12:32:41 - 0:11 oracleufms203 (LOCAL=NO)
k801ora 16023576 1 0 12:32:04 - 1:12 oracleufms203 (LOCAL=NO)
k801ora 16629976 1 0 09:25:21 - 0:00 ora_w005_ufms203
Maybe you are looking for
-
the card I used to pay for my creative cloud subscription, no problem right? just enter the new card in and taddaaa everything should work right? no nope it wont let me open photoshop because it says i need to renew my subscription well it charged me
-
Creating a photo gallery like the China Gallery in Adobe Labs. How?
I have photos in several categories (I'll use 2, "frank" and "wolfie" as examples here). What I'd like to do is build a photo gallery like the China Photo Gallery shown in the Adobe Labs site, where the user can switch between categories without goin
-
Smart Form problem with address layout
Hello everyone, I need your help please for a smart form problem. We need the address layout for great britain with street1, street2 etc. but currently street2 is alligned before street1. We are using the FM ADDRESS_INTO_PRINTFORM (SAP standard addre
-
BEX Selection Screen Authorisations
Hi all, I have developed a new authorisation role for a demand planner in APO. Part of its function is to allow the user to run a BEX report on a remote cube. This is working, apart from the selection screen when running the BEX query does not appear
-
Poor Image Quality -- Design View & Published Content (CP8)
If I prepare a high-quality image, picture perfect, sharp, sized to let's say 500 x 500 px in Photoshop (max JPG quality setting) and then dump into Captivate, I find that Captivate significantly degrades the image quality. It changes the sharpness