This discussion is archived
11 Replies Latest reply: Nov 25, 2012 2:49 PM by larssjostrom RSS

Using Linux command line commands through PL/SQL

ac4991 Newbie
Currently Being Moderated
Hi Guyz,
I need to use linux command 'rwrun report=xyz.rdf userid=apps/apps' to run a report locally but through a PL/SQL Procedure.

Is this concept feasible? If Yes, then how?

Plz Reply
Regards
  • 1. Re: Using Linux command line commands through PL/SQL
    rzuluaga - Oracle Expert
    Currently Being Moderated
    Hi,
    you can try this feature.

         Event-Driven Publishing using Database Trigger in Reports 9i/10g/11g (Doc ID 199743.1)

    Regards, Roberto
  • 2. Re: Using Linux command line commands through PL/SQL
    ac4991 Newbie
    Currently Being Moderated
    Hi roberto,

    Thanks for the reply.

    I've studied the Event-driven publishing through database triggers.
    But wasn't able to achieve what was desired. Is it possible for u to provide me a li'l bit more detailing about how to use event-driven publishing.
    Some working examples would be great.

    Please reply ASAP,
    Regards
    Ari
  • 3. Re: Using Linux command line commands through PL/SQL
    tony.g Journeyer
    Currently Being Moderated
    Or maybe something here would help:

    Java running host command - moved from PL/SQL forums

    rgds
    Tony
  • 4. Re: Using Linux command line commands through PL/SQL
    ac4991 Newbie
    Currently Being Moderated
    Hi Tony,

    Thanks for the reply. :)

    The topics included in the thread were all related to the structure and script of the java source and the publishing, which is not the one making a problem for me.
    What the problem is, is the pl/sql call and the command passed.

    The java source is compiled successfully, the publishing of java source is successfully compiled. But when i do the pl/sql calling section by the following script:
    SET ServerOutput    ON;
    DECLARE
    POutput    Dbms_Output.Chararr;
    PLines     INTEGER := 1000;
    BEGIN
    Dbms_Output.Enable(1000000);
    Dbms_Java.Set_Output(1000000);
    Amrit_Developers_Toolkit.ExecuteCmd(p_command => '/d02/clone-appl/apps/tech_st/10.1.2/bin/rwrun report=/d02/clone-appl/apps/apps_st/appl/gl/12.0.0/reports/US/AMRIT_BS_TFRM.rdf userid=apps/apps desformat=pdf destype=file desname=/d02/clone-appl/apps/apps_st/appl/gl/12.0.0/reports/US/AMRIT_BS_TFRM.pdf PERIOD_NAME=''APR-11-12'' P_ACCESS_SET_ID=1000 P_ORG_ID=82 P_UNIT=11');
    Dbms_Output.Get_Lines(POutput,PLines);
    FOR i IN 1 .. PLines
    Loop
    Dbms_Output.Put_Line(POutput(i));
    END Loop;
    END;

    It gives me an output: Process err :/d02/clone-appl/apps/tech_st/10.1.2/bin/rwrun: error while loading shared libraries: libjvm.so: cannot open shared object file: No such file or directory

    This is what i'm not able to resort. Plz help me guyz ...

    Regards
    Ari

    Edited by: ac4991 on Nov 20, 2012 5:11 AM

    Edited by: ac4991 on Nov 20, 2012 5:12 AM
  • 5. Re: Using Linux command line commands through PL/SQL
    tony.g Journeyer
    Currently Being Moderated
    Sorry, I thought that your problem was getting it started in the first place.

    It sounds like you might not have LD_LIBRARY_PATH env variable set.


    Tony

    Edited by: tony.g on Nov 20, 2012 4:44 PM
  • 6. Re: Using Linux command line commands through PL/SQL
    ac4991 Newbie
    Currently Being Moderated
    Hi Tony,

    Thanks for the reply. :)

    I heard this from lot of people, but i need a li'l more detailing in it.
    I mean, yepp i need to some define environment variable or may be adding a path to a certain existing environment variable. The point is, which variable and what path.

    Few current environment variables defined are:

    Environment Type: *"tools_home"*
    ORACLE_HOME= +/d02/clone-appl/apps/tech_st/10.1.2+
    PATH= +/d02/clone-appl/apps/tech_st/10.1.2/bin+
    +:/usr/bin+
    +:/usr/sbin+
    +:/d02/clone-appl/apps/tech_st/10.1.3/appsutil/jdk/jre/bin+
    +:$PATH+
    JAVA_HOME= +/d02/clone-appl/apps/tech_st/10.1.3/appsutil/jdk/jre+
    LD_LIBRARY_PATH= +/d02/clone-appl/apps/tech_st/10.1.2/lib32+
    +:/d02/clone-appl/apps/tech_st/10.1.2/lib+
    +:/usr/X11R6/lib+
    +:/usr/openwin/lib+
    +:/d02/clone-appl/apps/tech_st/10.1.2/jdk/jre/lib/i386+
    +:/d02/clone-appl/apps/tech_st/10.1.2/jdk/jre/lib/i386/server+
    +:/d02/clone-appl/apps/tech_st/10.1.2/jdk/jre/lib/i386/native_threads+
    +:/d02/clone-appl/apps/apps_st/appl/sht/12.0.0/lib+

    Environment Type: *"web_home"*
    ORACLE_HOME= +/d02/clone-appl/apps/tech_st/10.1.3+
    PATH= +/d02/clone-appl/apps/tech_st/10.1.3/bin+
    +:/usr/bin+
    +:/usr/sbin+
    +:/d02/clone-appl/apps/tech_st/10.1.3/jdk/bin+
    +:$PATH+
    JAVA_HOME= +/d02/clone-appl/apps/tech_st/10.1.3/jdk+
    LD_LIBRARY_PATH= +/d02/clone-appl/apps/tech_st/10.1.3/lib32+
    +:/d02/clone-appl/apps/tech_st/10.1.3/lib+
    +:/usr/X11R6/lib+

    Location of libjvm.so: +/d02/clone-appl/apps/tech_st/10.1.2/jdk/jre/lib/i386/client+
    +:/d02/clone-appl/apps/tech_st/10.1.3/jdk/jre/lib/i386/client+

    I guess this much info may be sufficient. So, if u can offer me something to make this working, please share !!
    Thanks once again :D

    Regards
    Ari
  • 7. Re: Using Linux command line commands through PL/SQL
    tony.g Journeyer
    Currently Being Moderated
    Is there a rwrun.sh ?

    I seem to remember that in general we don't tend to use the rwrun executable directly.

    Tony
  • 8. Re: Using Linux command line commands through PL/SQL
    ac4991 Newbie
    Currently Being Moderated
    Hi Tony,

    Is it so? .. the rwrun.sh is present there in the location which i passed into the OS Command.

    Regards
    Ari
  • 9. Re: Using Linux command line commands through PL/SQL
    ac4991 Newbie
    Currently Being Moderated
    Hi guyz,

    I need some solution & fast, .. my boss is on my head :(
    Plz save my life.

    Regards
    Ari
  • 10. Re: Using Linux command line commands through PL/SQL
    larssjostrom Newbie
    Currently Being Moderated
    I would study the Dbms_scheduler package.
  • 11. Re: Using Linux command line commands through PL/SQL
    larssjostrom Newbie
    Currently Being Moderated
    http://docs.oracle.com/cd/E11882_01/appdev.112/e16760/d_sched.htm#i1010013 and maybe this one http://myoraclerants.blogspot.se/2010/04/executing-linux-shell-script-through.html

    Edited by: Lars Sjöström on Nov 25, 2012 11:48 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points