Dbms_scheduler error in calling a schell script.

Hi,
I am trying to execute a shell script which is called from a procedure.
below are the changes which i have made and after that i am still getting error as below:
Please help me as to where i am going wrong:
Steps takesm:
1) rdbms/admin/externaljob.ora file to add the below info
run_user = oracle
run_group = dba
2) And have changed the bin/extjob file must be permissions to 4750 (-rwsr-x---)
3) The shell script is having full permission(777) and starts with #!/bin/ksh
4) - bin/extjobo sfile should have normal 755 (rwxr-xr-x)
5) - bin/jssu should have setuid permissions i.e. with 4750 (-rwsr-x---)
error:
ORA-27369: job of type EXECUTABLE failed with exit code: 255
STANDARD_ERROR="execve: Exec format error"
version:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit
DBMS_SCHEDULER.create_job (
      job_name              => 'gatekr3',
      job_type              => 'EXECUTABLE',
      job_action            => '/home/cobr_sftp/var/download/test_abh.sh',
       number_of_arguments   => 0, 
      enabled               => true,
      comments              => 'CREATE_PROGRAM test using a schell script'
Edited by: user11942774 on Sep 27, 2012 1:22 AM

Log to server under account oracle.
then run /home/cobr_sftp/var/download/test_abh.sh.
What's result of shell script ?

Similar Messages

  • Error while calling Subroutine from Script

    HI Friends,
    I am getting a short dump whilecalling a suboutine from Script.
    Please suggest if am wrong with below code
    /: PERFORM GET_ADDRESS IN PROGRAM ZSUBROUTINES
    /: USING &MHND-KUNNR&
    /: CHANGING &ADRS-LINE0&
    /: CHANGING &ADRS-LINE1&
    /: ENDPERFORM
    All above fields are available in script window
    In the program
    FORM get_address    TABLES in_tab STRUCTURE itcsy
                                       out_tab stucture itcsy.
    ENDFORM.
    Thanks

    HI,
    Your code is correct, in the FORM and ENDFORM in the program, read the INPUT table and get the values and write your logic using these values and send back the values to the SCRIPT using the OUTTABLE. here you need to use the MODIFY statment for the outtable using Sy-TABIX.
    Regards
    Sudheer

  • Error Using dbms_scheduler to call a shell script

    Hi,
    I have been assigned a job of sending emails through unix utility(Mailx), based on certain activity in database.
    Email needs to be sent on insert/update of a column in one of the database tables.
    I am trying to use the block below to call the unix script responsible to send mails:
    begin
    dbms_scheduler.create_job
    job_name => 'TPP_SEND_EMAIL_JOB',
    job_type => 'EXECUTABLE',
    job_action => '/opt/ENV/code/BIL/users/usrbil01/Hemz/sndmailscrpt.ksh',
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=30',
    enabled => true,
    comments => 'Send Email on ISU update'
    end;
    sndmailscrpt.ksh: Script to send email is embedded within the shell script
    I am getting the below error when i try to run the job using 'exec dbms_scheduler.run_job('TPP_SEND_EMAIL_JOB');'
    Error:
    ORA-27370: job slave failed to launch a job of type EXECUTABLE
    ORA-27300: OS system dependent operation:accessing extjob wrapper failed with status: 2
    ORA-27301: OS failure message: No such file or directory
    ORA-27302: failure occurred at: sjsec 3
    ORA-06512: at "SYS.DBMS_ISCHED", line 150
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
    ORA-06512: at line 1
    I am not aware of any db related permissions that needs to be given, is this related to that or is there somethin i need to do for execution to be successfull
    Request you to let me know the exact solution and also the steps i need to take in order to ensure successfull execution of this script.
    Please also let me know if there is any other way wherein i can call a unix script from a database trigger on run time(i.e, whenever insert/update on a particular column in database)
    Regards,
    Hemanth

    Hi All,
    Thank you for your inputs.
    I am now pressed to explore the option of utl_mail as this dircetly sends mail from database. This is suggested as an option for my delivery now.
    I am able to install utl_mail and send a mail using the block below:
    begin
    utl_mail.send(
    sender => '[email protected]',
    recipients => '[email protected]',
    subject => 'Testing utl_mail',
    message => 'The receipt of this email is checking on working of UTL_MAIL '
    exception
    when others then
    dbms_output.put_line('error: '||sqlerrm);
    end;
    The block gets executed successfully, but i have not received a mail yet, is there a table or oracle log from where i can trace the delivery status for the mai, or if the mail is successfully sent too?
    I have heard from users in this forum for support of mime type "HTML", Should i pass the whole html body in the *'message'* input parameter here or can i pass a html template name with path present else where?
    Please do assist me in this regard.
    Regards,
    Hemanth

  • Getting error in calling Java Script function in HTMLB page

    Hi
      I am having a button in HTMLB page which calls the Java Script function for click event.I have included the Java Script in the script folder of the application.
    I am calling the function present in JS like this,
    <SCRIPT src="portalsdc.js"></SCRIPT>
    function buttonClick() {
    someFunc()
    <hbj:button
    onClientClick="JavaScript:buttonClick();"
    disabled="false"
    design="STANDARD"
    />
    The Error i am getting in calling someFunc()is "Object Expected " ..
    Any suggestion how to make it work.
    Thanks in advance
    Saravanan

    Hi,
    My code in page is
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
    <hbj:page title="Epcf iView" >
    <SCRIPT src="portalsdc.js"></SCRIPT>
    <script language="JavaScript">
    function buttonClick() {
         someFunc()
    </script>
    <hbj:form>
    <hbj:button
    id="sendEvent"
    text="Send event"
    width="125px"
    tooltip="This button raises an event ..."
    onClientClick="JavaScript:buttonClick();"
    disabled="false"
    design="STANDARD"
    />
    </hbj:form>
    </hbj:page>
    </hbj:content>
    The code in Java script portalsdc.js is :
    function someFunc()
         alert ("HI");
    Even i have set and tried jsObjectNeeded = TRUE for button.
    Thanks and Regards,
    Saravanan

  • Error while calling SAP script.

    Hi all,
    Has anyone faced this problem.
    When I try to send an email from an activity in PB60 it does not work.
    It pops up an error message - Error while calling SAPscript: <OPEN_FORM> <return code 1>.
    Regards,
    Bharat

    Hi,
    this means that some configuration info is missing! The driver program doesn't know which form to trigger in that case! You have to specify the SAPscript form to be trigerred for that case!
    Regards,
    Sooness

  • Schell Script to Schdule In Dbms_Schedule

    Hi All,
    I've a script to schedule in dbms_scheduler, here is the usage of script in linux command line..
    "/home/oracle/scripts/run.sh table_name"
    Any inputs how to schedule it in dbms scheduler daily to run 1200 AM

    @sushaant - the post you refer to has no relevance to using DBMS_SCHEDULER - it is just using a cron job to run a shell script.
    @Ramu - if the shell script is on the same server as the oracle database, you need to do the following
    1) Create a credential that has the unix user you want to run the script as.
    Note the script itself MUST set up any environment needed for the job to run - DBMS_SCHEDULER will not execute the .profile of the user you supply in the credential so don't assume in run.sh that any $PATH will exist or any other environment variables, you must set these explicitly. E.g. if you use a unix command, you should ensure you specify the full path to it in run.sh.
    BEGIN
    DBMS_SCHEDULER.CREATE_CREDENTIAL('YOUR_CREDENTIAL', 'username', 'password');
    END;
    2) In sqlplus, create a job with an external job that references run.sh and add argument. Change yourjob to be the job name
    you want to see when the job runs and your_table_name to the table that should be used in this particular job.
    dbms_scheduler.create_program(
    job_name=>'yourprogram',
    job_type=>'EXECUTABLE',
    job_action=>'/home/oracle/scripts/run.sh',
    number_of_arguments=>1);
    4) Create a job which links the program to the schedule and runs daily at midday and create other jobs for other tables giving them different parameters. If you have several of these to run but don't want them to run at the same time, look at the CREATE_CHAIN commands in the Oracle 11gR2 database admin guide as there are two whole chapters (28 & 29) on the scheduler ( http://docs.oracle.com/cd/E11882_01/server.112/e25494/scheduse.htm#i1033533 )
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'run_tablename1',
    program_name => 'yourprogram',
    repeat_interval => 'FREQ=DAILY;BYHOUR=12',
    credential_name => 'YOUR_CREDENTIAL',
    comments => 'Daily at noon');
    dbms_scheduler.set_job_argument_value@orl1(job_name=>'run_tablename1', argument_position=>1, argument_value='your_table_name');
    END;
    Note that as you are passing a table_name to the run.sh, i'm guessing it might be running some Oracle commands such as an analyse so if run.sh contains PLSQL commands, you could create a PLSQL package or procedure in the database and instead of creating an external program that runs a shells script, just run the PLSQL directly from DBMS_SCHEDULER. This is simpler as you don't need to create credentials etc.. needed for an external program.
    BEGIN
    DBMS_SCHEDULER.CREATE_PROGRAM (
    job_name => 'yourname',
    job_type => 'STORED_PROCEDURE',
    job_action => 'YOUR_PKG.DO_STUFF',
    start_date => '18-MAY-13 12.00.00 AM',
    repeat_interval => 'FREQ=DAILY', /* every day */
    end_date => '17-MAY-14 12.00.00 AM',
    auto_drop => FALSE,
    comments => 'My new job');
    END;
    dbms_scheduler.set_job_argument_value@orl1(job_name=>'yourjob',
    argument_position=>1, argument_value='your_table_name');
    and again create a chain if you want to run several when one completes.
    You need to select from various tables to see the result of the jobs and whether they succeed or not such as
    select * From user_scheduler_job_run_details where job_Name='run_tablename1'
    SELECT * FROM USER_SCHEDULER_JOB_LOG;
    select * from user_scheduler_running_jobs
    You can add email notifications using DBMS_SCHEDULER.ADD_JOB_EMAIL_NOTIFICATION
    See the admin guide for more details.

  • 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

  • Calling a .py script inside a .VI, using anaconda's Libraries or specific python version (SystemExec.vi(?), MAC OSX)

    Hi,
    I'm new to both mac and LabView, so it may well be something obvious I'm missing.
    I'm trying to use System Exec (http://zone.ni.com/reference/en-XX/help/371361L-01/glang/system_exec/ with LabVIEW 2014 on Mac OS X Mavericks) to call a python script to do some image processing after taking some data and saving images via LabView.
    My problem is that I cannot figure out how to point it to the correct version/install of python to use, as it seems to use the pre-installed 2.7.5 apple version no matter whether that's set to be my default or not (and hence, it can't see my SciPy, PIL etc. packages that come with my Anaconda install).
    It doesn't seem to matter whether I have certain packages installed for 2.7 accessable via the terminal, the LabView System Exec command line can't seem to find them either way and throws up an error if a script is called that imports them.
    I've tried changing the working directory to the relevant anaconda/bin folder, I've also tried
    cd /Applications/anaconda/bin; python <file.py> 
    as the CL input to system exec, but it's not wanting to use anything other than the apple install. I've tried Anaconda installs with both python 2.7 and 3.4, so it doesn't seem to be down to the 3.* compatibility issues alone.
    Printing the python version to a string indicator box in LV via python script gives the following:
    2.7.5 (default, Mar 9 2014, 22:15:05)
    [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
    Whereas via the terminal, the default version is the anaconda install I'd like to use, currently
    Python 3.4.1 |Anaconda 2.1.0 (x86_64)| (default, Sep 10 2014, 17:24:09)
    [GCC 4.2.1 (Apple Inc. build 5577)] on darwin
    I can do which python3.4 on the sys exec CL input to get the correct /anaconda/bin location, but if I try  python3.4 <file.py>, I just get a Seg fault.
    I've found examples for System Exec use and instructions for calling python scripts with specific versions, but neither works with Mac (frustratingly).
    I've also tried editing the Path Environment Variable, and tried getting rid of the python 2.7 install entirely, but none of these work either (the latter just causing errors all over the shop).
    So, in summary
    I'd just like to know how to specify the python version LabView uses and to have use of the corresponding python libraries.
    Either python version (2 or 3) will do, I'd just like to be able to use my libraries which came with Anaconda which I'll be writing my scripts with (which I installed as the correct packages are only compatible with a specific python version on Mac, which is not the specific version that Xcode was compatible with, argh).
    All packages work normally when using the Anaconda version with the terminal or with Spyder.
    Is there a function I can use other than System Exec? What am I missing?
    Please help.

    janedoe777 wrote:
    Accidental. Also, that's not terribly helpful.
    What exactly does that mean?
    I'm not debating whether it was accidental or intentional.  It certainly isn't helpful to post the same message twice.
    It is helpful to point out this message is a duplicate so people don't waste their time answering this one if you are already being helped in the other one.

  • How to call a shell script from a java code

    Hello can any one suggest me how to call a shell script from a java program that takes three parameters.
    i have a shell script (msp_restore_gui) when i run this script in the command line in a RHEL5 ,SUSE10 and Debian machine it works fine .I even tested to call it from a java program and it also worked fine but when i used the same in a J2ee application where the user when clicks the restore button in a webserver this inturn sends the request to a java file named BackupManager.java where i call the shell script.But here it fails.Waiting for your suggestions.If you want i can put the code also here

    yes the script is in /usr/local/mss/tools/backup and the script (msp_restore_gui) is as follows
    #!/bin/sh
    TIMESTAMP=`date +%d_%b_%y-%H-%M`
    touch /var/backups/mss/mss_restore_"$TIMESTAMP".log
    LOGFILE="/var/backups/mss/mss_restore_"$TIMESTAMP".log"
    ### Explode tgz file
    cd /
    # Checks to be done:
    # root login
    # assume he passes the parameter as msp_backup_<timestamp>
    # check for the existence of the .tz and fileList.txt
    # Checking for the root login and if not logged on as root
    # permission will be denied to execute this script
    logmsg(){
    echo "`date`: $*" >> $LOGFILE 2>&1
    echo "$*"
    #usage of this script
    while [ $#  -ne 0 ]
    do
    case $1 in
    -n)
    shift
    ARCHIVE_NAME=`find / \( -name "$1.tz" -o -name "$1.tgz" \) 2>/dev/null`
    FILE_NAME=`find / -name $1_filesList.txt 2>/dev/null`
    if [ x$ARCHIVE_NAME = x -a y$FILE_NAME = y ]
    then
    logmsg "ERROR: Files not found, Restore cannot proceed"
    usage
    else
    tar tvzf $ARCHIVE_NAME > /dev/null 2>&1
    if [ $? -ne 0 ]
    then
    echo "ERROR: The tar file $ARCHIVE_NAME is not proper. Restore cannot proceed"
    exit 1
    else
              echo "Backedup files are present, proceeding with restore......" >> $LOGFILE 2>&1
    fi
    fi
    usage
    SKIP_CLEANUP=1
    STATUS=1
    exit
    esac
    shift
    done
    rm -rf ./newfile
    curr_ver_file="/usr/local/mss/etc/version"
    /usr/local/mss/tools/backup/check_version $curr_ver_file $FILE_NAME
    ret_code=$?
    echo "Exit value of check_version is $ret_code"
    if [ "$ret_code" != 0 ]
    then
    logmsg "MSP Version not matching. Exiting from restore now...."
    errormsg=`cat /usr/local/mss/temp/ver_err_mesg`
    logmsg $errormsg
    rm -f /usr/local/mss/temp/ver_err_mesg
    exit 1
    else
    echo "Version check is successful"
    fi
    #### ShutDown MSS########
    /etc/init.d/mss stop
    sleep 2
    ### Shutdown semm
    /etc/init.d/semm stop
    sleep 2
    rm -rf `grep -v "MSP Version:" $FILE_NAME`
    logmsg "MSP restore in progress......"
    tar mxvfz $ARCHIVE_NAME >> $LOGFILE
    sleep 5
    ### Call mysql restore script
    /usr/local/mss/bin/mysql_alldb_restore.sh >> $LOGFILE 2>&1
    if [ $? -ne 0 ]; then
    logmsg "Database restore Failed. Cannot proceed further"
    exit 1 ;
    else
    logmsg "Database restore Succeeded."
    fi
    ### Remove DB Dump Files
    rm -f /var/lib/mysql-dumps/*
    ### Trigger cleanup of airprism database tables
    #touch /usr/local/mss/airprism/server/config/reinitdb
    ### Trigger re-import of software packages
    touch /usr/local/mss/swdepot/reimport
    ### Remove log files under the "apps" directory
    find /usr/local/mss/apps -name '*.log*' | xargs rm -f
    find /usr/local/mss/logs -follow -name '*[._]log*' | xargs rm -f
    if [ $? -ne 0 ]; then
    logmsg "MSP restore Failed. Cannot proceed further"
    exit 1 ;
    else
    logmsg "MSP restore Succeeded."
    fi
    # reinstall_patch is touched so that patches are re-installed after restoring of MSP.
    touch /usr/local/mss/patch/bin/reinstall_patch
    ##### Start MSS
    logmsg "restarting MSP server "
    /etc/init.d/mss start
    sleep 5
    ### Start semm
    /etc/init.d/semm start
    sleep 5
    logmsg "MSP server is now restarted"
    my jsp page backup.jsp is as follows
    <%@taglib uri="portlet.tld" prefix="uif" %>
    <%@taglib uri="msp-console.tld" prefix="msp" %>
    <uif:defineObjects/>
    <%@page import="javax.portlet.*" %>
    <%@ page import="java.util.Date" %>
    <%@ page import="java.util.Vector" %>
    <%@ page import="java.text.DateFormat" %>
    <%@ page import="com.symbol.mss.console.admin.backup.BackupManager" %>
    <%@ page import="com.symbol.mss.console.admin.system.SystemInfoPortlet" %>
    <%
         String STYLE_NAME = request.getParameter("style");
         if (STYLE_NAME == null) STYLE_NAME = STYLE_DEFAULT;
         final String ua = request.getHeader("User-Agent");
         BackupManager helper = null;
         PortletSession portletSession = renderRequest.getPortletSession();
         helper = (BackupManager)portletSession.getAttribute("helper");
         if (helper == null) {
              //System.err.println("Created new BackupManager");
              helper = new BackupManager();
              portletSession.setAttribute("helper", helper);
         final BackupManager backupManager = helper;
         String action = "";
         final String backupName = renderRequest.getParameter("backupName");
         String completePath = backupManager.getBackupDir() + backupName + backupManager.getBackupFileExt();
         if (backupName != null) {
              action = "backup";
         if(backupManager.backup(backupName)) {
              SystemInfoPortlet.beginRestartMSP();
              } else {
                   action = "backuperror";          
         final String cmd = renderRequest.getParameter("submitButton");
    final String selectedBackup = renderRequest.getParameter("selectedBackup");
    int tarFileStatus =0;
    String backupTarFile ="";
    String backupFileList ="";
         if ("Restore".equals(cmd)) {
    if (selectedBackup != null) {
         tarFileStatus = backupManager.verifyTarFile(selectedBackup);
         //backupTarFile = backupManager.getRestoreFile(Integer.parseInt(selectedBackup));
         //backupFileList = backupTarFile.substring(0, backupTarFile.lastIndexOf(backupManager.getBackupFileExt()))+"_filesList.txt";
                   if (tarFileStatus == 0){
         action = "restore";
         backupManager.restore(selectedBackup);
                        SystemInfoPortlet.beginRestartMSP();
              } else {
                   action = "error";
    } else if ("Remove".equals(cmd)) {
    backupManager.remove(Integer.parseInt(selectedBackup));
         DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
         PortletURL restoreURL = renderResponse.createActionURL();
    %>
    <%@ include file="/jsp/core/constants.jspf" %>
    <% if (action.length() > 0) {
         if ("backup".equals(action))
    %>
         <p>The MSP Appliance has been shut down in order to create the <%=backupName %> backup file,
              and will automatically restart as soon as the file has been created.
              To continue your work, please log out of the MSP Console, wait for the appliance
              to restart, and then log back in. The amount of time you'll have to wait for the
              MSP Appliance to come back online depends on the amount of information you have
              stored in the MSP Database.</p>
         <p>The full pathname for the backup file is: <%=completePath %></p>     
    <%     }
         else if ("restore".equals(action))
    %>
         <p>The MSP Appliance has been shut down in order to restore from the <%=backupTarFile%> backup file,
              and will automatically restart as soon as the restore is complete.
              To continue your work, please log out of the MSP Console, wait for the appliance
              to restart, and then log back in. The amount of time you'll have to wait for the
              MSP Appliance to come back online depends on the amount of information you have
              stored in the MSP Database.</p>     
    <%     } else if ("backuperror".equals(action)) { %>
              <p><img src="images/dialogue/error_16.gif" class="icon" alt="Notify" /> Errors occurred while taking back up of MSP. Please see the backup service log file for more details.
              </P>
    <%     } else if ("error".equals(action)) {
              if (tarFileStatus == 4) { %>
                   <p><img src="images/dialogue/error_16.gif" class="icon" alt="Notify" /> The backup file <%=backupTarFile%> contains errors. This backup can't be restored. Please restore a valid back up.
                   </P>
              <%} else if (tarFileStatus == 3) { %>
                   <p><img src="images/dialogue/error_16.gif" class="icon" alt="Notify" /> The backup file list <%=backupFileList %> is missing. This file is required to restoring backup. Please get the backup file list and proceed with restoring backup.</p>
              <%} else if (tarFileStatus == 2) { %>
                   <p> <img src="images/dialogue/error_16.gif" class="icon" alt="Notify" /> The backup file <%=backupTarFile%> contains errors and the backup file list <%=backupFileList%> is missing. This backup can't be restored. </p>
              <%} %>
    <%     }
    } else { %>
    <p><strong>Note</strong>: Both backup and restore will shut down MSP temporarily. MSP will be unable to collect data from devices, send notifications, or provide MSP Console access during this time. When the backup or restore operation is complete, MSP will come back online automatically.</p>
    <h3>Backup</h3>
    <form action="<%= restoreURL.toString() %>" method="post">
    <p>Please provide a name for your backup. MSP will provide the date automatically in the list of backups.</p>
    <p><label for="<uif:namespace />backupName">Name</label> <input type="text" name="<uif:namespace />backupName" id="<uif:namespace />backupName" size="20" maxlength="256" /> <input type="submit" name="<uif:namespace />submitButton" value="Back up now" onclick="return <uif:namespace/>validateName()"/></p>
    </form>
    <h3>Restore</h3>
    <p>This will restore all databases (device assets, collected device data, software packages, policies, etc.) to their state as of the time the backup was made. Changes since then <em>except for backups</em> will be destroyed.</p>
    <%
    Vector restoreList = helper.getRestoreEntries();
    Vector restoreDates = helper.getRestoreDates();
    Vector restoreVersions = helper.getRestoreVersions();
    Vector filesStatus = helper.getBackupFilesStatus();
    %>
    <% if (restoreList.size() == 0) { %>
    <p>There are no backups currently available.</p>
    <% } else { %>
    <form action="<%= restoreURL.toString() %>" method="post">
    <table class="input-radios" id="<uif:namespace />existingBackups">
    <thead>
    <tr>
    <th></th>
    <th>Name</th>
    <th>Date</th>
    <th>MSP Version</th>
    <th>Remarks </th>
    </tr>
    </thead>
    <tfoot>
    <tr>
    <td colspan="4" class="actionsOnSelected">
    <input type="submit" name="<uif:namespace />submitButton" value="Restore" onclick="return confirm('This action requires MSP and all related services to be shut down. Console will be unavailable if the request is submitted. The server will restart automatically once restore has been completed.');" />
    <input type="submit" name="<uif:namespace />submitButton" value="Remove" onclick="return confirm('This action will remove the backup archive. You will no longer be able to restore this backup. Continue?');" />
    </td>
    </tr>
    </tfoot>
    <tbody><%-- First one (most recent) is checked by default. Every other row has class="portlet-section-alternate". Note that each ID must be unique and must match the value of the "for" attribute on the corresponding "label" element. --%>
    <%
    for (int i = 0; i < restoreList.size(); i++) {
    %>
    <tr <%= (i % 2 == 1) ? " class=\"portlet-section-alternate\"" : "" %>>
    <td><input type="radio" name="<uif:namespace />selectedBackup" value="<%= i %>" id="<uif:namespace />selectedBackup-<%= i %>" <%= (i == 0) ? "checked=\"checked\"" : "" %> /></td>
    <td><label for="<uif:namespace />selectedBackup-<%= i %>"><%= restoreList.elementAt(i) %></label></td>
    <td><%= dateFormat.format((Date)restoreDates.elementAt(i)) %></td>
    <td><%= restoreVersions.elementAt(i) %></td>
    <td><%= filesStatus.elementAt(i) %></td>
    </tr>
    <%
    %>
    </tbody>
    </table>
    </form>
    <% } %>
    <% } %>
    <script type="text/javascript">
    <!--//--><![CDATA[//><!--
    function <uif:namespace/>validateName() {
    var name =document.getElementById("<uif:namespace />backupName");
    var msg= "<msp:i18n key="BackupMsg"/>";
    var str=name.value;
    var re = /^[A-Za-z0-9_]+$/;
    if (!str.match(re)) {
         alert(msg);
         name.focus();
         return false;
         } else {
    return confirm('This action requires MSP and all related services to be shutdown. Console will be unavailable if the request is submitted. The server will restart automatically once backup has been completed.');
    //--><!]]>
    </script>
    and my BackupManager.java is as follows where the code in bold and italic is called the restore()
    //============================================================================
    // Symbol Technologies P R O P R I E T A R Y S O U R C E C O D E
    // C O N F I D E N T I A L
    // Copyright (c) 2003 Symbol Technologies. All Rights Reserved.
    // All information contained herein is the property of Symbol Technologies,
    // or its Licensors, and are protected copyrights and trade secrets, and may
    // be covered by U.S. patents. Any reproduction or dissemination of any
    // portion of this document, of the software, or other works derived from it
    // is strictly forbidden unless prior written permission is obtained from
    // Symbol Technologies.
    //============================================================================
    package com.symbol.mss.sdf.services.backup;
    import java.io.*;
    import java.sql.Time;
    import java.text.DateFormat;
    import java.util.logging.FileHandler;
    import java.util.logging.Formatter;
    import java.util.logging.LogRecord;
    import java.lang.Process;
    import java.util.*;
    import org.apache.avalon.framework.configuration.Configurable;
    import org.apache.avalon.framework.configuration.Configuration;
    import org.apache.avalon.framework.configuration.ConfigurationException;
    import org.apache.avalon.framework.logger.LogEnabled;
    import org.apache.avalon.framework.logger.Logger;
    import com.symbol.mss.sdf.admin.AdministratorService;
    import com.symbol.mss.sdf.backup.*;
    import com.symbol.mss.sdf.data.*;
    * @author nramaiah
    * Service to perform scheduled backups of the system state.
    public class BackupManager implements BackupService, DataHandler,
    LogEnabled, Configurable {
    // MSS Home Path
    private static String mssHome = System.getProperty("phoenix.home", File.separator + "usr" +
    File.separator + "local" +
    File.separator + "mss" +
    File.separator);
    // Backup related definitions
    private static final String BACKUP_LIST_FILE_NAME = "conf" + File.separator + "files_to_backup.txt";
    private static final String BACKED_UP_LIST_FILE_NAME_SUFFIX = "_filesList.txt";
    private static final String BACKUP_LOCATION = File.separator + "var" + File.separator + "lib" +
    File.separator + "mss-backups" + File.separator;
    private static final String BACKUP_PARTITION = File.separator + "var" + File.separator + "lib";
    private static final String VERIFY_BACKUP = File.separator + "usr" + File.separator + "local" +
                                                           File.separator + "mss" + File.separator+"tools"+
                                                           File.separator+"backup"+File.separator+"verifyBackup.sh";
    // DB backup/restore related definitions
    private static final String DB_DUMP_LOCATION = File.separator + "var" + File.separator +
    "lib" + File.separator +
    "mysql-dumps" + File.separator;
    private static final String DB_BACKUP_SCRIPT = "bin" + File.separator + "mysql_alldb_backup.sh";
    private static final String DB_RESTORE_SCRIPT = "bin" + File.separator + "mysql_alldb_restore.sh";
    // Private variables
    private AdministratorService m_admin = null;
    private Logger m_logger = null;
    private String backupLocation = null;
    private String backupListFileName = null;
    private String backupPartition = null;
    private int backupPartitionLimit = 90;
    private String dbDumpLocation = null;
    private String dbBackupScript = null;
    private String dbRestoreScript = null;
    private List servicesBackupList = null;
    private String tarFileExtension =".tgz";
    private String errFileExtension =".err";
    private int exitValue=0;
    * Default Constructor
    public BackupManager() {
    servicesBackupList = new ArrayList();
    * Set the administrator service implementation. Link established by Broker service.
    * @param admin reference to an implementation of AdministratorService
    public void setAdministrator(AdministratorService admin) {
    m_admin = admin;
    * Set the job publisher service implementation. Link established by Broker service.
    * @param jobPublisher reference to an implementation of JobPublisherService
    public void setJobPublisher(DataChannel jobPublisher) {
    jobPublisher.subscribe(this);
    * Gets the backup manager object.
    * @return backup manager object
    public BackupService getBackupService() {
    return this;
    * Service lifecycle method.
    * @param logger logger object to be used by the service
    public void enableLogging(Logger logger) {
    m_logger = logger;
    * Service lifecycle method.
    * @param configuration service configuration object
    public void configure(Configuration configuration) throws ConfigurationException {
    // Verify MSS Home path
    if (!mssHome.endsWith(File.separator))
    mssHome += File.separator;
    // Get the location where the backup file needs to be placed
    backupLocation = configuration.getChild("BackupLocation").getValue(BACKUP_LOCATION);
    // Verify backup directory path
    if (!backupLocation.startsWith(File.separator))
    backupLocation = mssHome + backupLocation;
    if (!backupLocation.endsWith(File.separator))
    backupLocation += File.separator;
    // Get the file listing the files/directories to be backed up
    backupListFileName = configuration.getChild("FilesList").getValue(BACKUP_LIST_FILE_NAME);
    // Verify backup list file name path
    if (!backupListFileName.startsWith(File.separator))
    backupListFileName = mssHome + backupListFileName;
    // Get the partition where the backups are kept
    backupPartition = configuration.getChild("BackupPartition").getValue(BACKUP_PARTITION);
    // Verify backup partition path
    if (!backupPartition.startsWith(File.separator))
    backupPartition = File.separator + backupPartition;
    if (backupPartition.endsWith(File.separator))
    backupPartition = backupPartition.substring(0, (backupPartition.length()-1));
    // Get the limit on the amount of free space on the backup partition
    backupPartitionLimit = configuration.getChild("BackupPartitionLimit").getValueAsInteger(backupPartitionLimit);
    // Get the location where the DB dump files will be placed
    dbDumpLocation = configuration.getChild("DBDumpLocation").getValue(DB_DUMP_LOCATION);
    // Verify DB dump directory path
    if (!dbDumpLocation.startsWith(File.separator))
    dbDumpLocation = mssHome + dbDumpLocation;
    if (!dbDumpLocation.endsWith(File.separator))
    dbDumpLocation += File.separator;
    // Get the name of DB dump backup script
    dbBackupScript = configuration.getChild("DBBackupScript").getValue(DB_BACKUP_SCRIPT);
    // Verify backup script path
    if (!dbBackupScript.startsWith(File.separator))
    dbBackupScript = mssHome + dbBackupScript;
    // Get the name of DB dump restore script
    dbRestoreScript = configuration.getChild("DBRestoreScript").getValue(DB_RESTORE_SCRIPT);
    // Verify restore script path
    if (!dbRestoreScript.startsWith(File.separator))
    dbRestoreScript = mssHome + dbRestoreScript;
    * Individual services can supply a list of files/directories to be backed up.
    * These are files apart from the files specified in conf/files_to_backup.txt and
    * will be backed up as well.
    * @param files list of files/directories
    public void filesToBackup(List files) {
    synchronized(this) {
    if (files != null) {
    if (files.size() > 0) {
    // Add the list contents to the current backup list
    for (int i=0; i<files.size(); i++) {
    String tStr = (String)files.get(i);
    // Check for absolute or relative path
    if (tStr.startsWith(File.separator))
    servicesBackupList.add(tStr);
    else
    servicesBackupList.add(mssHome + tStr);
    else
    m_logger.info("Empty list of filenames. Nothing added.");
    else
    m_logger.info("Null list of filenames. Nothing added.");
    * Individual services can supply a list of files/directories to be backed up.
    * Specified files will be added to the file defining the list of files to be backed up.
    * @param files list of files/directories
    private void persistFilesToBackup(List files) {
    synchronized(this) {
    if (files != null) {
    if (files.size() > 0) {
    // Add the list of files provided to the end of file
    try {
    File file = new File(backupListFileName);
    if ((file == null) || (!file.exists()))
    file.createNewFile();
    // Seek to the end of the file
    RandomAccessFile rFile = new RandomAccessFile(file, "rw");
    if (rFile != null) {
    rFile.seek(rFile.length());
    // Write the list contents to the file
    for (int i=0; i<files.size(); i++) {
    String tStr = (String)files.get(i);
    // Check for absolute or relative path
    if (tStr.startsWith(File.separator))
    rFile.writeBytes(tStr + "\n");
    else
    rFile.writeBytes(mssHome + tStr + "\n");
    else
    m_logger.error("Error opening file " + backupListFileName);
    rFile.close();
    catch (Exception ex) {
    ex.printStackTrace();
    m_logger.error("Error adding entries to file " + backupListFileName, ex);
    else
    m_logger.info("Empty list of filenames. Nothing added.");
    else
    m_logger.info("Null list of filenames. Nothing added.");
    * Command to be run during the backup process. Individual services can
    * provide shell commands that will be executed before backing up the files.
    * @param command shell command to be executed
    private void runCommand(String command) {
    * Creates a shell script at the specified location that will backup the
    * files listed in the List passed in.
    * @param scriptFileName location where the script needs to be created
    * @param backupFileName name for the tar file being created
    * @param backupList list of files to be backed up
    private void createBackupScript(String scriptFileName, String backupFileName, ArrayList backupList) throws Exception {
    // Create a new StringBuffer to build the contents to be written to the script file
    StringBuffer buffer = new StringBuffer();
    // Add the initial comment in the start script
    buffer.append("#!/bin/sh\n" + "set -x\n\n");
    // Check if the partition has enough space
    buffer.append("### Check if the partition has enough space\n" +
    // "diskUsed=`df -k | grep \"" + backupPartition + "\" | awk '{print $5}' | cut -d\"%\" -f1`\n" +
                   " diskUsed=`df -k \"" + backupPartition + "\" | awk '{print $5}' | cut -d\"%\" -f1 | grep -v Use`\n" +     
    "echo \"Partition " + backupPartition + " is $diskUsed% used.\"\n" +
    "if [ \"$diskUsed\" -lt \"" + backupPartitionLimit + "\" ]\nthen\n" +
    " echo \"Starting backup...\"\n\n");
    // Shutdown semmd
    buffer.append(" ### Shutdown semm\n" + " /etc/init.d/semm stop\n" +
    " sleep 2\n\n");
    // MSP Limited release and earlier builds stop mysql DB and backup the
    // /var/lib/mysql directory as it is. Starting MSP 1.0 GA release, mysql
    // dump script will be integrated which will create sql scripts to
    // restore the database.
    // Check if mysql dump creation script exists
    File mysqlDumpScript = new File(dbBackupScript);
    if (mysqlDumpScript.exists()) {
    // MSP 1.0 GA and later releases
    // Run the script that will generate sql scripts that would re-create the DB as it is
    buffer.append(" ### Call mysql dump script\n" +
    " " + dbBackupScript + "\n\n");
    else {
    // MSP Limited release
    // Add command to shutdown mysql
    buffer.append(" ### Shutdown mysql\n" + " /etc/init.d/mysql stop\n\n");
    // Change to root directory and create the tgz file
    buffer.append(" ### Create tgz file\n" + " cd /\n");
    // Build up the tar file name from the current date and time
    String fileName = null;
    if ((backupFileName != null) && (backupFileName.length() > 0))
    fileName = backupFileName;
    else {
    // File name not provided by user, build one using the timestamp
    Calendar cal = Calendar.getInstance();
    Date date = cal.getTime();
    fileName = "MSS-"
    + DateFormat.getDateInstance().format(date).replaceAll(" ", "").replaceAll(",", "")+ "-"
    + (new Time(cal.getTimeInMillis())).toString().replaceAll(":", "").substring(0,4);
    String tarFileName = fileName + ".tgz";
    // Get the current MSP Version
    String mspVersion = getMSPVersion();
    // Gather all the files to be backed up. Add them to the tar command and
    // also dump them into the file maintaining the list of files being backed up
    String listStr = "";
    for (int i=0; i<backupList.size(); i++)
    listStr += (String)backupList.get(i) + "\n";
    // Dump the current MSP version and the list of files being backed up into a manifest file
    String listFileName = fileName + BACKED_UP_LIST_FILE_NAME_SUFFIX;
    RandomAccessFile file = new RandomAccessFile(backupLocation + listFileName, "rw");
    m_logger.info("List of files/directories being backed up:\n" + listStr);
    file.writeBytes("### MSP Version: " + mspVersion + " ###\n");
    file.writeBytes(listStr);
    file.close();
    // Add the tar command to the script
    buffer.append(" echo \"Creating " + backupLocation + tarFileName + "...\"\n" +
    " tar cvhfz " + backupLocation + tarFileName + " `grep -v \"MSP Version:\" " +
    backupLocation + listFileName + "`\n\n");
    // Check if free space on the backup partition has reduced below the limit
    // If enough space left, backup is retained, "mss" is made the owner of the files,
    // "backup" is made the group the files belong to,
    // permissions changed to be "0660" and
    // backup action declared a success
    // Else, backup files are deleted and declared a failure
    buffer.append(" ### Check if the partition has enough space left\n" +
    //" diskLeft=`df -k | grep \"" + backupPartition + "\" | awk '{print $5}' | cut -d\"%\" -f1`\n" +
    " diskLeft=`df -k \"" + backupPartition + "\" | awk '{print $5}' | cut -d\"%\" -f1 | grep -v Use`\n" +
    " echo \"Partition " + backupPartition + " is $diskLeft% used.\"\n" +
    " if [ \"$diskLeft\" -gt \"" + backupPartitionLimit + "\" ]\n" +
    " then\n" +
    " ### Failure\n" +
    " echo \"Partition " + backupPartition + " does not have enough space.\"\n" +
    " echo \"Backup " + backupLocation + tarFileName + " will be removed.\"\n" +
    " rm -f " + backupLocation + fileName + "*\n" +
    " echo \"Backup Failed.\"\n" +
    " else\n" +
                        " tar tvzf " + backupLocation + tarFileName + " > /dev/null 2>&1\n" +
    " if [ ! -s " + backupLocation + tarFileName + " -o $? -ne 0 ] \n" +
                        " then\n" +
                        " echo \"MSP Backup operation is not successful. The tar file " + backupLocation + tarFileName + " contains errors.\"\n" +
                        " echo \"Please take the backup again\"\n" +
                        "     touch "+backupLocation+fileName+".err\n" +
    " else \n" +
    " ### Success\n" +
    " ### Change the owner, group and permissions for the backup files\n" +
    " chown mss " + backupLocation + fileName + "*\n" +
    " chgrp backup " + backupLocation + fileName + "*\n" +
    " chmod 0660 " + backupLocation + fileName + "*\n" +
    " echo \"Backup Completed.\"\n" +
    " fi\n" +
    " fi\n\n");
    // MSP Limited release and earlier builds re-start mysql. Starting
    // MSP 1.0 GA release, mysql is not stopped and so re-start is not
    // needed. sql scripts created by the dump script get packed into
    // the tar file and so are deleted.
    // Check if mysql dump creation script exists
    if (mysqlDumpScript.exists()) {
    // MSP 1.0 GA and later releases
    // Remove DB dump files
    buffer.append(" ### Remove DB Dump Files\n" + " rm -f " + dbDumpLocation + "*\n\n");
    else {
    // MSP Limited release
    // Start mysql
    buffer.append(" ### Start mysql\n" + " /etc/init

  • Error While calling remote object

    [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://localhost:8080/Remote/messagebroker/amf'"]
    This is the error I am getting when I am trying to call a method in java
    This is java code
    package demo;
    public class  Hello
    public String sayHello()
    System.out.println("1st Method is calledddddddd");
    return "Hello World!";
    public String sayHelloWithParam(String str){
    System.out.println("2nd Method is calledddddddd");
    return "You have typed  "+str;
    This is my mxml code
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    public function sayHello(event:ResultEvent):void{
    label1.text=event.result.toString();
    public function sayHelloWithParameter(event:ResultEvent):void{
    label1.text=event.result.toString();
    ]]>
    </mx:Script>
    <mx:RemoteObject id="hello" destination="helloworldclass" fault="mx.controls.Alert.show(event.fault.toString())">
    <mx:method name="sayHello" result="sayHello(event)"/>
    <mx:method name="sayHelloWithParam" result="sayHelloWithParameter(event)"/>
    </mx:RemoteObject>
    <mx:Label x="55" y="51" text="Label" id="label1"/>
    <mx:Button x="253" y="49" label="Button1" click="hello.sayHello()"/>
    <mx:TextInput x="55" y="106" id="t1"/>
    <mx:Button x="253" y="106" label="Button2" click="hello.sayHelloWithParam.send();"/>
    </mx:Application>
    When I click the button I am getting that error..
    Please help me in solving this

    Your server code must be faulty. If things work well you should see a blank screen when you point your browser to the amf endpoint.
    An Apache message like "The requested resource (/bpm-backend/whatever) is not available." indicates that something in your server app is not working properly or not mapped right.

  • 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

  • Calling an rss script with rs.exe fails to result in a report pdf from VB6 w/ ShellEx.

    Sql 2008 R2
    Calling an rss script with rs.exe fails to result in a report pdf from VB6 w/ ShellEx. 
    If I call rs.exe with the various parameters from the command prompt I  have success(other than rs.exe using the temp folder, which is a different issue).  But when I try to execute the same process from a Visual Basic 6.0 application utilizing
    the ShellEx api call, the report creation and output to PDF format do not occur.   There is no error raised.
    Yes, I wish I could use a newer dev tool but that isn't an option right now. I think this should work.  Can ya'll tell me what I'm doing wrong?
    sArgs = "-i " & Chr(34) & "'C:\Program Files\Dura Supreme\OrderEntry\RunOrdReports.rss'" & Chr(34) & _
    " -s 'http://walnut/reportserver' -v 'DuraOrderNum=" & _
    Chr(34) & sOrdDuraID & Chr(34) & "' -e Exec2005 -t"
    ShellEx Chr(34) & "C:\Program Files\Dura Supreme\OrderEntry\rs.exe" & Chr(34), EShellShowConstants.essSW_SHOWNORMAL, sArgs
    TIA,
    Jim M.

    ShellEx Chr(34) & "C:\Program Files\Dura Supreme\OrderEntry\rs.exe" & ....
    Hello Jim,
    The path for rs.exe includes spaces, you should set it in hyphen, as you already did for file "RunOrdReports.rss" in variable "sArgs2
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

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

  • Calling a SQL script from the PL/SQL block.

    Hello All,
    I am using oracle 11g database.
    My requirment is as follows. I have a SQL script to alter the table. But before alter the table I need to test some condition , if the condition satisfy then I have to alter the table through the SQL script. For the checking the condition I have to use the plsql block and inside I need to call the SQL script.
    Can I call a SQL script from PL/SQL block, if yes then how?
    I am tring to use START, RUN and @ command but it is throughing error.
    Thanks
    SUN

    [PL/SQL manual|http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/functions55a.htm#77600] Ctrl-F start, finds nothing. [SQLPlus manual|http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/toc.htm] Ctrl-F start finds this. Isn't it wonderful that Oracle documents this stuff so we don't have to guess.
    Can I call a SQL script from PL/SQL block, if yes then how? No.
    You could call the stored procedure in a SQL*Plus script before the alter table and have it raise an exception if the condition is not met and have the script quit when there is an error.

  • Error when trying to run script using SDK at plugin startup

    Hi
    I am trying to run a script when my InDesign plugin is loaded. I referred to the PanelTreeView sdk sample as an example and implemented a StartupShutdown Boss
    In my implementation, in the startup() method I have the code to get the scriptManager and the scriptRunner for my javascript that I want to run. However, when my code hits the following line :
              InterfacePtr<IScriptRunner>theRunner(Utils<IScriptUtils>()->QueryScriptRunner(scriptFile) ); //scriptfile is ID script file that I want to run
              I get the error saying "Calling ScriptInfoDatabase::InitScriptInfoManager before resources have been registered".
    I am wondering how I can fix this error. or if this is too early to invoke scriptrunner, then is there some other place where I can invoke the scriptrunner to run my script
    this is how I have defined my StartupShutdown Boss class in  the .fr file
        Class
             kmyStartupShutdownBoss,
             kInvalidClass,
                 /** Implementation of IStartupShutdownService that runs a  scripts on startup */
                 IID_IAPPSTARTUPSHUTDOWN, kmyStartupShutdownImpl,
                 /** identify the service type */
                 IID_IK2SERVICEPROVIDER, kCStartupShutdownProviderImpl,
    Appreciate any help on this one .. thanks!
    Sameer

    Dependent on your InDesign version, you can schedule an IdleTask and do it from there, or just use a lazy startup.
    IID_IK2SERVICEPROVIDER,kLazyStartupShutdownProviderImpl,
    Again dependent on your InDesign version you should first check whether a script can run at all - some nasty other plugins may prevent that with modal dialogs.
    Finally there is the possibility to run startup scripts even without plugin ...
    Dirk

Maybe you are looking for

  • TC in combination with mac mini and WIFI

    Hello, I am living in an apparment with provided internet - it used to be a cable modem. Now cable modem was deactivated by the owner and free WIFI was established in our house (but limited to three devices) I connected my mac mini to the existing WI

  • Management Console with Multi App Servers (BPC 7 SP06)

    Hello everyone, I recently upgraded to BPC 7 SP06 from 5.1 and was wondering how Management Console suppose to really work... We have multiple Application Servers running behind load balancer, so when I login to http://<loadbalancer>/ManagementConsol

  • Custom Print

    I am trying to print a form with the following measures, height: 404, width: 639. The problem is that when printing, I need to choose the size of A4 paper, but in doing so I lose the positioning settings I had configured in the template of the form.

  • Does Aperture have a salt and pepper filter

    I have scanned around 3000 photos and imported into iPhoto.  On enlargement many have dozens of small white spot and tiny hair imperfections.  In iPhoto these can be deleted individually by using the retouch tool.  Does Aperture (or hidden in iPhoto)

  • Note to forum keepers

    Just a note that this morning there appeared to be a couple problems. 1. Your Watches disappeared 2. You seemed to have had problems with the login. It wouldn't accept my password (same one I used yesterday, today to post this, and sent to me by forg