2007年(213)
分类: Oracle
2007-10-25 09:40:59
touch /etc/rc.d/init.d/oracle10
vi /etc/rc.d/init.d/oracle10
# !/bin/bash
# whoami
# root
# chkconfig: 345 51 49
# description: starts the oracle dabase deamons
#
ORA_HOME=/oracle/u01/app/oracle/product/10.2.0/db_1
ORA_OWNER=oracle
case "$1" in
start)
echo -n "Starting oracle10g: "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart" &
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c "$ORA_HOME/bin/export ORACLE_SID=orcl"
touch /var/lock/subsys/oracle10g
echo
;;
stop)
echo -n "shutdown oracle10g: "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut" &
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
rm -f /var/lock/subsys/oracle10g
"/etc/rc.d/init.d/oracle10" 39L, 703C 14,1 Top
# !/bin/bash
# whoami
# root
# chkconfig: 345 51 49
# description: starts the oracle dabase deamons
#
ORA_HOME=/oracle/u01/app/oracle/product/10.2.0/db_1
ORA_OWNER=oracle
case "$1" in
start)
echo -n "Starting oracle10g: "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart" &
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c "$ORA_HOME/bin/export ORACLE_SID=orcl"
touch /var/lock/subsys/oracle10g
echo
;;
stop)
echo -n "shutdown oracle10g: "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut" &
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
rm -f /var/lock/subsys/oracle10g
echo
;;
restart)
echo -n "restarting oracle10g: "
$0 stop
$0 start
echo
;;
*)
echo "usage: oracle10g "
exit 1
esac
exit 0
#su - oracle
$cd $ORACLE_HOME/bin
$vi dbstart
查找并修改ORACLE_HOME_LISTNER为如下值
ORACLE_HOME_LISTNER=/oracle/u01/app/oracle/product/10.2.0/db_1/
注意:/oracle是建立用来安装oracle的文件系统。
保存并退出。
#启动监听
lsnrctl start
#关闭监听
lsnrctl stop
#启动dbconsole服务
emctl start dbconsole
#停止dbconsole服务
emctl stop dbconsole
#启动或停止 iSQL*Plus:
isqlplusctl start | stop