【发布时间】:2016-07-01 09:54:07
【问题描述】:
我需要配置远程服务器的 oracle 数据库以在系统启动时启动。 我关注了this tutorial,几乎和其他人一样。 我不允许重启服务器,只能建议所有者在服务器上做一些事情。
服务器配置与教程中所说的类似,但 oracle 数据库不会在系统启动时启动。这是/etc/dbora和/etc/init.d/oratab文件内容:
德博拉:
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/u01/app/oracle/product/11.2.0/db_1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
su $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start" &
su $ORA_OWNER -c $ORA_HOME/bin/dbstart &
touch /var/lock/subsys/dbora
;;
'stop')
su $ORA_OWNER -c $ORA_HOME/bin/dbshut
su $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
rm -f /var/lock/subsys/dbora
;;
esac
oratab:
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
orcl:/u01/app/oracle/product/11.2.0/db_1:Y
orcl:/u01/app/oracle/product/11.2.0/db_1:N
这些文件有什么问题?
【问题讨论】:
-
取决于服务器操作系统,您应该执行类似 chkconfig --add oracle (for centos / redhat / fedora) 之类的操作。请告诉我服务器操作系统
-
@NoelCarcases 服务器是Oracle Linux
-
同样... chkconfig --add oracle 或 chkconfig --level 2345 oracle on。让我知道它是否有效
-
@NoelCarcases 请看一下 oratab 的最后一行。是这个问题吗?
-
没有注意到...我认为你应该删除 orcl:/u01/app/oracle/product/11.2.0/db_1:N //这一行
标签: linux oracle startup configuration-files