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
阅读(3723) | 评论(0) | 转发(0) |