Run unix script
Hi every one,
I would like to run an unix script in process flow. I tried to do by using user-defined ..but i think i didnt do it properly.
My requirement is
Script location: /dw10/oem/whse/stage/scripts
Script name: Pre_owb.sh
Description: This script should be run before the OWB mapping. This script will move the files from staging to mappings data files location
Script name: post_owb.sh
Description: This script should be run after the OWB mapping. This script will move the files from mappings data files location to archives folder.
Can any one help
Thanks in advance
Hi,
Check this out
http://blogs.oracle.com/warehousebuilder/2010/05/how_to_use_user_defined_activity_in_owb_process_flow.html
Similar Messages
-
How can i run unix script from my apex page
how can i run unix script from my apex page and take the output of unix script as a hidden variable and display it on the report region of that page
I had a requirement to run a Fortran program against some data that woudl be extracted from the database after the user set up their filtering criteria and made some additional input. SInce the program was to complex to conver to PL/SQL, we decided to try and invoke it from Apex. This is how I did it.
1. I followed the steps in Tim Archer's excellent article "Oracle External Procedure to Run Host Commands" (http://www.timarcher.com/?q=node/9). If the link does nto work, google the article's title.
Using this steps I created a function which accepts any OS command, including calling my own shell scripts, and runs them. I called my PL/SQL function "shell" instead of "USF_RUN_HOST_CMD " as Tim did in his example (step 9).
2. In Apex,
a. I created a button to run my shell command. (I named it P2_RUN_SHELL)
b. I created a PL/SQL process whose source looks as follows:
shell('/home/ackness/scripts/cr_xcf_file.sh > /tmp/cr_scfp_file.log');
and which was conditioned on the the button P2_RUN_SHELL.
It works like a charm.
Note: since you can run your own scripts using this method, you can encapsulate a series of commands in a UNIX shell script and invoke that script from Apex. This allows you to be able to test or run you commands from the command line as well as Apex and makes it easier to develop/debug/enhance the scripts in the future.
Ackness -
How ro run unix script freom pl/sql - dbms_scheduler 11.2.0.3
Hi,
Using 11.2.0.3 and have a unix script which works fine.
Want to run this unix script every time a piece of pl/sql runs
have put below in but doesn't actually run it.
How can we achieve this?
Many Thanks
idea is that file we create locqally on server is copied to another via the unix script caled form pl/sql
DBMS_SCHEDULER.create_program (
program_name => 'test_executable_prog',
program_type => 'EXECUTABLE',
program_action => '/oracle/jm/data/dataout/copy_tcfile',
number_of_arguments => 0,
enabled => TRUE,
comments => 'CREATE_PROGRAM test using a schell script.');Tried below but no joy
-- Shell Script (OS executable file).
/*DBMS_SCHEDULER.drop_program(program_name => 'por_copy_files');
DBMS_SCHEDULER.create_program (
program_name => 'por_copy_files',
program_type => 'EXECUTABLE',
program_action => ' /oracle/jm/data/dataout/copy_tcfile',
number_of_arguments => 0,
enabled => TRUE,
comments => 'CREATE_PROGRAM test using a schell script.');
DBMS_SCHEDULER.create_job (
job_name => 'por_copy_files_job',
program_name => 'por_copy_files',
start_date => null,--SYSTIMESTAMP,
repeat_interval => null,--'freq=hourly; byminute=0',
end_date => NULL,
enabled => TRUE,
comments => 'Job defined by existing program and inline schedule.');Edited by: user5716448 on 03-Oct-2012 08:35
Getting message when look in all_scheduler_job_run_details
ORA-27369: job of type EXECUTABLE failed with exit code: No such file or directory
even thoug hfile exists
Edited by: user5716448 on 03-Oct-2012 08:50When run for unix command line which o.k
get
AUTHSTATE=files
A__z=! LOGNAME
COLUMNS=132
EDITOR=vi
ENV=/home/oracle/.kshrc
HOME=/home/oracle
LANG=en_US
LC__FASTMSG=true
LOCPATH=/usr/lib/nls/loc
LOGIN=oracle
LOGNAME=oracle
MAIL=/usr/spool/mail/oracle
MAILMSG=[YOU HAVE NEW MAIL]
MAIL_HOST=prdikw01
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
ODMDIR=/etc/objrepos
ORACLE_BASE=/oracle/app/oracle
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1
ORACLE_SID=IKW
ORACLE_TERM=vt100
ORATAB_PATH=/etc
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java5/jre/bin:/usr/java5/bin:/usr/local/bin:/etc:/usr/sbin:/usr/ucb:/h
ome/oracle/bin:/usr/bin/X11:/sbin:/oracle/app/oracle/product/11.2.0/dbhome_1/bin:/oracle/app/oracle/product/11.2.0/dbhome_1/OPatch
PS1=[$ORACLE_SID]$PWD $
PWD=/oracle/jm/data
SHELL=/usr/bin/ksh
TERM=xterm
TMPDIR=/tmp
TZ=GMT0BST,M3.5.0,M10.5.0
USER=oracle
_=/usr/bin/env
dba=/home/oracle/dbaWhen run from pl/sql
get
ORA-27369: job of type EXECUTABLE failed with exit code: 255
STANDARD_ERROR="execve: Exec format error"when try
dbms_scheduler.create_job(
job_name => 'POR_JOB',
job_type => 'EXECUTABLE',
job_action => '/oracle/jm/data/copy_tcfile',
start_date => SYSTIMESTAMP,
number_of_arguments=>0,
enabled => true,
auto_Drop => true,
comments => 'Demo');Above code in pl/sql where create job and schedule job separately gives file not found message even though give full path -
Running Unix script from stored procedure
At present, I run a unix script to export my data for backup using telnet. I would like my users to run the commands on their own without my help. My users do not know telnet (they have no IT knowledge). So, I plan to create a form using Developer/2000 and let them run the procedure thru a stored procedure.But, my problem is how can a stored procedure call a unix script?
Hi,
solution, used by me.
Create a stored procedure that produces a text file with utl_file. The content of the file is the script you want to execute on your Unix box.
On your Unix Box write a shell script that scans the utl_file_dir for Files. If a file is in, chmod 744 to grnt execute rights to it and execute it.
I have a example if you want.
Start the script with crontab or let it loop with a sleep inside.
HTH
Detlev -
Hi
Friends i am runing a abap report which genrate a ( eft.txt ) text file in /usr/tmp/
Now i want to run a unix script which encript this file.
I have created this command in SM69
type = customer
command name = ZENC
Operation system = unix
externl program = sh
parameter for external program = /usr/tmp/ enc.sh eft.txt eftdc eftdo
enc is unix script and eft.txt is imput text file eftdo eftdc are encripted files.
I am us the function module SXPG_CALL_SYSTEM'
it is ending with following messege
1 5 hello
2 19 eft.txt eftdo eftdc
3 40 The jar file is not found: Encryptor.jar
4 44 External program terminated with exit code 1
and do not give any output.
please help.
Thanks & regards
SSreport zsrchsap.
*-This is a demo report for Search Sap
*-Author : Sandeep Kulkarni
*-Date : 09/20/2001
parameters : p_sfile(60) lower case
"File to be moved
"Eg : /home/in/SFILE1.txt
p_dfile(60) lower case.
"File's Destination
"Eg: /home/archive/SFILE1.txt
data : t_btcxpm
like btcxpm occurs 0,
p_addparam
like sxpgcolist-parameters.
concatenate
'/home/ABAP/scripts/Archive_file.sh'
p_sfile
p_dfile
into p_addparam separated by space.
refresh t_btcxpm. clear t_btcxpm.
call function 'SXPG_CALL_SYSTEM'
exporting
commandname = 'ZSHELL'
additional_parameters = p_addparam
tables
exec_protocol = t_btcxpm
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
others = 12.
if sy-subrc = 0.
write : /
'File',p_sfile,'moved to',p_dfile.
else.
write : / 'Error Occured'.
endif. -
Issue with running Unix Script during post processing
Dear all,
In one of the requirement, we need a execute a UNIX script in the post procesing steps of file channel.
When the script is run independently on the UNIX prompt, it executes very well.
But when the same script is kept in the post processing steps of the file channel, it doesn't give the desired results.
In the channel log, it says the script is executed but we are not able to see the output. (in this case, ist writing some dummy text in a new file). The script has all the permissions for all the users, read write and execute.
If anyone has a similar issue, kindly respond with the resolutions.
Regards,
YounusHI Younus
How you are running the script. Could be a problem with the command you are trying to execute from channel. Let us know the way you are doing
Check whether installed and executed on XI server properly then again check with channel.
Check with these for reference
http://help.sap.com/saphelp_nw70/helpdata/EN/e3/94007075cae04f930cc4c034e411e1/content.htm
The specified item was not found.
Executing Unix shell script using Operating System Command in XI
Thanks
Gaurav -
Logic to run Unix script file through ABAP program
Hi Friends,
I need to run the Unix script file from abap program, for that user provided file directory of application server.
Is there any logic/FM to run through abap programing.
pls can any one provide logic.
Thanks,
Ravireport zsrchsap.
*-This is a demo report for Search Sap
*-Author : Sandeep Kulkarni
*-Date : 09/20/2001
parameters : p_sfile(60) lower case
"File to be moved
"Eg : /home/in/SFILE1.txt
p_dfile(60) lower case.
"File's Destination
"Eg: /home/archive/SFILE1.txt
data : t_btcxpm
like btcxpm occurs 0,
p_addparam
like sxpgcolist-parameters.
concatenate
'/home/ABAP/scripts/Archive_file.sh'
p_sfile
p_dfile
into p_addparam separated by space.
refresh t_btcxpm. clear t_btcxpm.
call function 'SXPG_CALL_SYSTEM'
exporting
commandname = 'ZSHELL'
additional_parameters = p_addparam
tables
exec_protocol = t_btcxpm
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
others = 12.
if sy-subrc = 0.
write : /
'File',p_sfile,'moved to',p_dfile.
else.
write : / 'Error Occured'.
endif. -
Running unix scripts on first boot after imaging
Hi,
I have a setup in which student users at the school I work for log in via AD to create a mobile account on the local system. This all works great in snow leopard so far, the issue i am having is I have a couple of bash scripts that run at boot. They run ok, but one script opens up the folder the script is located in (script does run, and the folder doesn't open the next time a student logs in), and I also have a Acceptable Use Policy PDF the opens up on log in, the first time a user logs into a system, it opens in Safari, the second time it opens it is in Preview (I want it to open in preview each time).
These problems aren't exactly show stoppers, but they are pretty annoying (especially since students log in to 5 or 6 different computers per day, so the errors show up 5 or 6 time per day for the users.)
Any suggestions to get this fixed would be greatly appreciated!osascript -e 'tell application "Preview"' -e 'open file "path:to:file.pdf"' -e 'end tell'
-
How can I run a Unix script from a desktop icon?
I have a Unix script I've created in vi and would like to run it by double clicking on an icon on my desktop. I would like to do this without the additional application layer of Applescript, Automator or Terminal. Is this possible?
Thanks in advance.
HowardSounds like a job for platypus.
-
Can we create logical/ physical schema by running any script (unix/window)?
I wish to create logical/ physical schema in oracle data integrator
by running any windows or preferably unix script.
is there any method or scripts provided in ODI?I think you could insert info into Matser Respository tables:
Connect info: snp_connect
Logical Schemas : snp_lschema
Physical Schemas: snp_pschema
Or you may write some sql to do this. -
Running a Unix script from a Java class
I am trying to use SCP (Secure copy) to copy an xml file from my J2EE application to a remote Unix server using a Unix script. How can I run the Unix script from my Java class? I could not find any resource for this on the internet. Can someone help me with this please.
ThanksI am trying this below program ,but i am getting the error please help me
import com.jcraft.jsch.*;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.JSch;
//import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
//import com.jcraft.jsch.UserInfo;
import java.io.*;
public class testrad {
public static void main(String args[])
String user="usertvr";
String host="5.34.12.1";
String cmd="ls -l";
JSch jsch = new JSch();
try{
Session session=jsch.getSession(user,host,22);
session.setPassword("$yhaj23");
//UserInfo usrInfo=new MyUserInfo();
//session.setUserInfo(usrInfo);
session.connect();
Channel channel=session.openChannel("exec");
((ChannelExec) channel).setCommand(cmd);
channel.setXForwarding(true);
channel.connect();
//code
channel.setInputStream(System.in);
// channel.setOutputStream(System.out);
//((ChannelExec) channel).setErrStream(System.err);
InputStream in = channel.getInputStream();
channel.connect();
byte[] tmp = new byte[1024];
while (true)
while (in.available() > 0)
int i = in.read(tmp, 0, 1024);
if (i < 0)
break;
System.out.print(new String(tmp, 0, i));
if (channel.isClosed())
in.close();
// System.out.println("JSCH: exit-status: " +
//channel.getExitStatus());
break;
try
Thread.sleep(1000);
catch (Exception ee)
channel.disconnect();
session.disconnect();
}catch(Exception e)
{e.printStackTrace();
System.out.println("Exception"+e);}
/*public static class MyUserInfo implements UserInfo {
public String getPassword()
{ return "password"; }
public String getPassphrase()
{ return ""; }
public boolean promptPassword(String arg0)
{ return true; }
public boolean promptPassphrase(String arg0)
{ return true; }
public boolean promptYesNo(String arg0)
{ return true; }
public void showMessage(String arg0)
Here is the error
com.jcraft.jsch.JSchException: UnknownHostKey: 5.128.0.10. RSA key fingerprint is 02:a0:d6:c0:6f:69:2c:a9:a7:fa:7c:71:1c:60:ed:57
at com.jcraft.jsch.Session.checkHost(Unknown Source)
at com.jcraft.jsch.Session.connect(Unknown Source)
at com.jcraft.jsch.Session.connect(Unknown Source)
at testrad.main(testrad.java:23)
Exceptioncom.jcraft.jsch.JSchException: UnknownHostKey: 5.128.0.10. RSA key fingerprint is 02:a0:d6:c0:6f:69:2c:a9:a7:fa:7c:71:1c:60:ed:57
Can some one help me please.
I running this program from Windows to connect to remote unix boxes. -
Hi,
how can i run a unix script from java application. This java application is on windows.
How can i do this.
thanks,Hi,
how can i run a unix script from java application.
This java application is on windows.
So I think it's safe to assume that the target script is on a remote unix server.
Take a look at http://sourceforge.net/projects/sshtools/ -
How to run a unix script from oracle warehouse Builder
Hi,
can any one share the information about, running the unix script or scripts using oracle warehouse builder.
Regards,
AkOne way is define a workflow. Inside the workflow you put
1)an external process that "points to" the shell script and then
2)put the mapping
The external process must have the "COMMAND" parameter set to the name of the shell script. If the script has parameters you must put them in the "PARAMETERS LIST" separated by "?" (for example, ?par1?par2).
The path where OWB executes the external process I think is the ORACLE_HOME of the OWB.
f you don't use workflow, you can try with this more complex solution. I tried with 9i and OWB 9.2 and it's working well.
You create an autonomous procedure (within a package or not) :
CREATE PROCEDURE Extract_Email_List
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
And use the sys.shell script that you need your dba/unix admin to install first of all, with a call like that.
sys.shell('sh ' || txt_dir_name || '/send_email_marketing.sh ' || txt_dir_name || ' ' || email_addr );
Then you import your procedure into OWB and use it in your mapping with the "pre-mapping" icon (you can set parameters for your proc with constants if you want).
To implement sys.shell, go to metalink and find "Note:168065.1" - "How to call a UNIX shell script from PL/SQL".
Once it's done once, it's not so bad. But I would still recommend the workflow approach also..
I hope this helps. -
How to run a Unix Script from a specific user
Hi,
I want to run a GoldenGate related unix script from a super user. I have created crontab enter from that super user. But its still running from root user. As GGSCI cannot be invoked other than super user, the Script is failing.
The Script is running fine on command prompt and from "at" batch job command.
Please give me a way to run the script from a specific user on Cron
Thanks,
SaravanaHi.
can you show:
grep root /etc/passwd
grep <super user> /etc/passwd (It's not clear for me, what you call super user. For me - root is super user. )
ls -la /var/spool/cron/crontabs
Generaly for add cronjobs for any user need:
crontab -e <username>
For more information - man crontab
Reagrds. -
How to run script file ( unix script file like ksh or sh file) using Java
How to run script file ( unix script file like ksh or sh file) using Java Program?.
I am using the following code snippet to run the simple commands like top or ls ,etc....
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("top");
Thanks In Adavance
-SivaString [] { "ksh" , "-c" , "script", "arg 1", "arg 2", "arg 3"}
Maybe you are looking for
-
Header and Footer in SiteStudio designer
Hi, Is there any option for header and footer in SIte Studio Designer? Regards, Harini.
-
Is there a limit to the number of Apple TV's attached to an iTunes Library
I recently replaced 7 (seven) Version 1 Apple TV's with Version 3 Apple TV's and noticed that I now receive an error, "Cannot connect to the iTunes Library, ensure that you are on the same network, etc." on two of the Apple TV's. Shutting down iTunes
-
I'm very new to all this web desgin, but I am very pleased with where I have gotten on my own. Can't figure this last bit out. I am making a photo website, and I have thubnails of all my photos laid out on various pages, the plan is to have each thum
-
Define Flat Rate for Travel Cost based on location (Maximum points awarded)
Hello, SPRO>Financial Accounting>Travel Management>Travel Expenses>Trip Reimbursement Amount>Reimbursement Amount Travel Costs>Define Flat rates for Travel Costs, in this path we can enter the reimbursement amount for trip country/ trip region. I cre
-
I am using Flex to create an Apollo Application. How would I go about adding new nodes in an xml file? For instance, my xml file when I load it in is: <TodoList> <Category label="Flex Todos"> <Tasks> <Task> <Description>Get Flex App Finished</Descrip