Sample shell scripts to run workbooks

Does anybody have some sample shell scripts to run the workbooks?

Your Schedule workbooks thru command line thread contains answers.

Similar Messages

  • Sample shell script - to run procedures and shell script

    Hi ,
    I would like run some procedures in one shell script which passing parameters as username/password@dbname.
    1. Execute proce1
    2.Execute proce3
    3.Execute proc4
    Can you please give some script/idea how we will create shell script . I am using SunSolaris Unix operating system.I would appreciate your help.
    Regards,
    Clark

    user10818198 wrote:
    I would like run some procedures in one shell script which passing parameters as username/password@dbname.
    1. Execute proce1
    2.Execute proce3
    3.Execute proc4
    At a very basic level, based on the information you have provided, your shell script would be something like this:
    sqlplus /nolog <<EOF
    connect username/password@dbname
    exec proce1;
    exec proce2;
    exec proce3;
    exit
    EOFBesides this, you could:
    (1) Add the shebang at the top, to specify the shell you are using, e.g. #!/bin/ksh for the Korn shell etc.
    (2) Ensure that "sqlplus" is recognized by the shell, by maybe running an "ora_env.sh" script that sets Oracle parameters. More likely, if you are using this Unix account for interaction with Oracle, then you may want to add the Oracle parameter information in your .profile or .bash_profile or .csh_profile etc. in the home directory.
    (3) Run a few sqlplus commands right before calling those stored procedures, if needed. For example, if you want to exit from sqlplus (and Oracle) if an error occurs while executing any procedure, then add this -
    whenever sqlerror exit 1Thus your script becomes:
    #!/bin/ksh
    # Ensure that Oracle parameters are set by this point
    sqlplus /nolog <<EOF
    connect username/password@dbname
    whenever sqlerror exit 1
    exec proce1;
    exec proce2;
    exec proce3;
    exit
    EOF(There are other settings as well; it really depends on your requirements.)
    Can you please give some script/idea how we will create shell script . I am using SunSolaris Unix operating system.
    How to create a shell script ? Well,
    (1) Save the commands shown above in a file, using your favorite text editor. Name the file "my_script.sh" or "<a_better_name>.sh" etc. (or maybe ".ksh" for the Korn shell - it's just a best practice, the shell doesn't really care.)
    (2) Make your script executable, like so -
    $ chmod 744 myscript.sh(3) And then execute it -
    $ ./myscript.sh- You could also execute the script in the current shell (as against a child shell) by doing this after Step (1):
    $ . myscript.shHope that helps.
    If there are specific questions, then post them here.
    isotope

  • Shell script for running obiee 11g services in linux

    Hi
    We have a requirement to create a shell script inorder to run OBIEE 11G services in Linux OS. It would be very helpful and greatly appreciated if any pointer(s)/documentation on this is provided.
    Thanks

    we had run the scripts using nohup "nohup ./startWeblogicServer.sh &" and reopened putty to run other nodemanager and opmnctl scripts, now everything has started and working fine.
    Thanks all..

  • Using a UNIX shell script to run a Java program (packaged in a JAR)

    Hi,
    I have an application (very small) that connects to our database. It needs to run in our UNIX environment so I've been working on a shell script to set the class path and call the JAR file. I'm not making a lot of progress on my own. I've attached the KSH (korn shell script) file code.
    Thanks in advance to anyone who knows how to set the class path and / or call the JAR file.
    loggedinuser="$(whoami)"
    CFG_DIR="`dirname $0`"
    EXIT_STATUS=${SUCCESS}
    export PATH=/opt/java1.3/bin:$PATH
    OLDDIR="`pwd`"
    cd $PLCS_ROOT_DIR
    java -classpath $
    EXIT_STATUS=$?
    cd $OLDDIR
    echo $EXIT_STATUS
    exit $EXIT_STATUS

    Hi,
    I have an application (very small) that connects to
    our database. It needs to run in our UNIX environment
    so I've been working on a shell script to set the
    class path and call the JAR file.
    #!/bin/sh
    exec /your/path/to/java -cp your:class:paths:here -MoreJvmOptionsHere your.package.and.YourClass "$@"Store this is a file of any name, e.g. yuckiduck, and then change the persmissions to executechmod a+x yuckiduckThe exec makes sure the shell used to run the script does not hang around until that java program finishes. While this is only a minor thing, it is nevertheless infinite waste, because it does use some resources but the return on that investment is 0.
    CFG_DIR="`dirname $0`"You would like to fetch the directory of the installation out of $0. This breaks as soon as someone makes a (soft) link in some other directory to this script and calls it by its soft linked name. Your best bet if you don't know a lot of script programming is to hardcode CFG_DIR.
    OLDDIR="`pwd`"
    cd $PLCS_ROOT_DIRVery bad technique in UNIX. UNIX supports the notion of a "current directory". If your user calls this program in a certain directory, you should assume that (s)he does this on purpose. Making your application dependent on a start in a certain directory ignores the very helpful concept of 'current directory' and is therefore a bug.
    cd $OLDDIRThis has no effect at all because it only affects the next two lines of code and nothing else. These two lines, however, don't depend on the current directory. In particular this (as the cd above) does not change the current directory for the interactive shell your user is working in.
    echo $EXIT_STATUS
    exit $EXIT_STATUSEchoing the exit status is an interesting idea, but if you don't do this for a very specific purpose, I recommend not to do this for the simple reason that no other UNIX program does it.
    Harald.

  • Need Power shell script to run on all databases.

    Hi,
    I have a stored procedure to generate report, using power shell script want to get all databases, run stored procedure on each database and generate the results as .csv file, output the file with database name (place it on directory) and  email .csv
    file.
    looking for script, can any one help pls?
    Naveen| Press Yes if the post is useful.

    Can you please share with me the codes
    Naveen| Press Yes if the post is useful.
    Dear N_14
    You can have a look on the followings
    http://www.csharp-station.com/Tutorial/AdoDotNet/lesson07
    http://www.codeproject.com/Articles/415732/Reading-and-Writing-CSV-Files-in-Csharp
    https://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage%28v=vs.110%29.aspx
    Best Regards
    mintssoul

  • Automator workflow "run shell script" keeps running. How to stop?

    Because i want two instances of dropbox running simultaneously on my Mac, I set up a small automator workflow application. The workflow consist of a simple shell script:
    Or in text:
    bash
    HOME=$HOME/Dropbox-quivertree /Applications/Dropbox.app/Contents/MacOS/Dropbox &
    The problem is that once the application runs, or i execute the script from within automator, it just keeps running (i get the little cog in my menubar). Anybody have an idea how to automatically stop after it has launched dropbox?
    Thanks!
    Kim

    I do not have dropbox on my computer, so I tested using the Calculator application. The solution proposed by Mattis S.F. does work, but his explanation does not hold true in my case. Initially, I successfully tried
    HOME=$HOME/Dropbox-quivertree nohup /Applications/Calculator.app/Contents/MacOS/Calculator >/dev/null 2>&1 &
    If I remove the “nohup”, the result does not change. Removal of the “/dev/null 2>&1”, however, results in the same problem originally described by Kim van der Leeuw. My guess is the background process has stdout and stderr redirected by default back to the automator. When redirected to /dev/null, the automator no longer waits for the background process to complete. To summarize, change
    HOME=$HOME/Dropbox-quivertree /Applications/Dropbox.app/Contents/MacOS/Dropbox &
    to
    HOME=$HOME/Dropbox-quivertree /Applications/Dropbox.app/Contents/MacOS/Dropbox >/dev/null 2>&1 &

  • Power shell script to run a Resuable workflow.

    Hi,
    We came across a scenario where we want to run a resuable workflow on all List items in a list. I am not sure if this can be acheived through power shell. Can any one please help me to run reusable workflows through power shell script on list items.
    Thanks,
    Sandy

    Hello,
    Recently i executed below script for my VS workflow on list items, you can also try same on reusable WF.
    Basically you need to use "WorkFlowManager" and "WorkFlowAssociations " to find WF on list and then execute it.
    http://www.mysharepointadventures.com/2012/06/start-a-workflow-using-powershell/
    http://www.thesysadminhimself.com/2013/09/sharepoint-start-workflow-all-items-powershell.html
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

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

  • LoginHook Shell Script not running?

    I have a very simple login shell script (open http://pathtowebsite.local) that I have set as a LoginHook. When running the script from the Terminal, it opens the website, as expected. However, on login it appears that something happens, the menu bar flashes and disappears until you click on something, but the website doesn't open. The permissions are set properly, and it is executable. The script is located in the global /Library folder in a folder I created called Management, though I also tried putting it in the /Users/Shared directory in case it was an access issue.
    Any ideas on what I might do to resolve this issue? I can't seem to get it to actually kick off at user login like it should.

    The LoginHook environment is minimum. There is NO PATH
    pwd: /
    id -a: uid=0(root)
    gid=0(wheel)
    egid=80(admin)
    groups=0(wheel),
    1(daemon),
    2(kmem),
    8(procview),
    29(certusers),
    3(sys),
    9(procmod),
    4(tty),
    5(operator),
    80(admin),
    20(staff)
    $1: thelogin_person'susername
    printenv:
    PWD=/
    SHLVL=1
    SECURITYSESSIONID=449a3aa0
    _=/usr/bin/printenv
    Notice, no PATH, no USER environment variables, just about nothing as an environment.
    So there is no way for the LoginHook to find the 'open' command.
    Try changing your script to /usr/bin/open

  • Shell script to run PL/SQL Program

    hai,
    i have problem in returning values from PL/SQL procedyre back to Shell script which calls the procdure.can anyone please suggest a model shell script to handle this
    Thankyou

    SQL> create or replace function disp_mess
      2  return varchar2 is
      3  begin
      4     return('Hello World');
      5  end;
      6  /
    Function created.
    SQL> select disp_mess from dual;
    DISP_MESS
    Hello World
    SQL> exit
    Disconnected from Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.4.0 - Production
    $ cat disp_mess.sh
    MESS=`sqlplus -s scott/tiger << !
    set head off
    set pages 0
    select disp_mess from dual;
    exit
    ! `
    echo $MESS
    $ disp_mess.sh
    Hello World
    $Paul

  • Shell script to run against 1000s dbs

    what's should be the things to put in this scripts, like how to connect to different server & connect /as sysdba ; and run .sql ? just trying to understand how these kind of scripts work?

    #!/bin/sh
    #Pull all entries from your tnsnames.ora file, skipping lines with # ( )
    #SQLPLUS to each as sys and show the current date
    #This assumes that your SYS password is the same on all instances.
    for tns_name in `grep -v -E '#|\(|\)' $TNS_ADMIN/tnsnames.ora | cut -f 1 -d ' '`
    do
    sqlplus -s sys/sys_pwd@${tns_name} as sysdba <<EOF
    set head off pages 0 verify off
    select sysdate from dual;
    exit;
    EOF
    done
    Hope this helps.

  • Need a sample file for IDQ parameter file and a Shell script to execute it from command line

    Hello,The parameter file itself is generated from cmd line using infacmd command and it automatically creates the parameters inside it based on the parameters created inside the mapping and the workflow. So, even if one provides you a paramtere file for IDQ, it might fail as your workflow definition and its paramters would be different. Thanks,K

    Hi all   My project migrated from Power Center to IDQ developer and I had to move all my mappings to IDQ developer. I was able to migrate everything except for the parameter files. It seems that the layout and syntax for parameter file is different from Power Center. Is there anyone who can help me out or send me a sample of a parameter file for IDQ? As well as a sample shell script to run the mapping or application from the Command line.This is an urgent need and It will be greatly appreciated.   ThanksNaveen Medisetti

  • How to run a java class from a shell script with passing arguments

    hi,
    I have a jar with all the required classes. I was using ant to run the classes i needed.
    But now i want to use a shell script to run the class, also the class accepts some arguments so when script is run it should accept arguments.
    So can any one tell me how to set class paths, jar location and call the required class from shell script or batch file with passing arguments to it.
    Thanks in advance.

    Let's say that the order of arguments is as below
    1. Jar file name
    2. Classpath
    Your shell script would look like this
    java -cp $CLASSPATH:$2 -jar $1 I am assuming that your jar file has the required main-class entry in its manifest. Note that $1...$9 represent the arguments to this shell script.
    The same goes for a batch file
    java -cp %CLASSPATH%;%2 -jar %1

  • Run java shell script on Linux

    Hi I am just trying to convert a Windows batch file to a unix shell script to run a java application, but it so long since Ive used UNIX I cant really remember how to do it.
    My script contains
    #!/bin/sh
    java  -jar lib/testapp.jarThese are my failed attempts to run it, not too sure what the differences are but I think the 3rd one is the only one to actually find my shell script.
    [root@]# testapp.sh
    -bash:  testapp.sh: command not found
    [root@]# ./ testapp.sh
    : bad interpreter: No such file or directory
    [root@]# .  testapp.sh
    Unable to access jarfile lib/testapp.jarif I just do this at the command line it works fine
    [root@]#java  -jar lib/testapp.jar

    #1
    [root@]# testapp.sh
    -bash:  testapp.sh: command not found
    #2
    [root@]# ./ testapp.sh
    : bad interpreter: No such file or directory
    #3
    [root@]# .  testapp.sh
    Unable to access jarfile lib/testapp.jar#1 is because the command (testapp.sh) is not found on the PATH. Under Unix the current directory . is not included automatically in the PATH: it has to be excplicitly specified, and this is a good thing. Also make sure it has the x (executable) switch on: chmod +x  testapp.sh
    #2 is because you had an extra space in what should have been
    ./testapp.sh #3 there you could "inline" the script but the file lib/testapp.jar was appearently not found. Is lib really under the working directory or in other some place?

  • Run shell script as root on boot

    Hi!
    I have the need to run a shell script on boot up as root.
    It will not run as any other user because the software that the shell script runs requires root permissions, and I don't use my computer as root. I can't run it at login and use sudo because it would ask for a password and hang.
    How can I have the shell script auto-run at boot (or login) as root?
    Thanks
    Ross

    Hi,
    first of all you can store your shell script anywhere on your system, I prefere the location /usr/local/scripts (this doesn't exist by default).
    Second you have to create a LaunchDeamon script in /Library/LaunchDeamons which execute your shell script at boot as root.
    An example:
    -------------------------snip------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST
    1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>YOURIDENTIFIERNAME</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/scripts/YOUR_SCRIPT.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>UserName</key>
    <string>ROOT</string>
    <key>GroupName</key>
    <string>WHEEL</string>
    </dict>
    </plist>
    -------------------------snap------------------------
    http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemS tartup/Articles/LaunchOnDemandDaemons.html
    To run a script as root during a user login you can configure a LoginHook. To create a LoginHook login as the relating user and type the following commad:
    sudo defaults write com.apple.loginwindow LoginHook /Path/To/Your/Script
    http://support.apple.com/kb/HT2420
    Hope that helps
    Bye Tom

Maybe you are looking for

  • "more than one application server offer ENQ service " in SICK transaction

    Dear Gurus We have a problem in SICK Transaction in 4.6 b server contanining 3 instances . " more than one application server offer ENQ service" When 2 instances are stopped and run the SICK transaction for one instanse found no error but when other

  • HT1338 After recent update I can no longer see some my friends in my "find my friends" app?

    Since I updated my iPhone 4 I can no longer see some my friends on the "find my friends" app.  I used to be able to follow my husband and son but now it just says "location not available".  It's strange because they can still see me and follow me?

  • A dictionary ADT - I need the answer for this by tomorrow

    I need an ADT that maintains a set of keys (that can be sorted - numbers for example) that implements inserting and deleting a key in O(1) time worst-case and finding a key in O(n*log(n)) time worst-case. Also, the amortized time complexity of all op

  • Speed Up Statement

    I have a table with columns 'data', 'data_type', 'date', 'time'. There are a limited number of 'data_type'. I need to get the most recent 'data' with respect to 'date' and 'time' for earch 'data_type'. My statement (w/ 1000 maximum rows returned): SE

  • GL Account Tax category

    Hi If we want to change the tax category in the control tab of the GL account, do we need to change it in DEV and move the transports or can we create it directly in Production. Thank you.