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.

Similar Messages

  • Can any one tell me how can i call a shell script from pl/sql

    i like to call shell script from pl/sql procedure.
    can any one suggest how can i do this

    Have you not mastered in asking the same kind of question ?
    First do write a script...
    no one will spoon feed you.
    How can i call a shell script from procedure
    How to call Shell Script from pl/sql block
    -Sk

  • How can i call a shell script from procedure

    I have a shell script.now i am i a situation to call that shell script from one of my procedures and need to get a value from that script.
    can u suggest me that how can a call the shell script from pl/sql?

    Is the same question you asked here
    How to call Shell Script from pl/sql block
    -SK

  • 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

  • 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,
    RD

    In 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"

  • 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

  • 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 Advance

    I 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 oracle stored procedure.. urgent!!!!!!!!!!!!

    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
    ramya

    Hi,
    Register your Shell Script as a concurrent program, Executable execution method "Host", then use fnd_request.submit_request to submit the program.
    Regards,
    Andries

  • Scheduling unix shell scripts from windows using DOS batch files

    Hi,
    I want to schedule unix shell scrips using windows scheduled. I have the option of scheduling the DOS batch files. But not able to connect to telnet using DOS. Please let me know if there is an option.
    Regards,
    -Anand

    Drive letters are user specific. When you run jboss it runs as you, with your shared drives. When you run it as a service, it runs as guest or another user so your drive letters are meaningless.
    Either setup the user or use UNC

  • How can i call a CGI script from java?

    The subject pretty much says it all. I want to call a perl cgi script so i can read from/write to files on a server. I don't know how to sign applets and this would be the easiest way for me, if someone could please tell me.

    Let me get this clear. Basically what u want to do is to just call a URL, right?
    U can do it by using the following code:
    import java.applet.*;
    import java.net.*;
    import java.io.*;
    public class testhttp
    public static void main(String[] args)
    try
    URL url = new URL ("http://../testcgi.cfm");
    HttpURLConnection cxn =
    (HttpURLConnection)url.openConnection();
    cxn.setRequestMethod("POST");
    cxn.setUseCaches(false);
    cxn.setDoOutput(true);
    cxn.setDoInput(true);
    ByteArrayOutputStream bytes = new
    ByteArrayOutputStream(400);
    PrintWriter writer = new PrintWriter (bytes,true);
    writer.print("application=map&release=1&items=prog1");
    writer.flush();
    cxn.setRequestProperty("Content-
    Length",String.valueOf(bytes.size()));
    cxn.setRequestProperty("Content-
    Type","application/x-www-form-urlencoded");
    bytes.writeTo(cxn.getOutputStream());
    System.out.println(bytes);
    String currentLine;
    BufferedReader in = new BufferedReader (new
    InputStreamReader(cxn.getInputStream(),"8859_1"));
    while((currentLine = in.readLine()) != null) {
    System.out.println(currentLine); }
    catch(Exception e) { e.printStackTrace(); }
    There is also a library called HTTP client which can be found at:
    http://www.innovation.ch/java/HTTPClient/index.html
    It's very simple to use and the documentation is all there, but their web server seems to be down right now.
    Anyway, hope my post helps.

  • 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.

  • Need Example on calling a unix shell script from oracle stored procedure

    Hi
    Can anybody give example on how to call unix shell script from an Oracle stored procedure. Please give a small example on how to do this .I need this urgently please.
    Have a nice time.
    Thanks & Regards
    Jogesh

    If you are on 10g you can also use DBMS_SCHEDULER. See Re: Excute Unix command Using PL SQL

  • Invoking unix shell scripts from java?

    Hi,
    could someone explain to me how one wuld invoke unix shell scripts from java.
    Also, could you invoke Visual Basic scripts from java.
    Finally, could you do this from an EJB?
    thanks for any help....
    sudu

    I just posted a snippet of this solution in the topic about widows commands chech it out it works just fine for unix shell scripts.
    --Ian                                                                                                                                                                                                                                                                                       

  • Can I call host file ( Unix Shell script ) from Oracle 10g trigger

    Hi,
    I am new to Oracle 10g. Can I call host file ( unix shell script ) from Oracle 10g trigger ?. I know it is possible. Pl explain me with small example
    thanks & regards
    parag

    user12009546 wrote:
    Hi,
    I am new to Oracle 10g. Can I call host file ( unix shell script ) from Oracle 10g trigger ?. I know it is possible. Pl explain me with small example
    thanks & regards
    paragIf you are in 10g, you can simple call shell script from DBMS_SCHEDULER:
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'TEST_SCRIPT',
    job_type => 'EXECUTABLE',
    job_action => 'PATH_OF_YOUR_SCRIPT',
    start_date => SYSDATE,
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
    enabled => TRUE,
    comments => 'Shell script from Oracle'
    END;
    /

  • Call a UNIX shell script from an oracle stored procedure

    We need to call a UNIX shell script from an oracle stored procedure
    i.e. the control should come back to the procedure once the script completes. Can any body help to achieve this ?

    There are various ways in achieving this.
    For Example, you can call a PRO*C-Library residing on the database server.
    This requires a PL/SQL library to be generated and some changes to the Listener configuration.
    It is also possible to implement a java procedure on the database being invoked by a PL/SQL wrapper class.
    In this way (and if used right) there is also granularity regarding the filestructure permissions given and it may be called during a Forms or other PL/SQL session.
    The article below explains a more generic approach how to invoke shell commands from within an Oracle Instance.
    Be careful with this, because it really works ;)
    Refer to :
    http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php
    Message was edited by:
    user434854

Maybe you are looking for

  • JMIP Print in Scheduling agreement

    Dear Friends, I am not getting the print of JMIP (excise duties) in scheduling agreement, but in Po i get this, I have maintained FV11 & selected tax code. Kindly give the solution. regards, MD

  • My external hard drive does not show when I am trying to open a document in Office Org??

    My external hard drive does not show when I am trying to open a document in Office Org?? When looking in the about IMAC system support it shows as being connected. Any ideas??

  • Photo Album buttons not working

    Hi, I created a photo album in Photoshop. This is how it views after it's created: http://oxford2.readyhosting.com/test/gallery/test.html When I put the file into my template the pause/play buttons aren't displaying. http://oxford2.readyhosting.com/t

  • Select on dba_waiters

    Hi All, We have recently upgraded our db from 10.2.0.4 to 11.2.0.2, and now we have an issue with query on dba_Waiters. when we do the select * from dba_waiters, it is taking very long time and finally getting failed with temp after running for 30min

  • Submitting information on a website

    Just recently I have been noticing that when I submit info ( for example a auction listing on listia.com) after supplying the info I press "submit" and the page goes back to the form and I have to re-submit the info again. The same goes true for a fe