AUTOMATED SCRIPT POSSIBLE?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: AUTOMATED SCRIPT POSSIBLE?

  1. #1
    Join Date
    Sep 2000
    Location
    Chennai, India
    Posts
    865

    Unhappy

    The following commands I give after logging in as root

    su -c user1
    lsnrctl
    start listener1
    exit
    svrmgrl
    connect internal
    startup
    exit
    lsnrctl
    start listener2
    exit
    cd /home/app/oracle/admin/xxx/scripts
    ./ap.sh start all
    exit
    su -c user2
    cd /home/app/oracle/1103/admin/xxx/scripts
    ./apcm.sh start
    ./apfrm.sh start

    Now the question is whether I can automate this? The OS is Sun Sparc Solaris 2.6, Oracle 8.0.5 and Oracle Applications 11.0.3.

    I tried but failed. Can u help please?

    Thanks.

    With regards.

  2. #2
    Join Date
    Mar 2001
    Location
    Ireland/Dublin
    Posts
    684
    Type in command line 'crontab -e'
    and insert line like that:
    00 8-20 * * * su -l oracle --command="/home/oracle/shell/recync.sh"
    where 00 - minutes, 8-20 - hours, ...
    Read that:
    http://www.nvision.com/support/unix/...x/crontab.html

    Best wishes!

  3. #3
    Join Date
    Mar 2001
    Posts
    635
    Hi

    You can surely automate these tasks to come up when the system comes up.You will need to write a shell script and put all the commands and test it to doulbe check weather it is performing the task.After performing the above task you will have to copy the above file to the following directory

    /etc/init.d

    Name the file as

    S100nameofthefile

    The letters S is used to execute the file during startup and the no 100 is the sequence in which the files should be executed

    Hope this helped

    Regards
    Santosh

  4. #4
    Join Date
    Sep 2000
    Location
    Chennai, India
    Posts
    865
    Thanks for the response.

    The problem is in writing a script for these tasks.

    When the first line "su -c user1" is executed then is goes in and stands still. How to make it use the next line in the script? i.e., LSNRCTL


  5. #5
    Join Date
    Mar 2001
    Posts
    635
    Hi

    Why are you Invoking the listener twice beacause whatever no of listener services you create they are all in listener.ora file so thru one command you should be able to start all the services in the listener.ora file and that is

    lsnrctl start

    Why dont you try the following code

    su -c user1
    lsnrctl start
    svrmgrl @first.sql
    cd /home/app/oracle/admin/xxx/scripts
    ./ap.sh start all
    exit
    su -c user2
    cd /home/app/oracle/1103/admin/xxx/scripts
    ./apcm.sh start
    ./apfrm.sh start

    Create the following file and remember to input the exact path in ur script file

    first.sql

    connect internal
    startup;
    exit

    Hope this helps

    Regards
    Santosh

  6. #6
    Join Date
    Sep 2000
    Location
    Chennai, India
    Posts
    865

    Thanks for the effort!

    Thanks for the help.

    After logging in as root...
    # pwd
    /
    I ran the script
    # ./home/app/oracle/admin/xxx/scripts/back/ssstart.sh

    Sun Microsystems Inc. SunOS 5.6 Generic August 1997
    $

    It comes to the prompt as above and stop there, how to make it continue the execution of the script?
    When I type exit at the prompt the result is as follows...

    $ exit
    ./home/app/oracle/admin/xxx/scripts/back/ssstart.sh: lsnrctl: not found
    ./home1/app/oracle/admin/VIS/scripts/back/ssstart.sh: svrmgrl: not found

    Any more ideas? Thanks.

    With regards.


  7. #7
    Join Date
    Nov 2000
    Posts
    245

    check your oracle environment, e.g. path, it should point $OH/bin, oracle_home, sid...

  8. #8
    Join Date
    Jun 2000
    Posts
    417
    Yeah you'll need to make sure the script sets up all the required environment variables, if you run it yourself your environment might already be set up, but when crontab runs it, nothing is.

  9. #9
    Join Date
    Sep 2000
    Location
    Chennai, India
    Posts
    865

    The actual problem is ...

    Thanks for the info.

    But, the problem I'm facing is that after loggging in as dba user(user1) the script does not continue to execute! How to make the script continue to execute after logging in?

    The reason the errors svrmgrl, lsnrctl not found comes is, as nothing happens after logging in as dba user(user1), I type exit at the prompt and so it comes to root n continues to execute the script and gives these error.

    THE PROBLEM NOW IS 'HOW TO MAKE THE SCRIPT CONTINUE TO EXECUTE AFTER LOGGING IN'

    Thanks.

    With regards.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width