===========================================================
AUTO START ORACLE ON LINUX(zt)
===========================================================
: zhouwf0726(http://zhouwf0726.itpub.net)
:2008.01.09 16:06
: oracle
http://zhouwf0726.itpub.net/post/9689/450619
---------------------------------------------------------------
:2008.01.09 16:06
: oracle
http://zhouwf0726.itpub.net/post/9689/450619
---------------------------------------------------------------
LINUXAUTO START ORACLE(һ)
1 user root ģ
[root@hpcmdb2 ~]# vi /etc/oratab
orc1:/opt/oracle/product/10.2.0/db_1:Y
NΪY
2 user oracle ģ
[root@hpcmdb2 init.d]# su - oracle
[oracle@hpcmdb2 ~]$ cd $ORACLE_HOME/bin
[oracle@hpcmdb2 ~]$ cd $ORACLE_HOME/bin
[oracle@hpcmdb2 bin]$ vi dbstart
ҵ ORACLE_HOME_LISTNER У ij:
ORACLE_HOME_LISTNER=/opt/oracle/product/10.2.0/db_1
ֱijɣ
ORACLE_HOME_LISTNER=$ORACLE_HOME
ͬ dbshut
[oracle@hpcmdb2 bin]$ vi dbshut
dbshut, dbstart ܷoracle listener
[oracle@hpcmdb2 bin]$ ps -efw | grep ora_
[oracle@hpcmdb2 bin]$ lsnrctl status
[oracle@hpcmdb2 bin]$ ps -efw | grep LISTEN | grep -v grep
л user root:
[root@hpcmdb2 init.d]# cd /etc/rc.d/init.d/
[root@hpcmdb2 init.d]# vi oracle10
#!/bin/bash
# chkconfig: 345 99 10
# description: Startup Script for Oracle Databases
# /etc/init.d/oracle10
export ORACLE_SID=orc1
# export ORACLE_HOME_LISTNER=/opt/oracle/product/10.2.0/db_1/bin/
export ORACLE_BASE=/opt
export ORACLE_HOME=/opt/oracle/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
case "$1" in
start)
su oracle -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle
echo "OK"
;;
stop)
echo -n "Shutdown Oracle: "
su oracle -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
echo "OK"
;;
*)
echo "Usage: 'basename $0' start|stop"
exit 1
esac
exit 0
# chkconfig: 345 99 10
# description: Startup Script for Oracle Databases
# /etc/init.d/oracle10
export ORACLE_SID=orc1
# export ORACLE_HOME_LISTNER=/opt/oracle/product/10.2.0/db_1/bin/
export ORACLE_BASE=/opt
export ORACLE_HOME=/opt/oracle/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
case "$1" in
start)
su oracle -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle
echo "OK"
;;
stop)
echo -n "Shutdown Oracle: "
su oracle -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
echo "OK"
;;
*)
echo "Usage: 'basename $0' start|stop"
exit 1
esac
exit 0
棬
Ȼͬ
chkconfig --add oracle10
chkconfig --list oracle10






