Sqlplus and unix (bash) shell scripting

Hi,
I'm extracting some information from a DB and then "spooling" it to a file. So far so good.
The problem is that the records I get are not like what they look like when I run the stuff in sqlplus. Instead, the spooled file has alot of weird spaces and tabs in between and does not properly separate between the different rows.
Does anyone have any tips on how to do this?
Note: The datatype of the field I'm retrieving is "long". I've set linesize, pagesize and long to 1000.

Hi!
Try also to change SQL*Plus settings, i.e. SET LINESIZE 1000 (or whatever the most long line of your report could be), then TRIMSPOOL ON, TRIMOUT ON.
Regards,
Andrew Velitchko
BrainBench MVP for Developer/2000
http://www.brainbench.com

Similar Messages

  • Secure login to remote UNIX host and run a shell script

    Hi I am new to JAVA. I want to login to remote UNIX host from my application secure login (SSH) and run a shell script reside that remote host. Can any one let me know the way how to do it. If possible provide the code example.

    Runtime.exec with an ssh command (not really recommended).
    Much better, an SSH API (JSch, which needs JZlib, from http://www.jcraft.com/ is a good one).

  • Problem with running Bash shell scripts

    I am unable to run Bash shell scripts on the UNIX Terminal application.
    This is the transcript from the Terminal application.
    Zhi-Yang-Ongs-Computer:/Applications/MetaPost/metapost-1.102 zhiyangong$ ./test1.sh
    dyld: Symbol not found: _BC
    Referenced from: /usr/local/bin/bash
    Expected in: /usr/lib/libSystem.B.dylib
    Trace/BPT trap
    Zhi-Yang-Ongs-Computer:/Applications/MetaPost/metapost-1.102 zhiyangong$
    Is this a problem with the the default installation of the Bash shell? Can I install the Bash shell on my own? If so, how can I do that?
    Also, how can I get the dynamic linker, dyld, to refer to the symbol "_BC"? What does this symbol "_BC" refer to?

    This was in your posted output:
    /usr/local/bin/bash
    You are NOT running the default bash, you are trying to run a private copy.
    The default Mac OS X bash is located at
    /bin/bash
    Try the following:
    /bin/bash ./test1.sh
    Does that work?
    What is the first line of your script? Is it:
    #!/bin/bash
    Or maybe
    #!/usr/bin/env bash
    /usr/bin/env would find the first bash in PATH . I find this most useful for finding perl on different systems, but sh, ksh, bash, zsh, csh, tcsh are all generally found in /bin so I do not bother using /usr/bin/env
    And if you have
    #!/usr/local/bin/bash
    Then the person that wrote test1.sh choose to use something besides the default bash
    Or maybe this script was transferred from some system where you needed to put your own copy of bash in /usr/local/bin because the vendor does not distribute bash
    Then again, you have not showed us what is inside your script, so it is possible something in the script called something else which invoked the /usr/local/bin/bash
    If that is the case, then you might try:
    /bin/bash -x ./test1.sh
    which should show you the commands executed before it died.

  • Invoking a bash shell script from Java code

    Hi All
    I am trying to invoke a Bash shell script using java code. The arguments required are "source wmGenPatch <source dir> <destination dir> no_reverse.
    in the code I have specified the arguments considering the cannonical paths of the files as the code may run on Unix or windows platform.
    I am getting a error while invoking Runtime.getRuntime().exec(args). The error is as follows :
    "The Error Occurred is: CreateProcess: source D:\Package4.0\workspace\DiffEngineScripts\v4a02\wmGenPatch D:\Package4.0\workspace\fromImageFilesDir\ D:\Package4.0\workspace\toImageFilesDir\ no_reverse error=2"
    It seems that error=2 indicates that the 'file not found' exception. But i can see the directories referred to in the error at place in the workspace.
    Kindly advice.
    Thanks in advance.

    Hi All
    I am pretty new to invoking bash shell scripts from java and not sure if i am progressing in right direction.
    The piece of code tried by me is as follows
    try {
                   currentDir = f.getCanonicalPath();
              } catch (IOException e) {
              if (currentDir.contains("/")) {
                   separator = "/";
              } else {
                   separator = "\\";
              String args[] = new String[7];
              args[0] = "/bin/sh";
              args[1] = "-c";
              args[2] = "source";
              args[3] = currentDir + separator + "DiffEngineScripts" + separator
                        + "v4a02" + separator + "wmGenPatch";
              args[4] = sourceFileAdd;
              args[5] = destFileAdd;
              if (isReverseDeltaRequired) {
                   args[6] = "reverse";
              } else {
                   args[6] = "no_reverse";
              try {
                   Process xyz = Runtime.getRuntime().exec(args);                              
                   InputStream result = xyz.getInputStream();
                   InputStreamReader isr = new InputStreamReader(result);
                   BufferedReader br = new BufferedReader(isr);
                   String line = null;
                   while ( (line = br.readLine()) != null)
                        System.out.println(line);
                   int exitVal = xyz.waitFor();
                   System.out.println("Leaving Testrun.java");
              } catch (Throwable t) {
                   t.printStackTrace();               
    and on running the same i am getting Java.io.IOException with the stack trace
    java.io.IOException: CreateProcess: \bin\sh -c source D:\Package4.0\workspace\DiffEngineScripts\v4a02\wmGenPatch D:\Package4.0\workspace\fromImageFilesDir\ D:\Package4.0\workspace\toImageFilesDir\ no_reverse error=3
    kindly advice
    Thanks in advance

  • Executing a unix kill from APEX or running a bash shell script from Apex

    I'm writing a browser based app that I would like to write with APEX and that will identify and kill a very specific process name and Unix user name combo.
    I can identify the unix PID in V$SESSION if I want so, I know how to to the first part (identify the process/PID).
    How can an APEX app execute the Linux kill command? I'm not seeing anyway to host out of APEX. I was looking for something like that where you create processes...
    Please provide only suggestions on how to do this from APEX. I know there are lots of other ways (CGI from Apache etc.).

    I have this working, though it's kinda clunky.
    Apex calls Oracle Stored Procedure which calls Java stored procedure which defines a class that runs exec to execute an OS command, and waits for the return value.
    The DBA had to grant special permission for my oracle schema to execute the script name that is passed into the Java.
    Others may have a better way of doing this.

  • Can we not run 2 sqlplus programs in a shell script ?

    Hi
    I have 2 spool programs which need to be called from a shell script .
    When i try to do it , only the first spool program runs but not the second one . Is their any reason ?
    #!/usr/bin/bash
    ORACLE_HOME=/oracle10g/product/10.2.0/client_1
    export ORACLE_HOME
    sqlplus -s abcdata/daddy@DevOra < lit_fac.sh > output.log 2>&1
    sqlplus -s abcdata/daddy@DevOra < lit_fac_cat.sh . output_cat.log 2>&1
    exit
    How to run 2 scripts containing select queries each from sqlplus in another shell script ?
    Thanks in advance ..

    user8703472 wrote:
    Hi
    I have 2 spool programs which need to be called from a shell script .
    When i try to do it , only the first spool program runs but not the second one . Is their any reason ?
    #!/usr/bin/bash
    ORACLE_HOME=/oracle10g/product/10.2.0/client_1
    export ORACLE_HOME
    sqlplus -s abcdata/daddy@DevOra < lit_fac.sh > output.log 2>&1
    sqlplus -s abcdata/daddy@DevOra < lit_fac_cat.sh . output_cat.log 2>&1
    exit
    How to run 2 scripts containing select queries each from sqlplus in another shell script ?
    Thanks in advance ..As I said before .. the term "spool program" has no meaning in Oracle and only serves to cloud the issue. I know you are used to using this term with other products, but "When in Rome ...."
    As for your example above, why are you using what appears to be a unix shell script as redirected input into sqlplus? And in the second line, what's with the dot (".") between "lit_fac_cat.sh" and "output_cat.log"?
    If these .sh files are really sql files (which is the only thing sqlplus know how to process) then the proper things to do are
    1) name them lit_fac.sql and lit_fac_cat.sql
    2) feed them to sqlplus in the standard, documented manner:
    sqlplus -s abcdata/daddy@DevOra @lit_fac.sql

  • Invoking a Package.Procedure via bash shell script

    Hello All,
    I am using the below syntax to call package in a unix shell script, is this right way of calling and checking for errors or is there any other better approach?? kindly suggest.
    I am using Oracle 11g & Linux OS, SQL*Plus: Release 11.2.0.3.0 Production
       RETVAL=`sqlplus -s FCSDWH_STG/${DBSTG}@${DBSRC} <<EOF
            EXEC FCSDWH_STG.FCA_HASH_TOTALS_PKG.HASH_TOTALS_COMPUTE(${PROVIDER},${UNINUM},${EXTRACT_DT},${VER_NUM});
            EOF`
            if [ `echo ${RETVAL} | egrep "ERROR"` ]
            then
                    logit "Error While Generating The SQLPLUS Output File, Please Check"
                    exit 1
            else
                    logit "SQLPLUS Output File Has Been Generated Successfully"
            fiThanks much.

    Ariean wrote:
    I am testing the same above functionality with the below sample procedure, and I am purposefully making it compile erroneous with "dbms_output.put_lin" just for sake of testing.
    create or replace
    procedure today_is as
    begin
    dbms_output.put_lin('Today is : ' || to_char(sysdate,'DL'));
    end today_is;This is sample shell script "test.sh" I am using
    #!/bin/bash
    RETVAL=`sqlplus -s FCSDWH_STG/FCSDWH_STG@dwdev <<EOF
    set termout off
    exec today_is;
    EOF`
    echo "start here"
    echo ${RETVAL}
    echo "end here"
    if [ `echo "$RETVAL" | grep "ERROR"` ]
    then
    echo "Error While Generating The SQLPLUS Output File, Please Check"
    exit 1
    else
    echo "SQLPLUS Output File Has Been Generated Successfully"
    fiBelow is my output
    start here
    BEGIN today_is; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00905: object FCSDWH_STG.TODAY_IS is invalid
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    end here
    /home/infrmtca/bin/test.sh: line 8: [: too many arguments
    SQLPLUS Output File Has Been Generated SuccessfullyI don't understand why it is printing "SQLPLUS Output File Has Been Generated Successfully" though it errored out.Because statements within backquotes are executed before the statement calling the backquote. The [ command has too many arguments coming from the echo and grep.  You might put just that test part of the script in it's own little script and test it, it seems to say that whether there is an ERROR in $RETVAL or not.  You might need to man test and see if you need a -z argument or something.
    >
    Edited by: Ariean on May 15, 2013 10:08 AM
    Edited by: Ariean on May 15, 2013 10:16 AM

  • Bash shell script to exception when database has been shutdown

    Hi, I'm quite new in shell scripting. I created the below simple script to do a check on the database, it's a count so it works fine... if the database is there. Now I want to be able to catch if the database is or is not there, what I tried so far didn't work, can anybody please give me a hand with this?
    The shell script file "start_check.sh":
    #!/bin/bash
    # Set environmental variables
    . /home/oracle/env/usrdwh1.env
    TEMP_FILE=rwcnt
    runCheckQuery()
    # Run query and dump result into the TEMP_FILE
    sqlplus -s "/as sysdba" > /tmp/${TEMP_FILE} << EOF
    @/u02/reports/sql/start_check.sql
    EOF
    if [ $? -eq 0 ]
    then err_num=0
    else err_num=1
    fi
    ################ MAIN ####################
    runCheckQuery
    row_count=`cat /tmp/${TEMP_FILE}`
    if [ $err_num -eq 0 ]
    then
    # If no rows were found then send an email alert
    if [ $row_count -eq 0 ]; then
    echo 'No process found - Please investigate' | mailx -s "Daily check ALERT" [email protected]
    fi
    else
    # There was an error when trying to connect to the db. Need to report it
    echo 'Database connection error - Please investigate - Error Message: (' $row_count ')' | mailx -s "Daily check ALERT (Database connection error)" [email protected]
    fi
    # Remove the tmp file
    rm /tmp/${TEMP_FILE}
    The sql script file "start_check.sql":
    SET SERVEROUTPUT ON
    SET FEEDBACK OFF
    WHENEVER SQLERROR EXIT;
    DECLARE
    row_count NUMBER;
    BEGIN
    SELECT COUNT(*)
    INTO row_count
    FROM dw_ml_ba ml_ba
    WHERE sys_id = 'CCX'
    AND ml_ex_start_datetime > TRUNC(sysdate);
    DBMS_OUTPUT.PUT_LINE(row_count);
    END;
    EXIT
    Edited by: leocoppens on Jan 4, 2013 4:05 PM

    There may be a better, but here is a shell script that works:
    #!/bin/ksh
    # db_check.sh
    # Script used to check if one or all of the databases on
    # one server are available.
    # Parameter Description
    sid=$1    # Database SID or Keyword 'all'
    function check1db
    sid=$1    # Database SID
    ORAENV_ASK=NO
    . /usr/local/bin/oraenv "$sid"
    ORAENV_ASK=YES
    if [ $(ps -ef|grep "ora_smon_$sid"|grep -v grep|wc -l) -eq 0 ]
    then
      echo "%-Error, Database $sid is NOT available - Not started\n" >>${CHKLOG}
      return 1
    fi
    dbok=$(\
    sqlplus -s / <<!
    if [[ $(echo $dbok|cut -d' ' -f1 ) == 'ERROR:' ]]
    then
      echo "%-Error, Database $sid is NOT available - Started with errors\n" >>${CHKLOG}
      return 1
    else 
      echo "%-Info, Database $sid is available\n" >>${CHKLOG}
    fi
    return 0
    } # end function check1db
    # Set some environment variables:
    ORACFG=/etc               # Location of oratab
    ORALOG=$HOME/logs         # Location for result log
    EMAIL='[email protected]'  # E-mail to send alert
    sid=${sid:-'all'}
    echo "$0 Job started at: `date` "
    BDATE=$(date +%y%m%d)
    export CHKLOG=$ORALOG/db_check_${sid}_${BDATE}.log
    echo "$0 on `date`" >$CHKLOG
    if [ "$sid" = "all" ]
    then
      i=0
      stat=0
      cat $ORACFG/oratab | while read LINE
      do
        case $LINE in
         \#*)            ;;      #comment-line in oratab
            sid=`echo $LINE | awk -F: '{print $1}'`
            check1db "$sid"
            stat1=$?
            ((stat += $stat1)) # Combine the Status of All Calls
            ((i = $i + 1))     # Count Number of Databases Checked
        esac
      done
      ((j = $i - $stat))  # Count Number of Databases Available
      echo "\n%-Info, `date +%c`,\n\tTotal databases checked = $i,\n\tAvailable = $j, Not available = $stat\n" >>${CHKLOG}
    else
      check1db $sid
      stat=$?
    fi
    # Beep operator if database down.
    if [ ${stat} -ne 0 ]
    then
      SUBJ="Database(s) alert."
      mailx -s"$SUBJ" $EMAIL <$CHKLOG
    fi
    echo "$0 Job stoped at: `date` "
    exit $stat:p

  • Port AppleScript to bash shell script

    Hi all,
    I made this script with the help of Neil from these forums. The purpose of the scrip is so that my friend can set up a share point on his NAS which is simply full of links so that if people access the NAS (its full of music and movies) if the delete a link, the file stays where it is.
    The issue he has now, is that when he make the links in MacOS, a Windows system will no follow them. Is there a way around this or should the script be ported to a bash script so that the links can be created internally on his BSD NAS.
    Thanks for any help and suggestions.
    set these_items to (choose file with prompt "Choose files to link:" with multiple selections allowed)
    set link_folder to (choose folder with prompt "Choose folder to place links in:")
    repeat with this_item in these_items
    tell application "Finder" to reveal this_item
    set this_path to the quoted form of the POSIX path of this_item
    set shell_folder to the quoted form of the POSIX path of link_folder
    do shell script "ln -s" & space & this_path & space & shell_folder
    end repeat
    end

    Your issue is one of symlink support, so it won't matter how you create the symlinks.
    First off, which version of Windows are you running?
    Only later versions of Windows (Win7 and, I think Vista) support symlinks, so if you're using anything earlier it won't work.
    Secondly, if you're pointing to a network volume then the target paths have to match, and that's likely to be a problem in cross-platform environments. That's because the symlink file really just contains the path to the target and your paths may be different on each OS.
    For example, On your Mac the sharepoint might be mounted at /Volumes/server and your file might be at /path/file on that share.
    So your symlink file will contain '/Volumes/server/path/file'
    No Windows system is going to be able to follow that path since disks aren't mounted under /Volumes. You would either have to know that share's current mount point or use a Windows path of the form \\server\share\path\file but that latter form won't work on non-Windows systems.
    So the short answer is that you probably have to create two sets of links, one for the Windows users and one for the Macs. There's no simple, universal, cross-platform symlink standard that will do what you want (at least that I'm aware of).

  • Sqlplus called from a shell script

    Hi.
    I'm calling to sqlplus from shell script. The thing is that when it ends its execution I am in sqlplus console, but I want to be in my script. Is there any option to auto-exit when it ends?
    sqlplus $DB_CON @$SQLDIR/$SQLFILE
    Thanks
    Rodrigo

    You just have to add exit command at the end of the script file, after the slash:
    end;
    exit;
    and that should work.

  • Starting Java Program with a bash Shell script

    Hi !
    I know this is a Linux query but I am putting it on this site to get different answers.
    I want to start my Java program with a shell script. Can anybody give me a proper script to start my Java program?
    I am using RH Linux 7.3 and JDK 1.4.
    Can I start the Java program without starting the terminal? Just like the Sun One Studio4 'runide.sh' script.
    Please help.
    Bye Niteen

    assuming you have your PATH and CLASSPATH variables set correctly, your script should look like this:
    #!/bin/bash
    cd <project_dir>
    java <class> &
    example:
    #!/bin/bash
    cd ~/projects
    java project1.main_package.MainClass &
    of course you could add some more elaborated stuff like compiling files before running the program, etc.
    if you dont like terminals, try running "nautilus" (it's like Windows Explorer). i never use nautilus (especially for running scripts), so i cant guarantee it will work, although i dont see why it shouldnt...

  • Bash shell scripting

    Dear Mac Users:
    I have a bash script which I copied from a bash book to learn how to use bash. Whenever I try to run it on Linux (cygwin--Windows Linux interpreter) it throws an error that something is wrong with the syntax.
    But when I try to run the same script on my Mac using Terminal.app the bash shell throws an error saying access denied. I chowned a copy of bash and referenced this copy in my script but I still get the error. I also chowned the script to the user account on my Mac. Why can I not run the script?

    #!/bin/bash
    # cookbook filename: mkalbum
    # makalbum - make an html "album" of a pile of photo files
    # ver 2.0
    # An album is a directory of html pages.
    # It will be created in the current directory
    # An album page is the html to display one photo,with
    # a title that is the filename of the photo, along with
    # hyperlinks to the first, previous, next, and last photos.
    # ERROUT
    ERROUT()
    printf "%b" "$@"
    } >&2
    # USAGE
    USAGE()
    ERROUT "usage: %s <newdir>
    " $(basename $0)
    # EMIT(thisph, startph, prevph, nextph, lastph)
    EMIT()
    THISPH="../$1"
    STRTPH="${2%.*}.html"
    PREVPH="${3%.*}.html"
    NEXTPH="${4%.*}.html"
    LASTPH="${5%.*}.html"
    if [ -z "$3" ]
    then
    PREVLINE='<TD> Prev </TD>'
    else
    PREVLINE='<TD> Prev </TD>'
    fi
    if [ -z "$4" ]
    then
    NEXTLINE='<TD> Next </TD>'
    else
    PREVLINE='<TD> Next </TD>'
    fi
    cat <<EOF
    <HTML>
    <HEAD><TITLE>$THISPH</TITLE></HEAD>
    <BODY>
    $THISPH
    <TABLE WIDTH = "25%">
    <TR>
    <TD> First </TD>
    $PREVLINE
    $NEXTLINE
    <TD> Last </TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>
    EOF
    if (($# !=1 ))
    then
    USAGE
    exit -1
    fi
    ALBUM="$1"
    if [ -d "${ALBUM}"]
    then
    ERROUT "Directory [%s] already exists.
    " ${ALBUM}
    USAGE
    exit -2
    else
    mkdir "$ALBUM"
    fi
    cd "$ALBUM"
    PREV=""
    FIRST=""
    LAST="last"
    while read PHOTO
    do
    # prime the pump
    if [ -z "${CURRENT}" ]
    then
    CURRENT="$PHOTO"
    FIRST="$PHOTO"
    continue
    fi
    PHILE=$(basename "${CURRENT}")
    EMIT "$CURRENT" "$FIRST" "$PREV" "$PHOTO" "$LAST" > "${PHILE%.*}.html"
    #set up for next iteration
    PREV="$CURRENT"
    CURRENT="$PHOTO"
    done
    PHILE=$(basename ${CURRENT})
    EMIT "$CURRENT" "$FIRST" "$PREV" "" "$LAST" > "${PHILE%.*}.html"
    # make the symlink for "last"
    ln -s "${PHILE%.*}.html" ./last.html
    # make a link for index.html
    ln -s "${FIRST%.*}.html" ./index.html

  • Rwcgi60 on UNIX needs shell script ?

    I am trying out Reports 6i on a Linux box.
    Using Apache Webserver, I have mapped all the virtual directories with execute permission.
    When I call rwcgi60 through the browser, I get the following output
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    <CENTER><H1>
    </CENTER></H1>
    <BR></BODY>
    </HTML>
    But when i call a shell script (which in turn calls rwcgi60) through the browser, i get some output.
    The shell script exports all the environment specific to Oracle Reports and calls rwcgi60.
    Is the CGI intended to be called from a script file ? If no, what other configuration is necessary ?
    Thanks.

    I am having exactly the same problem on Solaris. The information I have shoehorned out of support so far is that you do need a shell script to make this work. I have followed these instructions but am still having problems. The document which details this bug is unpublished by Oracle so I only got extracts. Detailed below.....if you do have success with this please let me know as I am tearing my hair out.
    REPORTS60_SERVER
    1. The REPORTS60_SERVER file is located in your Oracle_Home and is used to
    start the Report Server.
    2. You may need to modify this file for variables such as DISPLAY, TNS_ADMIN
    and the REPORTS60_PATH to fit your environment. @Also, please refer to
    @Note: 111548.1 for setting up the TNSNAMES.ORA file.
    3. If you are not using a WebDB Listener, you can delete the section which
    stops and starts it. However, make sure you have started up your Webserver
    Listener.
    4. Once this file has been modified, the command to execute it is:
    reports60_server start
    Shell Script (RUNREP.SH)
    1. You will need to create a shell script to run RWCGI60. This shell will then
    be called from RUNREP.HTM file. You can name it anything (the example is
    called runrep.sh) and needs to include the following:
    #!/bin/sh (or which ever shell you want to use)
    - ORACLE_HOME="/u03/app/oracle/product/dev6i"; export ORACLE_HOME
    - TNS_ADMIN="/u03/app/oracle/product/dev6i/network/admin"; export
    TNS_ADMIN
    - exec /u03/app/oracle/product/dev6i/tools/web60/cgi/rwcgi60
    2. You will need to redefine the ORACLE_HOME and TNS_ADMIN due to BUG:1201156.
    3. This script can be located anywhere as far as the Webserver
    Listener is
    concerned. However, the best place would be in the ORACLE_HOME/tools/web60/
    cgi directory for which we already have a virtual name defined in the
    listener configuration file.
    RUNREP.HTM
    1. The RUNREP.HTM file is located in the ORACLE_HOME/tools/web60/html
    directory.
    2. You will need to modify this file due to the above mentioned Bug.
    Go to the function called runReport( ) and for the var cgiexe = "rwcgi60",
    replace it with the above shell script.
    Example: var cgiexe = "runrep.sh"
    3. Next, modify the port number for the Webserver. This file assumes that you
    will be using the WebDB listener and is installed on port 8080 (by default).
    You will need to find the following and change it to the correct port
    number:
    <td><input TYPE="TEXT" NAME="WEBPORT" SIZE="4" VALUE="8080"></td>
    Change the Port Number to the one your WebServer Listener is on, such as:
    7777.
    After doing all of the above, you are ready to run a report on the web using
    CGI implementation. From the browser run the following URL:
    http://your_machine_name:listener_port#/virtual_dir_for_cgi/runrep.htm
    This brings up a Template for you to provide the report name. Also change the
    parameter values here for the userid/password, port#, and reports_server.

  • Unix master shell script to run jobs in parallel with dependency

    I need a master shell script which would call the following shell scripts as per below order. Kindly note that if any shell script fails then the master shell script should abort.
    Level 1     PRODUCTS
         SP_ROST_DLY_STG_lD
         SP_ROST_DLY_ITG_lD
    After Level 1 completes run below two shell scripts in parallel:
    Level 2     SP_IDL_EDGE_CON_POSTN_STG_Ld ,     SP_IDL_EDGE_ACCT_POSTN_STG_LD
    After Level 2 completes run below shell scripts as per the seqeunce and in parallel:
    Level 3     SP_IDL_EDGE_ACCT_STG_LD ,     SP_IDL_EDGE_CONT_STG_LD
         SP_IDL_EDGE_ACCT_STG_VAL ,     SP_IDL_EDGE_CONT_STG_VAL
         SP_IDL_EDGE_ACCT_ITG_Ld ,     SP_IDL_EDGE_CON_ITG_Ld
    After Level 3 completes run below shell scripts as per the seqeunce and in parallel:
    Level 4     SP_IDL_EDGE_CONT_POSTN_ITG_LD ,     SP_IDL_EDGE_VISITS_LD
         SP_IDL_EDGE_ACCT_POSTN_ITG_LD ,     SP_IDL_EDGE_VISITS_DTL_LD

    can i avoid using set -e and use some other method so that if there is an error in previous job then the next job is not triggered.Sure, but it is ugly.
    The below is not the only way to do this...
    Wrap every place you start another script with:
    $ if ! MYSCRIPT; then
        echo Script MYSCRIPT failed. >&2
        exit 1
    fibut the wrapper for parallel scripts is even worse:
    $ MYSCRIPT &
    $ MYSCRIPT_JOBNO=$!
    $ MYSCRIPT2 &
    $ MYSCRIPT2_JOBNO=$!
    $ MYSCRIPT_STATUS=`wait ${MYSCRIPT_JOBNO}`
    $ if [ ${MYSCRIPT_STATUS} -ne 0 ]; then
        echo Script MYSCRIPT failed. >&2
        exit 1
    fi
    $ MYSCRIPT2_STATUS=`wait ${MYSCRIPT2_JOBNO}`
    $ if [ ${MYSCRIPT2_STATUS} -ne 0 ]; then
        echo Script MYSCRIPT2 failed. >&2
        exit 1
    fi
    ...Now, doesn't a simple 'set -e' look much better?

  • Sqlplus and Unix crontab

    Hi,
    I would like to employ the crontab of Unix (Unix Aix)
    to launch a Unix script containing a stored procedure (oracle).
    Here the code of cron:
    15 09 * * 1-5 /bin/ksh -c "/my_rep/my_script.ksh"
    And the Unix script (part of): my_script.ksh"
    :!/bin/ksh
    sqlplus user/pwd@db_name << EOF
    spool my_trace
    # my_stored procedure
    print result
    EOF
    # end_of_script
    The (cron) mail of return is: sqplus not found ...
    How I can resolve that ?
    Regards

    Hi!
    You need to set the proper environment vars so cron finds sqplplus. In my scripts, I have these things set:
    --->8---
    ORACLE_HOME=/opt/oracle/product/9.2.0.1.0
    ORACLE_SID=int
    ORACLE_TERM=xterm
    PATH=$PATH:$ORACLE_HOME/bin
    TWO_TASK=INT.DEV
    export ORACLE_HOME ORACLE_SID ORACLE_TERM PATH TWO_TASK
    --->8---
    Of course, you'll have to change it to fit your environment. The example above is taken from a Solaris system.
    Cheers & HTH
    André

Maybe you are looking for

  • Sort images by 'USED" or "UNUSED" - HOW?

    When assembling large books it seems not possible to sort by 'used images' in order to see what is still available without doubling images. Yes, the used images get a little number un the top left corner, but what about the poor unused images lost in

  • Searching with File Sharing

    We use File Sharing almost every day among several Macs. After upgrading to Mountain Lion, the search function in Finder is completely different and totally wrong. I used to be able to easily search another Mac's files. Now, if i'm lucky, Finder will

  • Segment field in Automatic Postings

    Hi all of you Could any suggest me how to fill the segment field in automatic postings like AFAB and AIBU as Document splitting is activated and we dont have assignment the segment in PCtr master data. Please help me regarding Thanks Ramki

  • Tree Issue Expanding and Collapsing On Same Ids

    Hi All This is another problem i am facing in tree. Here Last two levels (L,V) are repeated in Org. If there is U1 ....U10 the same L,V level will repeat. The problem is if I expand L2 under U2,the L2 Under U3 also Expanding.This happening because of

  • Epson print drivers - should there be difference results with OSX and XP

    Since switching to a Mac a couple of years ago, the photo print output from my venerable Epson Stylus Photo RX700 seems to have become poor, with a slight greenish hue to the photos and a lack of colour crispness. I swapped the printer back to my eve