Trying to run external dbs script from PERL

I am trying to execute a simple statement from inside a DBI connection of PERL. Here is the statement:
$dbh = DBI->connect("dbi:Oracle:${service}","${owner}","${owner}",{ RaiseError => 1}) || die "Database connection not made: $DBI::errstr\n";
$sth = $dbh->prepare("\@c:\\perl\\scripts\\test.sql");
$rv = $sth->execute;
while ( (@row = $sth->fetchrow_array) ) {
     print "row=@row\n";
The error I get is invalid sql statement
Its on a Windows box and I can't figure out how to call an external script to run in Oracle. If anyoen knows, it would be greatly appreciated
Thanks

$sth = $dbh->prepare("\@c:\\perl\\scripts\\test.sql");You can't prepare a SQL statement like this. This is not sql statement. It's rather a way of sqlplus calling external script file. A SQL statement is something like
select user from dualIf you want do this, maybe it's better just
`$ORACLE_HOME\bin\sqlplus -s user/pass@tns @c:\perl\scripts\test.sql`

Similar Messages

  • Unable to run OpenScript Functional Scripts from OTM

    Hi,
    I am unable to run OpenScript Functional Scripts from OTM, but the same script is running successfully on OpenScript.
    I have a script which has all my functions (say Script A) and I am calling these functions from a different script (Script B) and even this script (Script B) uses couple of Databanks.
    Added both the scripts to OTM and when I run the script (Script B) which is calling the functions on OTM, I see the below error message.
    Error Message: Child script with alias "Proceure_ To_Pay_Functions" not found. Add to the script "Proceure_To_Pay" a script asset with alias "Proceure_ To_Pay_Functions"
    But the child script (Script A) with functions is added as a script asset in OpenScript to the calling script (Script B) and this script is running fine from OpenScript.
    Can anyone please help me in resolving this issue.
    Thanks,
    Satya

    Hi Deepu,
    It worked and able to run the scripts developed in OpenScript from OTM. Thanks for your help!!
    But I see another problem where when I try to run the script from OTM, I see a window Interactive Services Detection with a Message
    "A program running on this computer is trying to display a message" "The Program might need information from you or your permission to complete a task." with Two Options
    -> View The Message
    -> Ask me Later
    When I click on View the Message, I can see my application running by script but my desktop is not visible.
    There is another window with Return to Desktop option, when I click on this I can see my Desktop.
    Can I not see both my Desktop and application running on the same screen?
    Please help!!
    Thanks,
    Satya

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

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

  • Media file path in IP IVR - Run external VRU script

    Hi all,
    I am configuring ICM script by using run external vru script which is located in IP IVR server. But, I am not sure how pass media file path from ICM script to VRU script.
    Last time, I used  IVR version 7.0. I set the path such as: c:\MediaServer\english. Now, I am running IVR version 10 with en_US language.
    Any advise?
    Thuc

    Hi,
    I try to your guide but still silent. Log file is:
    01 15:10:42.398 ICT %MIVR-SS_CMT-7-UNK:init:: flushDTMF=true DTMFBuffer.size=0
    344389: Apr 01 15:10:42.398 ICT %MIVR-LIB_MEDIA-3-PROMPT_ERROR_IGNORED:Prompt error ignored: Exception=com.cisco.prompt.UndefinedPromptException: unable to append prompt: Vietnamese\Loichao.wav; nested exception is: 
    java.io.IOException: file not found: Vietnamese\Loichao.wav
    344390: Apr 01 15:10:42.398 ICT %MIVR-LIB_MEDIA-3-EXCEPTION:com.cisco.prompt.UndefinedPromptException: unable to append prompt: Vietnamese\Loichao.wav; nested exception is: 
    344391: Apr 01 15:10:42.398 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: java.io.IOException: file not found: Vietnamese\Loichao.wav
    344392: Apr 01 15:10:42.398 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.prompt.FilePrompt.appendTo(FilePrompt.java:229)
    344393: Apr 01 15:10:42.398 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.prompt.DocumentPrompt.appendTo(DocumentPrompt.java:264)
    344394: Apr 01 15:10:42.398 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.prompt.ConcatenatedPrompt.appendTo(ConcatenatedPrompt.java:169)
    344395: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.cmt.dialogs.CMTDialogImpl.appendPrompt(CMTDialogImpl.java:165)
    344396: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.cmt.dialogs.CMTDialogImpl.playCompositePrompt(CMTDialogImpl.java:140)
    344397: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.cmt.dialogs.CMTDialogImpl.playInitialPrompt(CMTDialogImpl.java:110)
    344398: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.cmt.dialogs.CMTDialogImpl.playPrompt(CMTDialogImpl.java:92)
    344399: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.cmt.dialogs.CMTSimpleRecognitionDialogImpl.dialogLoop(CMTSimpleRecognitionDialogImpl.java:109)
    344400: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.cmt.dialogs.CMTSimpleRecognitionDialogImpl.run(CMTSimpleRecognitionDialogImpl.java:87)
    344401: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.app.impl.ApplicationManagerImpl$TaskImpl$ActionImpl.run(ApplicationManagerImpl.java:7757)
    344402: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.app.impl.ApplicationManagerImpl$TaskImpl.doInterruptible(ApplicationManagerImpl.java:7560)
    344403: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.dialog.DialogObjectImpl.invoke(DialogObjectImpl.java:632)
    344404: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.steps.ivr.MenuStep.execute(MenuStep.java:394)
    344405: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.obj.WFBeanStep.executeImpl(WFBeanStep.java:141)
    344406: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.obj.WFStep.execute(WFStep.java:174)
    344407: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.obj.WFWorkflowTask.executeStep(WFWorkflowTask.java:494)
    344408: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.engine.core.WFEngineWorkflowTask.executeStep(WFEngineWorkflowTask.java:122)
    344409: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.app.impl.WFWorkflowAppDebugTaskWrapper.executeStep(WFWorkflowAppDebugTaskWrapper.java:416)
    344410: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.obj.WFWorkflowTask.execute(WFWorkflowTask.java:360)
    344411: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.engine.core.WFEngineWorkflowTask.execute(WFEngineWorkflowTask.java:77)
    344412: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.app.impl.WFWorkflowAppDebugTaskWrapper.execute(WFWorkflowAppDebugTaskWrapper.java:736)
    344413: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.engine.core.TaskManager.runTaskNormally(TaskManager.java:416)
    344414: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.engine.core.TaskManager.runTask(TaskManager.java:371)
    344415: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.engine.core.Invoker.invoke(Invoker.java:85)
    344416: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.app.impl.ApplicationManagerImpl$TaskImpl.subinvoke(ApplicationManagerImpl.java:4658)
    344417: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.app.impl.ApplicationManagerImpl.subinvoke(ApplicationManagerImpl.java:2204)
    344418: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.app.Application.subinvoke(Application.java:276)
    344419: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.subsystems.ged125.ICMApplication.invokeWorkflow(ICMApplication.java:154)
    344420: Apr 01 15:10:42.399 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.subsystems.ged125.ICMApplicationTask.invokeWorkflow(ICMApplicationTask.java:684)
    344421: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.subsystems.ged125.ICMApplicationTask.runScript(ICMApplicationTask.java:1382)
    344422: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wf.subsystems.ged125.ICMApplicationTask.execute(ICMApplicationTask.java:2468)
    344423: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.app.impl.WFAppTaskWrapper.execute(WFAppTaskWrapper.java:291)
    344424: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.engine.core.TaskManager.runTaskNormally(TaskManager.java:416)
    344425: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.engine.core.TaskManager.runTask(TaskManager.java:371)
    344426: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.wfframework.engine.core.TaskManager$RunnableTask.run(TaskManager.java:589)
    344427: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.executor.impl.ExecutorStubImpl$RequestImpl.runCommand(ExecutorStubImpl.java:690)
    344428: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.executor.impl.ExecutorStubImpl$RequestImpl.run(ExecutorStubImpl.java:486)
    344429: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.executor.impl.ExecutorStubImpl$RequestImpl.run(ExecutorStubImpl.java:762)
    344430: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:776)
    344431: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.executor.impl.PooledExecutorStubImpl$1$WorkerImpl.run(PooledExecutorStubImpl.java:99)
    344432: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.util.ThreadPoolFactory$ThreadImpl.run(ThreadPoolFactory.java:853)
    344433: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: nested stack trace is: 
    344434: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: java.io.IOException: file not found: Vietnamese\Loichao.wav
    344435: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.prompt.FilePrompt.appendTo(FilePrompt.java:229)
    344436: Apr 01 15:10:42.400 ICT %MIVR-LIB_MEDIA-3-EXCEPTION: at com.cisco.prompt.DocumentPrompt.appendTo(DocumentPrompt.java:264)

  • Running an apple script from excel

    I have been trying to find some visual basic code to run an apple script from an excel workbook for weeks now, but after searching everehwere online and asking in multiple excel forums I have yet to find an answer. It appears it should be possible (as windows users of excel are able to do it, although running different files not apple scripts), but I cant get it to work on a mac, and I have not been able to come accross someone that is running excel on OSX that has an answer. Hoping I can find some mac excel users with apple script and visual basic knowledge here that might have an answer.
    This is a link to the question I posted on excel forum a couple of weeks ago:
    http://www.excelforum.com/excel-programming-vba-macros/962375-vb-code-to-run-a-f ile-on-mac.html

    I use http://macchampion.com/scenario_features.shtml
    dual-core G5/2.3   Mac OS X (10.4.6)   dual screens

  • How I run a shell script from the scheduler on 10.2.0.2.0 ?

    Hello Oracle People,
    I'd like to run a shell script from the Scheduler in my 10g database.
    Right now it is a simple shell script.
    Eventually it will wrap RMAN commands to back up my DB.
    I wrote a simple pl/sql script to create a job:
    -- cr_job10.sql
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'my_backup_job',
    job_type => 'EXECUTABLE',
    job_action => '/h/oracle/scripts/tst.sh',
    start_date => '06-SEP-07 5.33.00PM US/Pacific',
    repeat_interval => 'FREQ=DAILY',
    end_date => '08-SEP-07 4.00.00PM US/Pacific',
    enabled => TRUE,
    comments => 'My Backup Job');
    END;
    I see no errors when I run the above procedure.
    I checked DBA_SCHEDULER_JOBS and the job is in there.
    The scheduler, though, errors out with an error which I see in a trace file:
    /h/oracle/admin/orcl/bdump/orcl_j000_22396.trc
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    ORACLE_HOME = /h/oracle/product/10r2
    System name: SunOS
    Node name: sol
    Release: 5.10
    Version: Generic_118855-14
    Machine: i86pc
    Instance name: orcl
    Redo thread mounted by this instance: 1
    Oracle process number: 15
    Unix process pid: 22396, image: oracle@sol (J000)
    *** ACTION NAME:(MY_BACKUP_JOB) 2007-09-06 17:33:00.175
    *** MODULE NAME:(DBMS_SCHEDULER) 2007-09-06 17:33:00.175
    *** SERVICE NAME:(SYS$USERS) 2007-09-06 17:33:00.175
    *** CLIENT ID:() 2007-09-06 17:33:00.175
    *** SESSION ID:(140.13520) 2007-09-06 17:33:00.175
    *** 2007-09-06 17:33:00.175
    ORA-12012: error on auto execute of job 53267
    ORA-27369: job of type EXECUTABLE failed with exit code: 274662
    I googled on this:
    ORA-27369: job of type EXECUTABLE failed with exit code: 274662
    Google returned only 1 hit.
    There, I see some evidence that I need to configure something inside
    of Oracle to run shell scripts from the scheduler, but possibly just
    for machines running windows. I'm running Solaris.
    Do any of you know what I need to configure inside of Oracle to
    run shell scripts from the scheduler?
    -Owen

    Hello people,
    I should have added this bit of information:
    "The script runs fine from oracle's crontab."
    "The script runs fine from a shell owned by oracle."
    I'm getting responses telling me to check my env variables and permissions
    which would be helpful to a UNIX novice.
    I have a feeling that no one is using the scheduler to run RMAN scripts.
    Tim Hall suggested I take a close look at these files:
    $ORACLE_HOME/rdbms/admin/externaljob.ora
    $ORACLE_HOME/bin/extJob
    Currently I'm setup like this:
    bash sol root /h/oracle/product/10r2/bin 31 #
    bash sol root /h/oracle/product/10r2/bin 31 # ll $ORACLE_HOME/rdbms/admin/externaljob.ora
    -rw-r--r-- 1 root dba 52 Sep 7 15:29 /h/oracle/product/10r2/rdbms/admin/externaljob.ora
    bash sol root /h/oracle/product/10r2/bin 32 #
    bash sol root /h/oracle/product/10r2/bin 32 # cat $ORACLE_HOME/rdbms/admin/externaljob.ora
    # externaljob.ora
    run_user = rman
    run_group = rman
    bash sol root /h/oracle/product/10r2/bin 33 #
    bash sol root /h/oracle/product/10r2/bin 33 #
    bash sol root /h/oracle/product/10r2/bin 33 #
    bash sol root /h/oracle/product/10r2/bin 33 # ll $ORACLE_HOME/bin/ext*
    -rwsr-x--- 1 rman dba 30388 Sep 21 2006 /h/oracle/product/10r2/bin/extjob*
    -rwsr-x--- 1 rman dba 30392 Sep 21 2006 /h/oracle/product/10r2/bin/extjobo*
    -rwsr-x--- 1 rman dba 34468 Sep 21 2006 /h/oracle/product/10r2/bin/extproc*
    -rwxr-xr-x 1 oracle dba 300 Sep 21 2006 /h/oracle/product/10r2/bin/extusrupgrade*
    bash sol root /h/oracle/product/10r2/bin 34 #
    bash sol root /h/oracle/product/10r2/bin 34 #
    bash sol root /h/oracle/product/10r2/bin 34 #
    On my system, the user 'nobody' has no shell so I cannot use nobody.
    I created a user named rman:
    bash sol root /h/oracle/product/10r2/bin 34 #
    bash sol root /h/oracle/product/10r2/bin 34 #
    bash sol root /h/oracle/product/10r2/bin 34 # su - rman
    Sun Microsystems Inc. SunOS 5.10 Generic January 2005
    $
    $ id
    uid=220(rman) gid=220(rman)
    $
    $
    $ date
    Fri Sep 7 16:30:03 PDT 2007
    $
    $
    Jared points out that rman needs access to extproc:
    $ ls -la /h/oracle/product/10r2/bin/extproc
    -rwsr-x--- 1 rman dba 34468 Sep 21 2006 /h/oracle/product/10r2/bin/extproc
    $
    $
    Here is a demo of rman running his script:
    bash sol root /h/oracle/product/10r2/bin 35 # su - rman
    Sun Microsystems Inc. SunOS 5.10 Generic January 2005
    $
    $
    $ ls
    scripts
    $
    $
    $ scripts/tst.sh
    $
    $
    $ cat scripts/tst.sh
    #! /bin/sh
    /usr/bin/date > /tmp/tst.sh.out.txt 2>&1 &
    exit 0
    $
    $
    $ cat /tmp/tst.sh.out.txt
    Fri Sep 7 16:31:23 PDT 2007
    $
    $ rm /tmp/tst.sh.out.txt
    $
    I am focused on this error:
    ORA-27369: job of type EXECUTABLE failed with exit code: 274662
    And I am focused on this exit code: 274662
    What does 274662 mean?
    If the Scheduler gives me an error like "274662" rather than some English,
    it's obvious to me the Scheduler is a POS and I should not use it.
    And of course,
    If I cannot run RMAN from Oracle Scheduler, I'll use cron.
    -Owen

  • Getting windows error during running the sql scripts from form 6i

    I made a little form application. The purpose of this application is to generate explain plan for a particular SQL. Some sql scripts run internally in order to populate the result on form’s screen after pressing the form’s button but I am getting windows error during running the sql scripts from form 6i.
    I am using forms 6i with patch 17 with Oracle 10G database on windows 2000 professional on same computer.
    This application runs fine with 8i.
    Please inform me where the problem is and how to overcome it.
    Zafri.

    I am using Text_IO in my form's when button press trigger , inorder to create the
    text file, then in the same when button press triger
    I am calling RMAN via host command in order to run the script which was created by text_IO.
    Below you find some of the code. I will appreciate if you solve the problem.
    when button press trigger:
    Declare
    in_file3 Text_IO.File_Type;
    linebuf3 VARCHAR2(1800);
    output11 varchar2(1000);
    BEGIN
         output11:='C:\EXPLAIN_PLUS\misc\rm_file.bat ';
    Host(output11,no_screen);
    :sql.execution_plan:= 'Working........................';
    synchronize;
    in_file3 := Text_IO.Fopen('c:\explain_plus\misc\create_table.txt', 'w');
    Text_IO.Put_Line(in_file3, linebuf3);
    Text_IO.put_line(in_file3,' ');
    Text_IO.put_line(in_file3,' run { sql "create table PLAN_TABLE (statement_id,...object_name varchar2(30),object_instance numeric,object_type varchar2(30),optimizer varchar2(255),search_columns number,id .....partition_start varchar2(255),partition_stop  varchar2(255),partition_id numeric,other long,distribution varchar2(30)) "; } ');
    Text_IO.put_line(in_file3,' ');
    Text_IO.put_line(in_file3,' ');
    Text_IO.FCLOSE(in_file3)
              Declare
    un VARCHAR2(80);
    pw VARCHAR2(80);
    cn VARCHAR2(80);
    output VARCHAR2(1000);
    output2 VARCHAR2(1000);
    dummy varchar2(40);
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(1800);
    BEGIN
         Get_Connect_Info(un,pw,cn);
         /* for Plan_table Begg. Second INNER BLOCK */
         declare
              dummy2 varchar2(40);
         begin
         select table_name into dummy2 from all_tables where table_name='PLAN_TABLE';
         if dummy2 = 'PLAN_TABLE' then
         output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\MISC\TRUNC2.txt ' ;
    Host(output2,no_screen);
         end if;
         exception
         when no_data_found     then
    output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\misc\create_table.txt ';
    Host(output2,no_screen);
         end; --

  • Run a UNIX Script from java

    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/

  • When I am trying to run any OA page from jdev OA extension getting error

    when I am trying to run any OA page from jdev OA extension getting error
    When I am trying to run any OA page from jdeveloper, I am getting the following error.
    Failed to load "file:/D:/jdevhome/jdev/myprojects/oracle/apps/per/assistant/webui/SetupAssistantPG.xml" file.
    I felt the path of the file is wrong instead of D:/jdevhome, the path in above shows :/D:/jdevhome/jdev.
    I looked at the preferences and settings...but I could not get any clue to resolve this issue.
    Your help on thi issue is really appreciated.
    Thanks...

    Hi
    I am getting the same error.
    everything was running perfectly ..suddenly it started showing this error..i have checked JDEV_USER_HOME pointing to correct directory.
    but still it gives error as
    "file:/D:/development/jdevhome/jdev/myprojects/oracle/apps/pa/xxpa/assignment/webui/XXPAAssignResourcePG.xml" file.
    pls help

  • How to run unix shell script from java web applet

    hi all
    i have created one java applet. my apache web server is on unix server.
    i have created one shell script in same directory where my .class and .htm files reside...
    how to run this shell script from applet? it should search this .sh file on server and not on the client browser machine...
    thanks in advance

    I suppose you could make the shell script into a CGI, configure the server to execute CGIs, and then make the applet open the URL of that CGI.

  • How to run a shell script from the GUI?

    This is probably a dumb question...
    How do I run a shell script from the GUI? I've been told to double click it but when I do, it opens as a text file.

    The behavior you describe is that used by the KDE and GNOME desktops of Linux.
    Under OS X, if you make a script then mark it as executable, double-clicking on it in the Finder will not execute it. Actually, it uses a rather complex algorithm ([summarized here|http://arstechnica.com/reviews/2q00/macos-qna/macos-x-qa-2.html]) to determine what to do with it. This is implemented in Mac OS X' LaunchServices framework (incidentally, the associations are cached in /Library/Caches/com.apple.LaunchServices*.csstore and ~/Library/Caches/com.apple/LaunchServices*.csstore). You can read the details in the developer docs about LaunchServices.
    Anyway, in short, the suffix '.command' is a built-in type in the LaunchServices network that identifies a shell script. If you run
    /System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServic es.framework/Support/lsregister -dump
    ... it will tell you as much.

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

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

  • Error while trying to call external  web service from oracle PL/SQL 10.2 g

    Hi I am trying to call an external web service from oracle PL/SQL .I am getting following run time error when I try to set the opeartion style.
    But as per the oracle documentation this is one of the 2 valid values.
    ORA-29532: Java call terminated by uncaught Java exception: operation style: "document" not supported.Teh webservice does expect the operation style as document.
    Following is the code I am executing.
    FUNCTION email
    return varchar2
    AS
    service_ SYS.utl_dbws.SERVICE;
    call_ SYS.utl_dbws.CALL;
    service_qname SYS.utl_dbws.QNAME;
    port_qname SYS.utl_dbws.QNAME;
    operation_qname SYS.utl_dbws.QNAME;
    string_type_qname SYS.utl_dbws.QNAME;
    retx ANYDATA;
    retx_string VARCHAR2(1000);
    retx_double number;
    retx_len number;
    params SYS.utl_dbws.ANYDATA_LIST;
    l_input_params SYS.utl_dbws.anydata_list;
    l_result ANYDATA;
    l_namespace VARCHAR2(1000);
    begin
    -- open internet explorer and navigate to http://webservices.imacination.com/distance/Distance.jws?wsdl
    -- search for 'targetNamespace' in the wsdl
    l_namespace := 'http://service.xmlservices.global.freedomgroup.com/';
    -- search for 'service name' in the wsdl
    service_qname := SYS.utl_dbws.to_qname(l_namespace, 'ClientCoreWebServiceBeanService');
    -- this is just the actual wsdl url
    service_ := SYS.utl_dbws.create_service(HTTPURITYPE('http://hostname/GlobalWebServices/services/ClientCoreWebService?wsdl'), service_qname);
    -- search for 'portType name' in the wsdl
    port_qname := SYS.utl_dbws.to_qname(l_namespace, 'ClientCoreWebServiceBeanPort');
    -- search for 'operation name' in the wsdl
    -- there will be a lot, we will choose 'getCity'
    operation_qname := SYS.utl_dbws.to_qname(l_namespace, 'postalCodelookup');
    -- bind things together
    call_ := SYS.utl_dbws.create_call(service_, port_qname, operation_qname);
    -- default is 'FALSE', so we make it 'TRUE'
    SYS.utl_dbws.set_property(call_, 'SOAPACTION_USE', 'TRUE');
    -- search for 'operation soapAction' under <wsdl:operation name="getCity">
    -- it is blank, so we make it ''
    SYS.utl_dbws.set_property(call_, 'SOAPACTION_URI', '');
    -- search for 'encodingstyle' under <wsdl:operation name="getCity">
    SYS.utl_dbws.set_property(call_, 'ENCODINGSTYLE_URI', 'http://schemas.xmlsoap.org/soap/encoding/');
    -- search for 'binding style'
    SYS.utl_dbws.set_property(call_, 'OPERATION_STYLE', 'DOCUMENT');
    -- search for 'xmlns:xs' to know the value of the first parameter
    -- under <wsdl:message name="getCityResponse"> you will see the line <wsdl:part name="getCityReturn" type="xsd:string" />
    -- thus the return type is 'string", removing 'xsd:'
    string_type_qname := SYS.utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'string');
    -- in the line <wsdl:operation name="getCity" parameterOrder="zip">
    -- the parameterOrder is 'zip', thus we put in 'zip'
    -- the 'ParameterMode.IN' is used to specify that we will be passing an "In Parameter" to the web service
    -- the 'ParameterMode.IN' is a constant variable in the sys.utl_dbws package
    --vj this cud be either params or xml
    SYS.utl_dbws.add_parameter(call_, 'param1', string_type_qname, 'ParameterMode.IN');
    SYS.utl_dbws.add_parameter(call_, 'param2', string_type_qname, 'ParameterMode.IN');
    SYS.utl_dbws.set_return_type(call_, string_type_qname);
    -- supply the In Parameter for the web service
    params(0) := ANYDATA.convertvarchar('<TFGGlobalBasicXMLDO><systemCd>GLOBAL</systemCd><username>GlobalAdmin</username><password>GlobalAdmin</password><localID>1</localID></TFGGlobalBasicXMLDO>');
    params(1) := ANYDATA.convertvarchar('<TFGGlobalPostalCodeLookupIDDO><postalCode>02446</postalCode><countryCode>USA</countryCode><stateCode>MA</stateCode><cityDisplay>BROOKLINE</cityDisplay><countyDisplay>NORFOLK</countyDisplay><include_inactive_flag>True</include_inactive_flag></TFGGlobalPostalCodeLookupIDDO>');
    -- invoke the web service
    retx := SYS.utl_dbws.invoke(call_, params);
    dbms_output.put_line(retx.gettypename);
    -- access the returned value and output it to the screen
    retx_string := retx.accessvarchar2;
    dbms_output.put_line('done' || retx_string);
    dbms_output.put_line('PL/SQL DII client return ===> ' || retx_string);
    -- release the web service call
    SYS.utl_dbws.release_service(service_);
    return retx_string;
    end email;

    thsi is urgent anybody ????

  • Getting an error msg while trying to run the java class from CMC

    Hi All,
    I am getting an error, while trying to run the java .class file, that which is imoported into CMC.
    Error msg:
    Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at com.crystaldecisions.sdk.plugin.desktop.program.internal.ProgramWrapper.main(ProgramWrapper.java:49)
    I have imported .class file into CMC and trying to invoke the .class file by another java program from eclipse..When i tried to invoke the .class in cmc, i am getting an error msg, mentioned above. I thought there might be version conflict. So i changed the java complier version to 1.5 in my Eclipse. After that is done again i am facing the same problem.
    Can anyone help me to resolve this issue?
    Thanks in Advance.

    i have installed BO SDK 3.1 , Service pack 3. It comes woth JDK 1.5 version. i have not done any chnages to it. I impoprted all the jar files related to BO into eclipse.
    1)  Actually, i am writing java code on eclipse. When i run code from the eclipse, it creates a session to cmc and creates folder structure what i need.
    2)  But the thing is, that code needs to run, when i import the .class file into cmc. The process how i imported the .class file to cmc.
    Manage> Add> Program File-->Java (Check Box). In this way i added java class file from the eclipse workspace (class file from the bin directory).
    3) So when i run the .class file externally by another java program or also when i log in to CMC and run that .class file, the instance shows sucess, but when i see the logfile i am getting an exception that which i mentioned above.
    If my method is worng can you please let me know the stepts how to run java program in cmc.
    Thanks in Advance

  • Trying to run Power shell Script on task schedule

    My case is i'm trying to run a power shell script through the task schedule.
    Note if i run the script locally it is working fine but from the task schedule it is not working.
    More information: 
    script function: Password Change Notification
    Task name : test3
    Time to do the task: 9:08 am every day
    the status : running 
    .ps1 file location: under C\windows\system32\
    some actions in the task history after the dated time to run:
    1 Task Scheduler launched "{3023b1eb-9b29-47b9-ace2-e6083e2f00cc}"  instance of task "\test3" due to a time trigger condition
    2 Task Engine "S-1-5-21-60622444-1628707926-2526327935-500: enviroment\Admin:S4U:LUA"  received a message from Task Scheduler service requesting to launch task "\test3" .
    3 Task Scheduler started "{3023b1eb-9b29-47b9-ace2-e6083e2f00cc}" instance of the "\test3" task for user "enviroment\admin
    4 Task Scheduler launched action ""C:\Windows\System32\Password Change Notification\Password Change Notification.ps1"" in instance "{3023b1eb-9b29-47b9-ace2-e6083e2f00cc}" of task "\test3
    5 Task Scheduler launch task "\test3" , instance "C:\Windows\System32\notepad.exe"  with process ID 5052

    Hi MeipoXu,
    First of all i would like to thank you for your answer, i followed the URL that you posted already in the previous comment and unfortunately it didn't work, and please find my ps1 file
    content as typed below and give me your feedback on that.
    #  # Version 1.1 May 2014
    # Robert Pearman (WSSMB MVP) # TitleRequired.com
    # Script to Automated Email Reminders when Users Passwords due to Expire.
    # # Requires: Windows PowerShell Module for Active Directory
    # # For assistance and ideas, visit the TechNet Gallery Q&A Page. http://gallery.technet.microsoft.com/Password-Expiry-Email-177c3e27/view/Discussions#content
    # Please Configure the following variables....
    $smtpServer="outlook. myDomain " $expireindays = 7
    $from = "الدعم الفني
    <ITHelpDesk@myDomain>"
    $logging = "Enabled" # Set to Disabled to Disable Logging
    $logFile = "PassExpireNotlog.csv" # ie. c:\mylog.csv
    $testing = "Enabled" ## "Enabled" # Set to Disabled to Email Users
    $testRecipient = "MyEmail@MyDomain"
    $encoding = [System.Text.Encoding]::Unicode $date = Get-Date -format ddMMyyyy
    # Check Logging Settings if (($logging) -eq "Enabled")
    {     # Test Log File Path
        $logfilePath = (Test-Path $logFile)     if (($logFilePath) -ne "True")
        {         # Create CSV File and Headers
            New-Item $logfile -ItemType File
            Add-Content $logfile "Date,Name,EmailAddress,DaystoExpire,ExpiresOn,MsgBody"
        } } # End Logging Check
    # Get Users From AD who are Enabled, Passwords Expire and are Not Currently Expired
    Import-Module ActiveDirectory $users = get-aduser -filter * -SearchScope Subtree -SearchBase "OU=UsersOU,DC=MyDomain,DC=MyrootDomain,DC=MYrootNS" -properties Name, PasswordNeverExpires, PasswordExpired, PasswordLastSet,
    EmailAddress |where {$_.Enabled -eq "True"} | where { $_.PasswordNeverExpires -eq $false } | where { $_.passwordexpired -eq $false }
    $maxPasswordAge = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge
    # Process Each User for Password Expiry foreach ($user in $users)
    {     $Name = (Get-ADUser $user | foreach { $_.Name})
        $emailaddress = $user.emailaddress
        $passwordSetDate = (get-aduser $user -properties * | foreach { $_.PasswordLastSet })
        $PasswordPol = (Get-AduserResultantPasswordPolicy $user)
        # Check for Fine Grained Password
        if (($PasswordPol) -ne $null)     {
            $maxPasswordAge = ($PasswordPol).MaxPasswordAge
        $expireson = $passwordsetdate + $maxPasswordAge
        $today = (get-date)     $daystoexpire = (New-TimeSpan -Start $today -End $Expireson).Days
                 # Set Greeting based on Number of Days to Expiry.
        # Check Number of Days to Expiry
        $messageDays = $daystoexpire     if (($messageDays) -ge "2")
        {         $messageDays = "خلال
    " + "$daystoexpire" + " ايام"
        }     elseif (($messageDays) -eq "2")
        {         $messageDays = "خلال يومين
        }     else
        {         $messageDays = "اليوم."
        }     # Email Subject Set Here
        $subject="كلمة المرور الخاصة بك ستنتهي
    $messageDays"
           # Email Body Set Here, Note You can use HTML, including Images.
        $body =     "<P style='font-family: Arial; font-size: 16pt' />
        <center> الاستاذ/ $name
    </center> 
        <br>     <center>
    كلمة المرور الخاصة بك ستنتهي $messageDays </center>
        <br>     <center>
    نأمل تغييرها في أقرب فرصة حتي تتمكن من الدخول على النظام
    </center>
        <br>     <center>
    مع تحيات الادارة العامة لتقنية المعلومات
    </center> 
        <br>     </P>"
            # If Testing Is Enabled - Email Administrator
        if (($testing) -eq "Enabled")
        {         $emailaddress = $testRecipient
        } # End Testing     # If a user has no email address listed
        if (($emailaddress) -eq $null)
        {         $emailaddress = $testRecipient    
        }# End No Valid Email     # Send Email Message
        if (($daystoexpire -ge "0") -and ($daystoexpire -lt $expireindays))
        {          # If Logging is Enabled Log Details
            if (($logging) -eq "Enabled")
            {             Add-Content $logfile "$date,$Name,$emailaddress,$daystoExpire,$expireson,$body" 
            }         # Send Email Message
            Send-Mailmessage -smtpServer $smtpServer -from $from -to $emailaddress -subject $subject -body $body -bodyasHTML -priority High -Encoding $encoding
                    } # End Send Message
      } # End User Processing
    # End

Maybe you are looking for