How to call unix script/command in ODI

Hello Gurus,
Please let me know how to call unix script/command in ODI?
Thanks
Shridhar

you can call shell script using the OS command found in Package.
Step 1. Drag the OS Command in the Packgae
Step 2. In the Text mentiond call the script say for ex sh /opt/path/script.sh
Step 3. Execute.
Note : Make sure the User through which ODI is triggering does have the required permission to execute shellscript , also always provide the full path , since scripts are execute from the oracldi/bin folder so its necessary to provide the complete path of the script location.
Hope this helps.

Similar Messages

  • Help! How to call Unix system command?

    In my java application.there are some code as following:
    try{
    String cmd = "ls -a > temp.txt";
    Runtime runtime = Runtime.getRuntime();
    Process process = runtime.exec(cmd);
    int rc = process.exitValue();
    if (rc == 0){
    System.out.println("OK!");
    else{
    System.out.println("Failed!");
    catch(Exception ex){
    ex.printStackTrace();
    But when i run the application, it always throws IllegalTreadStateException,
    return code(rc) is 2, exception's content is as below:
    java.lang.IllegalThreadStateException: process hasn't exited
    at java.lang.UNIXProcess.exitValue(UNIXProcess.java:118)
    at MyApplication.main(...)
    If someone know what happened, please help me, my E-mail address is:
    [email protected]

    import java.io.*;
    public class RunCommand {
    public static void main(String args[]) {
    String s = null;
    try {
         // run the Unix "ps -ef" command
    Process p = Runtime.getRuntime().exec("ps -ef");
    BufferedReader stdInput = new BufferedReader(new
    InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new
    InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null) {
    System.out.println(s);
    // read any errors from the attempted command
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null) {
    System.out.println(s);
    System.exit(0);
    catch (IOException e) {
    System.out.println("exception happened - here's what I know: ");
    e.printStackTrace();
    System.exit(-1);
    http://www.devdaily.com/java/edu/pj/pj010016/index.shtml
    Cheers,
    Bala

  • How to store UNIX script in SM69/SM49

    Hi,all
    Its urgent requirement..
    I wrote a UNIX script for moving files from source dir to target dir ,how to call this script in ABAP.
    I know SXPG_command_execute...in that we can give a external command .But i need to call a script?
    so how can i do this and where to store this script?
    Thanx in advance

    Hi,
    Check the below document in sap help.
    http://help.sap.com/saphelp_47x200/helpdata/en/bb/9f038d4b9b11d189750000e8322d00/frameset.htm
    Thanks,
    Ramakrishna

  • How to call Operating System commands / external programs from within APEX

    Hi,
    Can someone please suggest how to call Operating Systems commands / external programs from within APEX?
    E.g. say I need to run a SQL script on a particular database. SQL script, database name, userid & password everything is available in a table in Oracle. I want to build a utility in APEX where by when I click a button APEX should run the following
    c:\oracle\bin\sqlplusw.exe userud/password@database @script_name.sql
    Any pointers will be greatly appreciated.
    Thanks & Regards,

    Hi Guys,
    I have reviewed the option of using scheduler and javascript and they do satisfy my requirements PARTIALLY. Any calls to operating system commands through these features will be made on the server where APEX is installed.
    However, here what I am looking at is to call operating systems programs on client machine. For example in my APEX application I have constructed the following strings of commands that needs to be run to execute a change request.
    sqlplusw.exe user/password@database @script1.sql
    sqlplusw.exe user/password@database @script2.sql
    sqlplusw.exe user/password@database @script3.sql
    sqlplusw.exe user/password@database @script4.sql
    What I want is to have a button/link on the APEX screen along with these lines so that when I click that link/button this entire line of command gets executed in the same way it would get executed if I copy and paste this command in the command window of windows.
    Believe me, if I am able to achieve what I intend to do, it is going to save a lot of our DBAs time and effort.
    Any help will be greatly appreciated.
    Thanks & Regards,

  • Calling unix script using oracle forms

    we have to call unix script using oracle forms , a trigger in form calls stored procedure on database
    that stored procedure on database calls a oracle shared library
    but since the only listener account for oracle on our unix server is oralist , whenever a call is made to the unix script from the oracle form , the unix script is executed by oralist user
    but issue that we are having now is since oralist is specific for listening connections from orale we dont want to use this user to establish SFTP on it to avoid any issues with oralist
    we want the sftp to be established on soem other useraccount , so is it possible to do something so that the script is executed by an account other that oralist.

    I'm not a Linux/Unix specialist, but I think this may work: let your database call a shell script that does a su command before running the actual script:
    su - other_account
    your_script.sh

  • How to call java script function from JSP ?

    how to call java script function from JSP ?

    i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks

  • How to call SQL Script in DBMS_SCHEDULER

    How to call SQL Scripts in DBMS_SCHEDULER?
    Things I got working
    1) Successfully created and tested a PL/SQL that was created under SQL Workshop->SQL Scripts (I named it 'TEST'). I was able to run this no problem.
    2) Successfully created a DBMS_SCHEDULER that runs every minutes. (See below)
    begin
      dbms_scheduler.create_job(
        job_name => 'myjob',
        job_type => 'plsql_block',
        job_action => 'null;',
        start_date => '19-JUL-11 03.10.00 PM', /* Remember to use the DB time, not your local time if not specifying a timezone */
        repeat_interval => 'freq=minutely',
        enabled => true);
    end;The problem i am having is to make the PL/SQL script (named 'TEST') runs every minute. Its probably very easy to do that but i dont seems like finding any examples online.
    I tried replacing the job_action attribute to " job_action => 'begin TEST; END;', " However, that did not work.
    I am stuck here for couple hours already, any clues would be great :)
    Thanks in advance
    John
    Application Express 4.1.0.00.32
    Edited by: John Lau on Aug 14, 2012 12:47 PM
    Edited by: John Lau on Aug 14, 2012 12:48 PM

    The PL/SQL is pretty long, I would like to call it from a different location rather then putting the whole coding as part of the argument. Sounds like I should be looking into procedure package in database?
    I will do some more research on procedure package, how to create one and how to call from it.
    Thanks
    John

  • How to call shell scripts

    Hi,
    Please let me know how to call shell scripts from WDA
    Thanks
    Bala Duvvuri

    Hi Bala
    You can not call any client side funcitons using Web Dynpro ABAP, it is possible in BSP using JavaScript.
    You can use Suspend and Resume Plugs to navigate to a BSP page and perform the shell script and return to WDA using Resume Plug.
    http://help.sap.com/saphelp_nw04s/helpdata/en/45/19bf8c16f25d7ae10000000a11466f/frameset.htm
    Now, you can use JavaScript to execute shell script:
    http://www.itjungle.com/mpo/mpo052302-story01.html
    Abhi

  • Calling Unix scripts in ODI

    Hi all,
    I'm having unix scripts for file validation.How and where to call this Unix scripts in ODI?Please be in steps.
    Advance thanks
    Suresh

    Hi Suresh,
    Its very straight forward in ODI.
    For your package, click Tools, under Utilities you will find, OSCommand, type the exact path of your script file and make sure your agent should have all access rights to invoke the script.
    http://img19.imageshack.us/img19/5584/screenshot030z.jpg
    Thanks,
    G

  • Calling Unix-Script from within Oracle and store stdout/stderr in table

    Hi,
    What I want to do is:
    1. Calling a UNIX script (e.g. hello.sh) (from inside the Database)
    hello.sh
    echo “Hello World!“
    2. and get the stdout/stderr output back in my Database in a table (e.g. temp_back)
    table temp_back
    ID     stdout          stderr
    1     Hello World!
    I think Number 1 isn’t a big problem, but how to get stdout back in DB?
    Any solution?
    I searched a bit in this Forum and found this Post.
    re:Calling Host Command Through Database  Procedures or Triggers
    This may be what I am searching for, but can’t access the Link
    Since I am not really fit with UNIX and packages/procedures in Oracle it would be nice if you could post a very detailed answer.
    (Please no java)
    -What packages do I need? (heard DBMS_OUTPUT would be useful)
    -example PL/SQL script
    Thanks a lot!
    Marcus
    Environment:
    Oracle 9.2.0 DB

    Marcus, if you opened the Java sandbox to access any o/s file, you can call any Unix command, shell script, or program, that the Oracle o/s user has exec privs on.
    Just remember that there's a very basic Unix environment when you make the call - the settings in the .profile does not apply. Thus PATH for example is not set. When making the call make sure that the complete path is given. As for the environment, that is a problem as you cannot set that and make the call at the same time.
    In that case it is much simpler to rather write a Unix shell script that does all for you. Set the environment. Run the command(s). Format output. Etc.
    Then you call that Unix script, via Java, from SQL or PL/SQL. Treat the Unix scripts like the Unix-version of stored procedures for your Oracle application.
    Some technical details. When you connect to Oracle, a Unix process services you. This can be either a dedicated server process (servicing only your Oracle session) or a shared server process (from the shared service pool of processes).
    In either case, it is a Unix process running as a background process (thus detached from any tty device). PL/SQL and SQL are executed by this process. The Oracle JVM created by your session also lives in this process. When you therefore make o/s calls, these calls are made by this process.
    Therefore you are limited to what this process can and can't do. E.g. it runs as the oracle o/s user and will fail on accessing paths and commands does the oracle user does not have privs on. Etc.

  • Calling UNix Script from portal Form

    Has anyone conquered this issue through jav or plsql. I need to call a unix script from the portal form when I select the insert button.

    I have several very convoluted ways which all work, but I have always thought there should be more straightfwd ways. Fundamentally the easiest way to call something from the Insert button is to add some PL/SQL code before (or after) the "doInsert();" call in the Insert Button event handler.
    What seems to be lacking is the ability to get from pl/sql to the o/s. So until we know how to do that you have to call a method in Java to execute o/s commands - specifically you can use Runtime.getRuntime().exec(cmd); where Runtime is a class in java.lang, and cmd is the actual o/s command (script or whatever).
    How to call this Java is then where you have several options:
    1. Compile this piece of Java into the Oracle DB as a SP.
    2. Deploy this piece of Java within a Java servlet on a 9iAS instance. Then have another SP call this servlet using the utl_http package (begin_request and other sp's within package).
    Which options would depend on several factors including your preference but most importantly whether you have a DB or a 9iAS instance on the machine where you want to execute the script. If you have neither you have a problem. In such cases I have used a standalone OC4J container which has a very small footprint.
    As I said these methods are all quite convoluted and if anyone else has anything better I would like to know (but they work quite reliably).
    Cheers.
    Anton.

  • 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:50

    When 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

  • Call unix script within Servlet - need to wait for completetion

    Hi,
    I have a servlet which grabs some information from my web form and then calls a unix script.
    This already works fine and does what i need it to do. I now need to add some functionality where i can get the servlet to wait for the unix script to complete before carrying on and then redirecting back to the user.
    the code i have for the current servlet is:
             * EXECUTE THE UNIX COMMAND.
            Runtime   oRuntime  =     Runtime.getRuntime();
            Process   oProcess   =     null;
            String[]      cmd          =     {"/bin/sh", "-c", sPath}; // UNIX
             * ERROR CODES 3 = File not found
            try
              oProcess = oRuntime.exec(cmd);
            catch(Throwable t)
              t.printStackTrace();
            }I am assuming i need some sort of wait method to handle this. Any help would be greatly appreciated.
    Thanks
    Graham

    ok.. you code is fine.. you can run any shell script or program using the exec() method. if you need to wait till the process finishes then you need to call the method waitFor() in class Process.. the method blocks the parent thread (servlet) till the sub process (your exec'd script or program) terminates.
    hope that solves your problem.. :-)
    Pls tell me one more thing.. are you using netBeans or Eclipse for executing the programs or you use standalone tomcat to deploy the application. I have problem in execing programs when i deploy in tomcat 5.5 and the same application works fine in netBeans 5.0. if you know pls help me too..
    Thanks,
    -- abdel Olakara.

  • Call Unix Script from JSP.

    Hi,
    I need to run a unix script from a JSP page.
    JSP pages reside on a different machine.
    How can i call the unix script resides on different machine from JSP.
    Thanks,
    Narendra

    yah. I can access that machine telnet and having all credentials of that system.
    Can you please share the code needed for this.
    Thanks,
    Narendra

  • How to execute Linux OS command  from ODI

    We have installed Oracle data integrator on windows machine and want to execute linux OS command in a procedure or scenario from ODI .
    How could i do that ?
    I can see os command elements but they do not work, only windows commands work.There should be linux technology i think

    Obviously you can execute Unix OS commands only on Unix OS. Why do you expect Windows to understand it?
    The solution in your case would be executing your ODI scenarios with an Agent installed on Unix machine.
    Cheers

Maybe you are looking for

  • Two temp tables in a Stored Procedure

    Hi guys, Is it feasable to use two stored procedures and form joins between them within a single stored procedure. I am trying a workaround for cursors in SYBASE. Thanks, Developer

  • Trying to connect HP1020 to new MacBook air

    Hello, I'm trying to connect my HP Laserjet 1020 to my new MacBook Air. I have a cable so it's not wireless. It's an excellent printer, has served me for years and I really don't have the money to buy a new one. Is there any way I can use the printer

  • How to Maintain Info related to an Applicant's race in PB10

    Hi All, I am currently configuring Recruitment Module. I would like to know what's the equivalent of Infotype 77, that I would need in TCODE: PB10 ( Initial Entry of Applicant Data) in order for me to maintain the race info of an applicant. This is n

  • Advantage of NAT IP Pool for PAT

    Hi support community, would there be any benefits from using a small pool of public IPs (outside global addresses) to perform PAT instead of using a single IP address that is nomally associated with outside interface? We have enough public IPs where

  • Formatting a timestamp into string with $ specifier

    Formatting a timestamp into string with $ specifier does not work; the formatted string is empty and no error is reported: I have forced the width to 10 to show that the format is at least partially scanned but when it is omitted the timestamp field