1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Shell Script Usage in Oracle Applications

Discussion in 'System Administration & Application DBA' started by murthyreddy, Jan 28, 2010.

  1. murthyreddy

    murthyreddy Guest

    Hi All,

    Following are the various purposes we can go for Shell Scripts in Oracle Apps.

    1) If you would like to move the Files from One Unix Server to the Other Unix server, we can opt Shell Scripts.we can transfer all files at a time, we can Zip those files and we can encrypt those files in unix shell scripts.

    2) We can connect to the database and perform actions to meet your requirements.
    If i need to run a particular procedure from Shell script, we can achieve using the following.

    Sample Usage:

    Code (Text):
    sqlplus -s $user/$pass <<++END>>$LOGFILE

    set serveroutput on size 1000000
    set feedback off
    BEGIN
     
     Package.procedure('$parameter1','$parameter2'... etc)
     
    exception
      when others then
      dbms_output.put_line (SQLERRM);
      RAISE_APPLICATION_ERROR(-20001,'Error',TRUE);
    end;
    /

    ++END
    3) We can submit a concurrent program from Shell Script.

    Syntax:

    Code (Text):
    CONCSUB <APPS username>/<APPS password> \<responsibility application short name> \<responsibility name> \<username> \[WAIT=N|Y|<n seconds>] \CONCURRENT \<program application short name> \<program name> \[PROGRAM_NAME=â€<description>â€] \[REPEAT_TIME=<resubmission time>] \[REPEAT_INTERVAL= <number>] \[REPEAT_INTERVAL_UNIT=< resubmission unit>] \[REPEAT_INTERVAL_TYPE=< resubmission type>] \[REPEAT_END=<resubmission end date and time>] \[START=<date>] \[IMPLICIT=< type of concurrent request> \[<parameter 1> ... <parameter n>]
    Eg:

    Code (Text):
    v_concreq='./CONCSUB $1 SQLGL "BA Schedule Conc. Programs - FINUSER" FINUSER WAIT=Y CONCURRENT SQLAP "APXMCCDF" $CARDPRGID $TARGET_DIR/$OUTNAME'

    where v_concreq is a variable
             $1 holds the user/password
             FINUSER is the user name
             BA Schedule Conc. Programs - FINUSER is the Responsibility name
             APXMCCDF is concurrent program short name
             CARDPRGID is the first parameter for the concurrent program
             TARGET_DIR/$OUTNAME is second parameter for the concurrent program
    These are the scenarios i got as our requirement. If there are any queries on this Article, please raise your query. I look forward to post new Articles soon.

    Cheers...
    3Murthy Reddy
     
  2. Sadik

    Sadik Community Moderator Forum Guru

    Messages:
    1,906
    Likes Received:
    252
    Trophy Points:
    1,455
    Good article.
     
  3. salmankhalid

    salmankhalid Forum Advisor

    Messages:
    116
    Likes Received:
    6
    Trophy Points:
    260
    Location:
    Lahore, Pakistan
    Really Nice Effort......
    :cool:
     
  4. shanmugass

    shanmugass Active Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    75
    Good one..
     
  5. afzalbaba

    afzalbaba Active Member

    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    110
    Location:
    india
    Nice Thanks for sharing..