Calling unix commands

is it possible to execute UNIX commands from database procedures, say i'm trying to call the logger utility of unix? this procedure is not called from forms it runs at the backend only.
thanks,
victor

Check it out at : http://www.dbasupport.com/forums/showthread.php?threadid=3703
http://www.dbasupport.com/forums/showthread.php?threadid=2688
null

Similar Messages

  • Call unix command in sqlplus script

    Hello, I wanna to know how to call a unix command in the sqlplus script.
    For exemple,
    I've a sqlplus script to lauch a oracle report, after the report is generated, I wanne to replace the output file in an other directory.
    So that, I have to call the unix command mv here in the sqlplus script
    How can I do it?**
    I completed my situation:
    I don't have dbms_scheduler untility in my database.
    Thanks a lot for your help
    Edited by: user11930885 on 17 janv. 2010 14:53

    Yes, at the begining, I'll tried the unix shell by calling SQL.
    I've the problem of passing the parameters through.
    It seems to me
    we can use
    Host in the SQLPLUS to run the unix command.
    but I've written it in my sqlplus script, it doesn't work. so I wanna to find an exemple how to use HOST in sqlplus script?
    I would have loved to give you an example..but its not unix on my laptop.
    But what i can tell you is...u should be doing otherway round.
    Not calling Unix commands from SQL but calling SQL's form unix.
    You got shell scripts for that.
    Write a shell script. Login to SQL execute your code.
    exit from sql and then move your file with MV. That's it.
    Do post how far you get after trying this.

  • Call Unix Command From Reports Using Java

    Hi,
    Could somebody please show me a sample coding to call Unix command from 10g report using java?
    In metalink doc id 361857.1 does not show much.
    Thanks,
    neemin

    Hi,
    I have a problem with synchronization of the java commands.
    In the Before Parammeter Form trigger, I have:
    function BeforePForm return boolean is
    rt ORA_JAVA.JOBJECT;
    proc ORA_JAVA.JOBJECT;
    v_txt varchar2(32000);
    i integer := 0;
    v_cd_modulo int;
    v_arqlog text_io.file_type;
    cursor c_evento is
    select codigo,
    nome
    from
    (select e.cd_evento || e.cd_edicao codigo
    ,nm_evento nome
    from grh_ev_evento e
    where e.CD_GRUPO in (select cd_grupo
    from grh_ev_adm
    where cd_usuario = (select cd_usuario
    from usuario
    where login_usuario = :AUTHID)))
    order by substr(nome, 11);
    begin
    -- Create the context for logged user
    if instr(upper(nvl(:AUTHID,'RWCLIENT')),'RWCLIENT') > 0 then
    :AUTHID := :SSO_USUARIO;
    end if ;
    TCEENV.SET_TCEENV(:AUTHID);
    if PK_SCA.SCA_GET_USER_RIGHTS(:sca_module_name, :AUTHID) IS NULL then
    srw.message(100, 'Access denided!');
    return (FALSE);
    end if;
    -- Create file in Report Server (UNIX)
    v_txt := '<BR>' || htf.formSelectOpen('P_EV_EDICAO', 'Evento: ');
    :p_file := '/u03/SCAWEB/repout/' || :sca_module_name || '_' ||
    pk_sca.sca_encrypt(:AUTHID || to_char(systimestamp, 'ss.ff'));
    v_arqlog := text_io.fopen (:p_file, 'A');
    text_io.put_line (v_arqlog, v_txt);
    for reg in c_evento loop
    i := i + 1;
    if i = 1 then
    v_txt := '<OPTION SELECTED VALUE="' || reg.codigo || '">' || reg.nome;
    else
    v_txt := '<OPTION VALUE="' || reg.codigo || '">' || reg.nome;
    end if;
    text_io.put_line (v_arqlog, v_txt);
    end loop;
    v_txt := '</SELECT></CENTER></form></BODY> </HTML>';
    text_io.put_line (v_arqlog, v_txt);
    text_io.fclose (v_arqlog);
    SRW.SET_AFTER_FORM_HTML(SRW.FILE_ESCAPE, :p_file);
    rt := RUNTIME.GetRuntime();
    proc := RUNTIME.exec(rt,'rm ' || :p_file);
    return (TRUE);
    end;
    The problem is that there isn't a "synchronize" command, and the
    RUNTIME.exec(rt,'rm ' || :p_file) don't works (it does nothing) because
    the SRW.SET_AFTER_FORM_HTML has a large delay and the following
    command is ignored.
    How can I solve it?
    thanks,
    lmprestes

  • ASAP:stored proc calling Unix commands

    i want an Oracle stored procedure to call unix commands as well as do sqlldr ... opern.
    requirement is :
    the stored procedure needs to do :
    for all files in a Directory:
    do
    { .. use sqlldr to insert data in tbls
    .. move the processed file into another directory
    so,for ls &mv commands i need the Command/way out.
    null

    Hi Jorma,
    It's been a while since I did it, but I successfully did what you
    are trying to do. All I did was "load" the remote interface and
    "stub" class into the database using the "loadjava" utility. My
    environment was Oracle 8.1.7 on SUN (Sparc) Solaris 7.
    Although I haven't tried it, you may be able to invoke a servlet
    from your java stored procedure. The advantage over RMI is that
    you don't need to generate and load a "stub" class. Naturally, you
    would use the "java.net.URLConnection" class to invoke a servlet
    on some web-server/servlet engine which you can communicate with
    using "streams" -- java.io.InputStream and java.io.OutputStream
    Also, I understand that there is now a "oc4jclient.jar" (not 100%
    sure of the name) file that can be "loaded" into the database,
    which allows you to contact EJB's in Oracle's OC4J product. I
    think you can either do this directly, or indirectly using JMS
    over Oracle AQ.
    [JMS = Java Messaging Service]
    [AQ = Advanced Queueing]
    Good Luck,
    Avi.

  • Call unix commands from stored procedures

    My stored procedure requires to call unix commands HOW DO I DO IT?
    null

    i do not know pl sql but in java you can use:
    Runtime.getRuntime().exec("YOUR UNIX COMMAND");
    real example:
    Runtime.getRuntime().exec("ls");
    but you must be careful with using that...
    especially if you want to wait till the process finishes..
    rgds,

  • Calling unix command in Apex Window

    I am working on a small project where in; it would be handy to run an external plsql in oracle database which calls for unix command such as tail -f alert.log or tail -1000 alert.log when a button is pressed in the application.
    I know the client and server aspect and very difficult to forward the server output to Application specially web based but still thought of trying my luck to get some insights from this forum .
    Is this possible in Apex ?
    UK

    Don't see why not. All the building blocks are there (assuming a recent version of the database, and that 1000 is a realistic metric of the data volume):
    1. A script to run the required UN*X commands.
    2. An initial log extract file created manually using the script.
    3. An external table on the log extract file.
    4. An external scheduler job to rerun the log extract script to refresh the log extract.
    5. An APEX page with a report based on the external table, and a button that calls the external job.
    Note that providing relevant information when asking a question is helpful in determining a solution:
    - APEX version
    - DB version and edition
    - Web server architecture (EPG, OHS or APEX listener)
    - Browser(s) used
    - Theme used
    - Templates used

  • Calling UNIX command from PL/SQL Procedure

    Is there a way to call a UNIX command (exa. ls) from within a PL/SQL stored procedure? Looking through the various packages, I didn't see anything that would give me this ability.
    I also looked through all the previous questions and nothing looked encouraging.
    Thanks in advance,
    Russ

    Russ,
    I thought I'd read a similar question awhile ago and did a search on the word host in this forum and found the following from July 9th that might help you:
    http://technet.oracle.com:89/ubb/Forum88/HTML/001611.html
    In that post I think the link listed by Barbara Boehmer in has changed to:
    ]http://asktom.oracle.com/pls/ask/f?p=4950:8:24579::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:16212348050,{host}
    It looks like they give solutions for Oracle 7, 8 and 8i.
    Good site Barbara, I've added it to my bookmarks.
    Hope this helps.

  • Calling Unix command from the plsql

    Hi ,
    I am executing java code from the UNIX Shell script. Before executing this command i want to write plsql code to and pass the files to java command.
    In the plsql code i want to select request id's using the cursor and find the .out files for each request id in the outfile path. once the file is found i want to copy that .out file to the current directory where the java command is going to execute.
    Please suggest me how to use UNIX Command (in my case "cp") to copy the .out file from the outfile path to current directory after opening the cursor.

    If I understand you correctly, you want to generate a log of request id's from the database and send this to the operating system whereby you will execute the following:
    <p>
       <font face="courier">java org.apache.xalan.xslt.Process -XSL combinedfsg.xsl -OUT output.xml</font>
    <p>
    If that is correct, then you should be able to perform all of this w/ PL/SQL by generating the log from the database and write it to the O/S w/ UTIL_FILE. If you want to execute the java code at this point, you should be able to utilize Tom's method with the following:
    <p>
       <font face="courier">exec rc('java org.apache.xalan.xslt.Process -XSL combinedfsg.xsl -OUT output.xml');</font><p>

  • How to Move file / call UNIX command using ABAP Program

    Hi, ABAP Guru.
    I need to Cut & Paste file (Move file from one location to another location) on Network Shared Drive using ABAP program.
    But I can't figured out how to do this and what ABAP Command / FM / Method (and maybe UNIX command) that being used.
    Please give me the advice.
    Best regard and Thank you all.
    Nattapash C.

    all methods for your requirements should be in class CL_GUI_FRONTEND_SERVICES

  • Shortdump while calling UNIX command

    Hi all,
    I have a problem while trying to remove a file in UNIX platform in ABAP program.
    It is working fine in the development and quality server, but not in production server.
    Based on the debug result, the shortdump was thrown while executing "CALL 'SYSTEM' ID 'COMMAND' FIELD lv_command".
    Below are the message return in the program shortdump
    How to correct the error                                  
        You can check the authorization beforehand with the   
        function module AUTHORITY_CHECK_C_FUNCTION.           
    Short text                                            
        No authorization to call the C function "SYSTEM". 
    DATA: lv_command(100) TYPE C,
            client_path LIKE RCGFILETR-FTAPPL,
            server_path LIKE RCGFILETR-FTAPPL.
      DATA: wa_files  TYPE rsfillst,
            it_files  LIKE TABLE OF wa_files.
      CALL FUNCTION 'SUBST_GET_FILE_LIST'
        EXPORTING
          dirname      = gv_unix
          filenm       = '*'
        TABLES
          file_list    = it_files
        EXCEPTIONS
          access_error = 1
          OTHERS       = 2.
      IF  sy-subrc = 0.
        LOOP AT it_files INTO wa_files WHERE TYPE <> 'directory'.
          CONCATENATE wa_files-dirname wa_files-name INTO server_path.
          CONCATENATE p_fname wa_files-name          INTO client_path.
          CALL FUNCTION 'C13Z_FILE_DOWNLOAD_ASCII'
            EXPORTING
              i_file_front_end    = client_path
              i_file_appl         = server_path
              I_FILE_OVERWRITE    = 'X'
            EXCEPTIONS
              FE_FILE_OPEN_ERROR  = 1
              FE_FILE_EXISTS      = 2
              FE_FILE_WRITE_ERROR = 3
              AP_NO_AUTHORITY     = 4
              AP_FILE_OPEN_ERROR  = 5
              AP_FILE_EMPTY       = 6
            OTHERS                = 7.
          IF sy-subrc = 0.
            concatenate 'rm -f' server_path into lv_command separated by space.
            condense lv_command.
            CALL 'SYSTEM' ID 'COMMAND' FIELD lv_command.
            CLEAR: lv_command.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Anyone knows why and how to resolve this?
    Kindly provide your feedback and input. Thanks in advance.

    You don't have authorisation in PRD to remove files. If it is really required for you.
    Take SU53 screen shot  immediately once you get short dump and follow up with Basis Folks for required authorisation.
    Thanks,
    Raj

  • Calling UNIX Command from another server using ODIOScommand utility

    Hi,
    My unix script 'runmanger'  is on another server say 'St23456wer' under  /u10/DV2/ofsaa/fic/xxx/bin. I want to call this 'runmanager' using ODIOSCommand. My ODI agent is installed on different server. I can ping 'St23456wer' server from ODI server. How can I call this unix script.

    My only experience with this is connecting to source files on a remote linux server and the two options I was presented with were 1) creating a mount to make the files 'local', or 2) set up a new agent on the remote server.
    One of the gurus may have a better answer for you.

  • ASAP: How a stored proc calls OS(unix)Commands

    urgent!!
    My stored procedure requires to call unix commands HOW DO I DO IT?
    my rqrmnt is :
    stored proc is :-
    1.for each file in a directory($ls)
    do
    2.sql stmnts of insert etc
    /OR
    use sqlldr for the same.
    done.
    ** how do i do both the operations 1&2 in the same Oracle procedure?

    I know HOST can be used in form for OS command but I never thought about doing OS command in the stored procedure.
    Hmm...........
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected] ... ([email protected]):
    urgent!!
    My stored procedure requires to call unix commands HOW DO I DO IT?
    my rqrmnt is :
    stored proc is :-
    1.for each file in a directory($ls)
    do
    2.sql stmnts of insert etc
    /OR
    use sqlldr for the same.
    done.
    ** how do i do both the operations 1&2 in the same Oracle procedure?
    <HR></BLOCKQUOTE>
    null

  • Call an interactive UNIX command from java

    Hi,
    I want to call a UNIX command from java. When issue the command 'htpasswd -c filename username' on UNIX terminal, it asks for the new password and the then confirmation password again (yeah, unfortunately the htpasswd installed on our system does not allow you proivde the password on the command line. So have to work interactively ). Now, I have written a simple java program RunCommand.java. I am hardcoding the password for the htpasswd command in the file (in the real situation, password will be generated dynamically). I want to issue 'java RunCommand' on the UNIX command line and get back the command prompt without being asked for the password twice. The code is below, but the Outputstream does not work as expected. It always asks for inputs. Any idea? Many thanks.
    import java.io.*;
    public class RunCommand {
    public static void main(String args[]) throws Exception {
    String s = null;
    try {
    String cmd = "htpasswd -c filename username ";
    // run a Unix command
    Process p = Runtime.getRuntime().exec(cmd);
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    OutputStream stdOut = p.getOutputStream();
    String pswd = "mypassword";
    while ((s = stdInput.readLine()) != null) {
         s = stdInput.readLine();
         stdOut.write(pswd.getBytes());          
         stdOut.flush();
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null) {
    System.out.println(s);
    stdOut.close();
    stdInput.close();
    stdError.close();
    System.exit(0);
    catch (IOException e) {
    System.out.println("exceptions caught: ");
    e.printStackTrace();
    System.exit(-1);

    There are only about 9 billion responses a day on how to do this. Use the search feature.

  • Call a unix command

    Hi Community,
    It's possible to create a program that a call does a unix command.
    I would like created a synchronous scenario.
    Then the program call a unix command and this is waiting up to when a unix command termined a runtime.
    The command returned a data and the ABAP program will owe to take back the esecution.
    I hope in you
    Thank's everybody.

    Hi Antonello,
    i'd do it with different job steps (SM36)
    1) Program1, which does a unix command:
    syntax:
      CALL 'SYSTEM' ID 'COMMAND' FIELD COMMAND
                    ID 'TAB'     FIELD TABL-SYS.´
    or have a look here: external commands
    2) Program2 handle the output (e.g. a file) of program 1
    regards Andreas

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

Maybe you are looking for

  • Want to find out how a batch classification is used

    Hello I have previously sent out a message and the idea given was not very helpful. Anyway, this is my question: I have found a class and its characteristic which was setup in the system and I would like to know how this classification` is being use

  • Mail Sender Adapter with multiple sMIME attachments

    Hi! I 'm using XI 3.0 SP 15. I have problems with my Mail-Sender-Adapter. The mails, I fetch, contain a certificate and multiple xml-attachments. The xml's represent an IDOC-structure (INVOIC.INVOIC02). The task is to first check the certificate, and

  • My Ipod us stuck with a usb port and a little itunes symbol

    When I was doing an update for my ipod touch my ipod turned off and now there is a usb port symbol and a arrow and a itunes logo and now its froze like that i have tryed somethings but thay havent worked. =(  please heelp!!!

  • TEST DATA for *PurchaseOrderCreateRequestConfirmation_In*

    BPM Experts , We are consuming the service " PurchaseOrderCreateRequestConfirmation_In" from the HU2 system in one of my BPM process . But when I am testing it in the WS Navigator I am not able to fill the right input parameters . Please provide me w

  • K7N2 - Bios Checksum Error - But wont load program to flash bios

    Hi there, my computer restarted itself due a problem with windows (kernel dll or something arather), since then it wont boot at all, beeps twice and says Bios Checksum error. Now i understand this means the Bios is corrupted and i need to re-flash it