- 论坛徽章:
- 0
|
1.我在 etc/init.d下创建ora10,脚本如下:
#!/sbin/sh
#
# chkconfig: 35 95 1
# description: init script to start/stop oracle database 10g, TNS listener, EMS
#
#
# match these values to your environment:
export ORACLE_BASE=/export/home/app/oracle
export ORACLE_HOME=$ORACLE_BASE/OraHome-1
export ORACLE_SID=pjzx10g
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin PATH
export DISPLAY=localhost:0
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
echo -n "Starting Oracle Databases: "
su - "$ORACLE_USER"<
sqlplus /nolog<
connect / as sysdba
startup
EOS
echo -n "Starting Oracle Listeners: "
snrctl start
echo "Done."
echo "Starting Oracle enterprise manager console: "
emctl start dbconsole
echo "Done."
EOO
;;
stop)
echo "Shutting Down Oracle Databases: "
su - "$ORACLE_USER"<
sqlplus /nolog<
connect / as sysdba
shutdown immediate
EOS
echo -n "Shutting Down Oracle Listeners: "
#lsnrctl stop
echo "Done."
echo "Shutting Down enterprise manager console: "
emctl stop dbconsole
echo "Done."
EOO
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
2. 作连接
#ln -s /etc/init.d/ora10 /etc/rc2.d/S99dbora
#ln -s /etc/init.d/ora10 /etc/rc0.d/K10dbora
3.重新启动后还是不能自动启动,请各位大虾帮我看看,谢谢啦!!! |
|