DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Automatic Oracle Startup and Shutdown

  1. #1
    Join Date
    Jun 2001
    Posts
    20

    Angry

    Hi All,

    I want to make Oracle 8i to Startup and Shutdown whenever Solaris 8
    (for Intel) is broughtup and broughtdown. While I did go through
    the Solaris MAN, I'm still not sure of what changes to make.

    I know that the rc* files need to be changed but I dont know
    which files. Here are the file structures :

    C:\>pwd
    /sbin
    C:\>ls -l rc*
    -rwxr--r-- 3 root sys 2792 Jan 5 2000 rc0
    -rwxr--r-- 1 root sys 3177 Jan 5 2000 rc1
    -rwxr--r-- 1 root sys 2885 Jan 5 2000 rc2
    -rwxr--r-- 1 root sys 2341 Jan 5 2000 rc3
    -rwxr--r-- 3 root sys 2792 Jan 5 2000 rc5
    -rwxr--r-- 3 root sys 2792 Jan 5 2000 rc6
    -rwxr--r-- 1 root sys 9973 Jan 5 2000 rcS
    C:\>


    C:\>pwd
    /etc
    C:\>ls -ld rc*
    lrwxrwxrwx 1 root root 11 Jul 13 19:56 rc0 -> ../sbin/rc0
    drwxr-xr-x 2 root sys 1024 Jul 13 20:25 rc0.d
    lrwxrwxrwx 1 root root 11 Jul 13 19:56 rc1 -> ../sbin/rc1
    drwxr-xr-x 2 root sys 1024 Jul 13 20:25 rc1.d
    lrwxrwxrwx 1 root root 11 Jul 13 19:56 rc2 -> ../sbin/rc2
    drwxr-xr-x 2 root sys 1024 Jul 13 20:38 rc2.d
    lrwxrwxrwx 1 root root 11 Jul 13 19:56 rc3 -> ../sbin/rc3
    drwxr-xr-x 2 root sys 512 Jul 13 20:14 rc3.d
    lrwxrwxrwx 1 root root 11 Jul 13 19:56 rc5 -> ../sbin/rc5
    lrwxrwxrwx 1 root root 11 Jul 13 19:56 rc6 -> ../sbin/rc6
    drwxr-xr-x 3 root sys 512 Jul 13 19:56 rcm
    lrwxrwxrwx 1 root root 11 Jul 13 19:56 rcS -> ../sbin/rcS
    drwxr-xr-x 2 root sys 1024 Jul 13 20:20 rcS.d
    C:\>

    MAN says that 2 is the multiuser stage. Should the oracle
    startup script be appened at the end of /sbin/rc2.

    C:\>pwd
    /export/home/oracle/oracle817/bin
    C:\>ls -l dbs*
    -rwxr-xr-x 1 oracle oinstall 2490 Aug 12 2000 dbshut
    -rwsr-s--- 1 root oinstall 1480880 Jul 22 04:24 dbsnmp
    -rwxr-xr-x 1 oracle oinstall 1420932 Dec 27 2000 dbsnmpO
    -rwxr-xr-x 1 oracle oinstall 4081 Aug 12 2000 dbstart
    C:\>

    Can someone help, please. Also where can I find the different
    boot steps involved in Solaris.

    Thanks,
    gopi

  2. #2
    Join Date
    Mar 2001
    Posts
    635
    Hi

    Do not add a script to the rc files goto the followind directory and create a link using ln command to dbstart to start the database automatically

    /sbin/rc2.d

    In the above directory create a link with the filename as follows

    S100dbstart

    The S is used to execute during system startup and the no 100 is it the file exeuction is in sequence for ex 1,2,3...100

    and for the database shutdown during th system shutdown create a link to dbshut in the following directory

    /sbin/rc0.d

    K100dbshut

    The K files are executed during system shutdown and the sequence is followed the same as the above.

    The above scripts automatically read /etc/oratab file

    Regards

    Santosh

  3. #3
    Join Date
    Jun 2001
    Posts
    20

    Angry Startup fails

    Hi Santosh,

    Here is what I did after reading ur reply.

    I made a link S100dbstart of $ORACLE_HOME/bin/dbstart
    in /etc/rc2.d folder.

    I made a link K100dbshut of $ORACLE_HOME/bin/dbshut
    in /etc/rc0.d folder.

    I also made a link /etc/oratab of /var/opt/oracle/EDM/oratab.

    When I rebooted, this is the error I get.

    Usually, after loggin in as "oracle", and specifying as "connect
    internal" from SVRMGRL, it goes thru fine.

    When I rebooted, this is the error that I got. Looks like the
    startup sequence is trying to start Oracle as someone else.

    SVRMGR> connect internal
    Password:
    ORA-01031: insufficient privileges
    SVRMGR>

    Do u know how to get the error messages that get generated
    while the system boots. In NT we normally check the event viewer. If there is a way to view the log files, then I can email
    u the log file itself


    [Edited by grajee on 07-28-2001 at 06:33 PM]
    Thanks,
    gopi

  4. #4
    Join Date
    Jun 2001
    Posts
    20

    Angry I tried this too

    Hi Santosh,

    THis is what I did after loggin in as root. Otherwise,
    if I log in as oracle, I dont have the permission to
    create files in the system folders.

    [1] I created a file called /etc/init.d/oracle with the contents
    #!/sbin/sh
    ORACLE_HOME=/export/home/oracle/oracle817
    ORACLE_BASE=/export/home/oracle
    ORACLE_SID=EDM

    echo $ORACLE_HOME
    echo "Entered init.d oracle script "
    case $1 in
    start)
    su - oracle -c /export/home/oracle/oracle817/bin/dbstart
    su - oracle -c "/export/home/oracle/oracle817/bin/lsnrctl start"

    exit 0
    ;;

    stop)
    su - oracle -c "$ORACLE_HOME/bin/lsnrctl stop"
    su - oracle -c $ORACLE_HOME/bin/dbshut
    ;;
    esac

    echo "End of the oracle script - gopi"

    [2] ln -s /etc/init.d/oracle /etc/rc2.d/S98oracle. Here is a listing
    of the folder.
    C:\>ls -l S9*
    -rwxr--r-- 5 root sys 1131 Feb 23 09:19 S90wbem
    -rwxr--r-- 5 root sys 391 Jan 5 2000 S92volmgt
    -rwxr--r-- 2 root sys 364 Jan 5 2000 S93cacheos.finish
    -rwxr--r-- 5 root sys 1181 Jan 5 2000 S94ncalogd
    -rwxr--r-- 5 root sys 522 Dec 22 2000 S95ncad
    lrwxrwxrwx 1 root root 16 Jul 13 20:25 S96ab2mgr -> ../init.d/ab2mgr
    lrwxrwxrwx 1 root other 18 Jul 30 00:53 S98oracle -> /etc/init.d/oracle
    -rwxr--r-- 5 root sys 447 Jan 5 2000 S99audit
    -rwxr--r-- 5 root sys 2804 Dec 2 1999 S99dtlogin
    C:\>

    [3] ln -s /var/opt/oracle/oratab /etc/oratab

    [4] I rebooted and expected oracle to start. But oracle fails to
    start.

    I dont know in which folder the solaris OS writes the messages.
    I do see this line "Entered init.d oracle script " on the screen
    but I dont think it is sucessfully executing the dbstart since
    I dont see "End of the oracle script - gopi".

    Any help ? I have ran out of ideas !!

    Thanks,
    gopi
    Thanks,
    gopi

  5. #5
    Join Date
    May 2001
    Location
    Dallas Texas
    Posts
    8
    Solaris puts system messages in /var/adm/messages. What is logged there is controlled by /etc/syslog.conf

    The output from your script will not get logged anywhere unless you direct it. For example, define a logfile as LOG=/tmp/start.log
    and then for each command redirect standard out to the log as in
    /usr/local/bin/doit.script > $LOG
    Standard error (error messages) can also be redirected by adding a 2>&1 to the end as in
    /usr/local/bin/doit.script > $LOG 2>&1

    Hope this helps a little

  6. #6
    Join Date
    Mar 2001
    Posts
    635
    Hi Gopi,

    First thing is just exexute the scripts when the system is on and see weather it is able to start and shutdown the databases. Make sure that the scripts are doing the tasks they are supposed to do.

    Regards
    Santosh

  7. #7
    Join Date
    Jun 2001
    Posts
    20

    The script works fine as it is

    I executed the script manually by running the following

    su - oracle -c /export/home/oracle/oracle817/bin/dbstart

    and it works fine.
    Thanks,
    gopi

  8. #8
    Join Date
    Mar 2001
    Posts
    635
    Hi Gopi,

    Try this

    Copy your dbstart,dbshut scripts into /sbin/init.d

    and then create a link the same way you did earlier but now to these files. Let me know how it goes

    Regards
    Santosh

  9. #9
    Join Date
    Jun 2001
    Posts
    20

    Automatic startup

    Hi All,

    Why is the dbstart script which is included in the oracle file
    starting a OpenWindows session. I guess this is the reason why oracle fails to startup.

    Thanks,
    gopi

    C:\>pwd
    /etc/init.d

    C:\>ls -l oracle
    -rw-r--r-- 1 root other 76 Aug 1 12:54 oracle

    C:\>cat oracle
    su - oracle -c /export/home/oracle/oracle817/bin/dbstart > /var/adm/oramess
    C:\>


    C:\>ls -l S99*
    -rwxr--r-- 5 root sys 447 Jan 5 2000 S99audit
    -rwxr--r-- 5 root sys 2804 Dec 2 1999 S99dtlogin
    lrwxrwxrwx 1 root other 18 Aug 1 13:13 S99oracle -> /etc/init.d/oracle
    C:\>

    C:\>pwd
    /var/adm
    C:\>ls -l oramess
    -rw-r--r-- 1 root root 120 Aug 1 13:00 oramess
    C:\>cat oramess
    Sun Microsystems Inc. SunOS 5.8 Generic February 2000

    Starting OpenWindows in 5 seconds (type Control-C to interrupt)

    C:\>
    Thanks,
    gopi

  10. #10
    Join Date
    Feb 2000
    Location
    New York,U.S.A.
    Posts
    245
    grajee, did you setup your env in your dbstart file? Like you said, you could mannually start the db with the script, but not the autostart, I think the difference here is the env. Try and see if it works.

    Dragon

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