RE: [suse-oracle] Help with Scripts

From: Martin Dohse (dohse@werum.de)
Date: Mon Sep 08 2003 - 11:06:00 CEST


From: "Martin Dohse" <dohse@werum.de>
Date: Mon, 8 Sep 2003 11:06:00 +0200
Message-ID: <002201c375e8$6c8f50e0$b86514ac@werum.net>
Subject: RE: [suse-oracle] Help with Scripts

I do prefer running my own configuration scripts. You can run some init scripts at boot time, like oracle_Boot, oracle_Agent, oracle_Listener, oracle_DB or whatever kind of name you like. Just take care to start the oracle_Boot script before any other oracle scripts.

#!/bin/sh
# /etc/init.d/oracle_Boot

# file handles
echo "65536" > /proc/sys/fs/file-max

# shared memory
echo "2147483647" > /proc/sys/kernel/shmmax
echo "2097152" > /proc/sys/kernel/shmall
echo "4096" > /proc/sys/kernel/shmmni
 
# semaphores
echo "100 32000 100 100" > /proc/sys/kernel/sem

#eof

---------

the next scripts suggest taking OFA compliant parameters (here running 9i)

# /etc/oracle_env
# Oracle vars
ORACLE_BASE=/<mount point>/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/9.2.0
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib:/usr/X11R6/lib:$LD_LIBRARY_PATH
PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_BASE
export ORACLE_HOME
export LD_LIBRARY_PATH
export PATH

#eof

----
#!/bin/sh
# /etc/init.d/oracle_Agent
. /etc/oracle_env
case $1 in
'start')
 
        echo "Starting Oracle Agent 9.2.0 ..."
        su oracle -c "$ORACLE_HOME/bin/agentctl start"
        ;;
 
'stop')
        echo "Stopping Oracle Agent 9.2.0 ..."
        su oracle -c "$ORACLE_HOME/bin/agentctl stop"
        ;;
*)
        echo "usage: $0 {start|stop}"
        ;;
esac
#eof
----
#!/bin/sh
# /etc/init.d/oracle_Listener
. /etc/oracle.env
 
case "$1" in 
    start)
        echo "Start Oracle Listener"
        su -c "$ORACLE_HOME/bin/lsnrctl start" oracle
        ;;
 
    stop)
        echo "Stop Oracle Listener"
        su -c "$ORACLE_HOME/bin/lsnrctl stop" oracle
        ;;
 
    status)
        echo "Oracle Listener Status:"
        su -c "$ORACLE_HOME/bin/lsnrctl status" oracle
        ;;
    *)
        echo "usage: "$0" {start|stop|status}"
        ;;
esac
 
# eof
----
#!/bin/sh
# /etc/init.d/oracle_DB
. /etc/oracle.env
 
case "$1" in
   start) 
        echo "Start Oracle Database"
        su -c "$ORACLE_HOME/bin/dbstart" oracle
        ;;
   stop)
        echo "shutdown Oracle Database"
        su -c "$ORACLE_HOME/bin/dbshut_immediate" oracle
        ;;
   *)
        echo "usage: "$0" {start|stop}"
        ;;
esac
# eof
The oracle shutdown script $ORACLE_HOME/bin/dbshut just does a "normal" shutdown. Therefor I modified it adding the shutdown paramenter "immediate" within the script to have a clean but much faster shutdown.
Last but not least you should add '. /etc/oracle_env' to the oracle user profile. And don't forget to set ORACLE_SID.
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: suse-oracle-unsubscribe@suse.com
For additional commands, e-mail: suse-oracle-help@suse.com
Please see http://www.suse.com/oracle/ before posting


This archive was generated by hypermail 2.1.7 : Mon Sep 08 2003 - 11:06:22 CEST