- 论坛徽章:
- 0
|
安装oracle 集群日志总是显示:
ttytype: couldn't open /dev/tty for reading
stty: : Not a typewriter
请问这个错误对应的脚本是哪一段呢: 感谢!!!!
function monitor_listener
{
su - oracle -c "${ORACLE_HOME}/bin/lsnrctl status
${ORACLE_LISTENER_NAME}" > /dev/null
if [ $? = 0 ]
then
MONITOR_PROCESSES_PID=`ps -fu oracle | grep tnslsnr | awk '{ print $2 }'`
print "Monitored process = tnslsnr, pid = ${MONITOR_PROCESSES_PID}" >> ${LOG_FILE}
return 0
fi
su - oracle -c "${ORACLE_HOME}/bin/lsnrctl start
${ORACLE_LISTENER_NAME}" > /dev/null
if [ $? = 0 ]
then
MONITOR_PROCESSES_PID=`ps -fu oracle | grep tnslsnr | awk '{ print $2 }'`
print "Monitored process = tnslsnr, pid = ${MONITOR_PROCESSES_PID}" >> ${LOG_FILE}
print "\n *** listener has restarted. ***" >> ${LOG_FILE}
return 0
fi
print "\n *** listener has failed. Aborting Oracle. ***" >> ${LOG_FILE}
return 1
}
function monitor_processes
{
typeset -i n=0
for i in ${MONITOR_PROCESSES[@]}
do
MONITOR_PROCESSES_PID[$n]=`ps -fu oracle | awk '/'${i}$'/ { print $2 }'`
#JAGad06432
print "Monitored process = ${i}, pid = ${MONITOR_PROCESSES_PID[$n]}"
if [[ ${MONITOR_PROCESSES_PID[$n]} = "" ]]
then
print "\n\n"
ps -ef
print "\n *** ${i} has failed at startup time. Aborting Oracle.***"
set -m
nohup ${0} fault & # The script calls itself with the fault option.
set +m
sleep 999999
fi
(( n = n + 1 ))
done
sleep ${MONITOR_INTERVAL}
while true
do
for i in ${MONITOR_PROCESSES_PID[@]}
do
kill -s 0 ${i} > /dev/null
if [[ $? != 0 ]]
then
print "\n\n"
ps -ef
print "\n *** ${i} has failed. Aborting Oracle. ***"
set -m
nohup ${0} fault & # The script calls itself with the fault
option.
set +m
sleep 999999
fi
done
monitor_listener
if [ $? = 1 ]
then
print "\n Listener has failed. Aborting Oracle. ***"
set -m
nohup ${0} fault & # The script calls itself with the fault
option.
set +m
sleep 999999
fi
sleep ${MONITOR_INTERVAL}
done
}
function monitor_processes2
{
while true
do
su oracle -c "${ORACLE_HOME}/bin/sqlplus corpring/corpring" <<EOF
WHENEVER SQLERROR EXIT 1
select 'success' from dual;
exit
EOF
if [[ $? != 0 ]]
then
print "Connect to oracle failed."
set -m
nohup ${0} fault & # The script calls itself with the fault option.
set +m
sleep 999999
else
print "Connected to oracle."
fi
sleep ${MONITOR2_INTERVAL}
done
}
###############################################################################
# Function: halt_package
#
# Because there is no move command in MC/Serviceguard, the package must first
# be halted, disabled from running on the host, and then enabled to run in the
# cluster.
###############################################################################
function halt_package
{
cmhaltpkg ${PACKAGE_NAME}
cmmodpkg -d -n ${HOST} ${PACKAGE_NAME}
sleep 1
cmmodpkg -e ${PACKAGE_NAME}
}
###############################################################################
# MAIN
#
# Check the command-line option and take the appropriate action.
###############################################################################
print "\n *** $0 called with $1 argument. ***\n"
case $1 in
fault)
halt_package
;;
kill)
kill_hung_processes
;;
monitor)
monitor_processes
;;
monitor2)
monitor_processes2
;;
start)
print "\n \"${HOST}\": Starting Oracle SESSION $SID_NAME at ${DATE}"
oracle_run_cmds
;;
halt)
print "\n \"${HOST}\": Aborting Oracle SESSION $SID_NAME at ${DATE}"
oracle_abort_cmds
;;
shutdown)
print "\n \"${HOST}\": Shutting down Oracle SESSION $SID_NAME at ${DATE} "
oracle_shutdown_cmds
;;
*)
print "Usage: ${0} [ shutdown | halt | start | monitor ]"
;;
esac |
|