我将编辑原始帖子,因为现在我们正在分解原始问题,我什至也必须扭曲原始问题。至于现在加入的人。在 Oracle EL6 中配置多个 oracle 实例/侦听器以自动启动时遇到问题。我正在使用以下脚本来处理启动:
#!/bin/sh
# chkconfig 345 99 10
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export ORACLE_OWNER=oracle
if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" &
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start TEST.LOCALHOST" &
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start CAPEX" &
touch /var/lock/subsys/dbora
;;
'stop')
# Stop the Oracle databases:
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop TEST.LOCAHOST"
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop CAPEX"
rm -f /var/lock/subsys/dbora
;;
esac
该文件位于 /etc/init.d/ 文件夹下。该文件本身称为 dbora。我还使用 chkconfig --add 将其添加到启动中。它的状态也就是 chkconfig --list 的输出如下:
[root@localhost ~]# chkconfig --list
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off
abrt-ccpp 0:off 1:off 2:off 3:on 4:off 5:on 6:off
abrt-oops 0:off 1:off 2:off 3:on 4:off 5:on 6:off
abrtd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off
atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
blk-availability 0:off 1:on 2:on 3:on 4:on 5:on 6:off
bluetooth 0:off 1:off 2:off 3:on 4:on 5:on 6:off
certmonger 0:off 1:off 2:off 3:on 4:on 5:on 6:off
cgconfig 0:off 1:off 2:off 3:off 4:off 5:off 6:off
cgred 0:off 1:off 2:off 3:off 4:off 5:off 6:off
cpuspeed 0:off 1:on 2:on 3:on 4:on 5:on 6:off
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
cups 0:off 1:off 2:on 3:on 4:on 5:on 6:off
dbora 0:off 1:off 2:off 3:on 4:on 5:on 6:off
dnsmasq 0:off 1:off 2:off 3:off 4:off 5:off 6:off
firstboot 0:off 1:off 2:off 3:off 4:off 5:off 6:off
haldaemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off
htcacheclean 0:off 1:off 2:off 3:off 4:off 5:off 6:off
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ip6tables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
irqbalance 0:off 1:off 2:off 3:on 4:on 5:on 6:off
kdump 0:off 1:off 2:off 3:off 4:off 5:off 6:off
lvm2-monitor 0:off 1:on 2:on 3:on 4:on 5:on 6:off
mcelogd 0:off 1:off 2:off 3:on 4:off 5:off 6:off
mdmonitor 0:off 1:off 2:on 3:on 4:on 5:on 6:off
messagebus 0:off 1:off 2:on 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ntpdate 0:off 1:off 2:off 3:off 4:off 5:off 6:off
numad 0:off 1:off 2:off 3:off 4:off 5:off 6:off
oddjobd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
portreserve 0:off 1:off 2:on 3:on 4:on 5:on 6:off
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
psacct 0:off 1:off 2:off 3:off 4:off 5:off 6:off
quota_nld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
restorecond 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rhnsd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rngd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rpcbind 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rpcgssd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
rpcsvcgssd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
smartd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
spice-vdagentd 0:off 1:off 2:off 3:off 4:off 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sssd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
svnserve 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sysstat 0:off 1:on 2:on 3:on 4:on 5:on 6:off
udev-post 0:off 1:on 2:on 3:on 4:on 5:on 6:off
vmware-tools 0:off 1:off 2:on 3:on 4:on 5:on 6:off
vmware-tools-thinprint 0:off 1:off 2:on 3:on 4:on 5:on 6:off
wdaemon 0:off 1:off 2:off 3:off 4:off 5:off 6:off
winbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
wpa_supplicant 0:off 1:off 2:off 3:off 4:off 5:off 6:off
xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
ypbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
xinetd based services:
chargen-dgram: off
chargen-stream: off
daytime-dgram: off
daytime-stream: off
discard-dgram: off
discard-stream: off
echo-dgram: off
echo-stream: off
rsync: off
tcpmux-server: off
time-dgram: off
time-stream: off
重新启动系统后,我检查了两个侦听器的日志文件,其中现在包含以下条目:
For CAPEX listener:
<msg time='2013-12-17T14:16:44.440+01:00' org_id='oracle' comp_id='tnslsnr'
type='UNKNOWN' level='16' host_id='localhost.localdomain'
host_addr='::1'>
<txt>17-DEC-2013 14:16:44 * service_update * CAPEX * 0</txt>
</msg>
For TEST.LOCALOHOST listener:
<msg time='2013-12-17T14:16:46.880+01:00' org_id='oracle' comp_id='tnslsnr'
type='UNKNOWN' level='16' host_id='localhost.localdomain'
host_addr='::1'>
<txt>17-DEC-2013 14:16:46 * service_update * TEST * 0</txt>
</msg>
我还尝试通过执行以下命令检查侦听器是否正在运行(因为我发现它们都没有实际运行):
[root@localhost ~]# ps -ef | grep tnslsnr | grep -v grep
[root@localhost ~]#
当我还尝试检查实际的数据库实例是否正在运行时,我还发现它们处于空闲状态,这对我来说意味着没有运行。也许现在你知道发生了什么,我搞砸了什么。
谢谢,乔