Chinaunix首页 | 论坛 | 博客
  • 博客访问: 218966
  • 博文数量: 28
  • 博客积分: 398
  • 博客等级: 一等列兵
  • 技术积分: 1109
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-07 22:28
文章分类
文章存档

2017年(1)

2014年(3)

2013年(7)

2012年(4)

2011年(13)

分类: Oracle

2013-05-02 13:36:56

oracle11g 多实例启动问题:
当oracle11g创建多个实例,想指定启动哪些实例,发现通过设置 ORACLE_SID,
在/etc/.bash_profile文件中,怎么修改都是启动默认的orcl实例,
后来查看 /u01/app/oracle/product/11.2.0/bin/dbstart脚本,才发现原来启动
时扫描: ORATAB=/etc/oratab文件,
283 cat $ORATAB | while read LINE
284 do
285 case $LINE in
后来查看/etc/oratab文件:
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
orcl:/u01/app/oracle/product/11.2.0:N
work:/u01/app/oracle/product/11.2.0:N
super:/u01/app/oracle/product/11.2.0:Y
其实修改这里就可以了,将N改成Y即可启动当前实例。
然后创建一个脚本:/etc/init.d/oracle11g 
# !/bin/bash
# whoami
# root
# chkconfig: 345 51 49
# /etc/init.d/oracle11g
# description: starts the oracle datebase deamons
#


ORACLE_HOME=/u01/app/oracle/product/11.2.0
ORA_OWNER=oracle


case "$1" in
start)
echo -n "Starting oracle11g: "
su - $ORA_OWNER -c "$ORACLE_HOME/bin/dbstart ${ORACLE_HOME}" &
su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start "
touch /var/lock/subsys/oracle11g
echo
;;


stop)
echo -n "shutting down oracle11g: "
su - $ORA_OWNER -c "$ORACLE_HOME/bin/dbshut ${ORACLE_HOME}" &
su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
rm -f /var/lock/subsys/oracle11g
echo
;;


restart)
echo -n "restarting oracle11g: "
$0 stop
$0 start
echo
;;
*)
echo "Usage: `basename $0` start|stop|restart"
exit 1


esac
exit 0
启动/停止服务
#service oracle11g start
#service oracle11g stop
#service oracle11g restart

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