Chinaunix首页 | 论坛 | 博客
  • 博客访问: 10464298
  • 博文数量: 2905
  • 博客积分: 20098
  • 博客等级: 上将
  • 技术积分: 36298
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-23 05:00
文章存档

2012年(1)

2011年(3)

2009年(2901)

分类: LINUX

2009-07-16 17:38:37

1.建立启动文件:
#cd /etc/rc.d/init.d
#touch oracle10g
 
2.为脚本设置权限:
#chmod 755 oracle10g
 
3  编辑脚本:
#vi oracle10g
 
内容如下:

#!/bin/bash
#
# chkconfig: 1235 99 01
# description: init script to start/stop oracle database 10g, TNS listener, EMS, isqlplus
#
#
#
# match these values to your environment:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle
# export ORACLE_TERM=xterm
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
export NLS_LANG='AMERICAN_AMERICA.UTF8'
export ORACLE_SID=db
# export DISPLAY=localhost:0
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
su - "$ORACLE_USER"<lsnrctl start
sqlplus /nolog<connect / as sysdba
startup
EOS
emctl start dbconsole
isqlplusctl start
EOO
;;
stop)
su - "$ORACLE_USER"<lsnrctl stop
sqlplus /nolog<connect / as sysdba
shutdown immediate
EOS
emctl stop dbconsole
isqlplusctl stop
EOO
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac
 
说明:chkconfig:1235     99 01 是指脚本将为运行级1 ,  2,  3,   5启动oracle 10g服务,启动优先级为99,关闭优先级为01
 
4.设置oracle 数据库的自启动"
#chkconfig --level 1235 oracle10g on
 
5.使用sevice启动oracle 数据库:
#service oracle10g start 如果能够启动,说明配置成功
#service oracle10g stop 停止数据库
 
OK !一切完成!望大家多多支持!

本文出自 “菜鸟网络工程师” 博客,谢绝转载!

阅读(1927) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~