dbstart 报错 Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
来源:互联网 发布:网络七层协议及功能 编辑:程序博客网 时间:2024/06/17 13:02
Oracle自动启动(解决了Failed to auto-start Oracle Net Listene和Message 1053 not found错误)
前两天在linux里成功的安装了Oracle10G,每次启动oracle数据库都是用oracle用户登陆然后执行dbstart启动数据库。每次启动时都会报错
Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
看来是listener服务没有起来,但是执行lsnrctl start却能启动listener服务。
搜索dbstart文件中的tnslsnr字符串
grep tnslsnr dbstart
返回结果:
if [ -f $ORACLE_HOME_LISTNER/bin/tnslsnr ] ; then
echo "Failed to auto-start Oracle Net Listene using $ORACLE_HOME_LISTNER/bin/tnslsnr"
看来可能是ORACLE_HOME_LISTNER环境变量引起的,查找 ORACLE_HOME_LISTNER
grep ORACLE_HOME_LISTNER dbstart
返回结果
# 3) Set ORACLE_HOME_LISTNER
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
if [ ! $ORACLE_HOME_LISTNER ] ; then
echo "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener"
LOG=$ORACLE_HOME_LISTNER/listener.log
if [ -f $ORACLE_HOME_LISTNER/bin/tnslsnr ] ; then
$ORACLE_HOME_LISTNER/bin/lsnrctl start >> $LOG 2>&1 &
export VER10LIST=`$ORACLE_HOME_LISTNER/bin/lsnrctl version | grep "LSNRCTL for " | cut -d' ' -f5 | cut -d'.' -f1`
echo "Failed to auto-start Oracle Net Listene using $ORACLE_HOME_LISTNER/bin/tnslsnr"
$LOGMSG "Restart Oracle Net Listener using an alternate ORACLE_HOME_LISTNER: lsnrctl start"
其中有一段给ORACLE_HOME_LISTNER环境变量赋值,但是这个路径是不对的,编辑dbstart文件
vi dbstar
将该行改为export ORACLE_HOME_LISTNER=$ORACLE_HOME
保存退出,然后执行dbstart就没问题了。呵呵
想系统启动是自动启动数据库可以通过修改/etc/rc.d/rc.local文件
一开始我写的命令是
su oracle -c ora_App/product/10.2.0/db_1/bin/lsnrctl start
su oracle -c ora_App/product/10.2.0/db_1/bin/dbstart
但是su oracle -c ora_App/product/10.2.0/db_1/bin/lsnrctl start是参数start不起作用,它进入了lsnrctl命令提示符,并没有启动,后来把命令用双引号引起来就可以了如下:
su oracle -c "ora_App/product/10.2.0/db_1/bin/lsnrctl start"
是可以启动了,但是启动时报错如下:
Message 1053 not found; No message file for product=network, facility=TNSTNS-12541: Message 12541 not found; No message file for product=network, facility=TNS
TNS-12560: Message 12560 not found; No message file for product=network, facility=TNS
但是如果我用oracle用户登陆执行lsnrctl start就不报错,看来是在root用户中执行su oracle -c "ora_App/product/10.2.0/db_1/bin/lsnrctl start"有些Oracle环境变量没有设置。查了一下su 命令的参数,其中有个-l参数
-.-l或--login 改变身份时,也同时变更工作目录,以及HOME,SHELL,USER,LOGNAME。此外,也会变更PATH变量。
加上参数
su oracle -lc "ora_App/product/10.2.0/db_1/bin/lsnrctl start"
正常了!呵呵,终于弄完了。总算是一晚上没白费。
可以在/etc/init.d/下写一个shell,就叫oracle好了,内容如下:
#!/bin/sh
ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1
ORACLE=oracle
case $1 in
"start")
echo "start oracle ....."
su - oracle -c " $ORACLE_HOME/bin/dbstart $ORACLE_HOME &"
su - oracle -c" $ORACLE_HOME/bin/lsnrctl start ";;
"stop")
echo "stop oracle ....."
su - oracle -c " $ORACLE_HOME/bin/dbshut &"
su - oracle -c" $ORACLE_HOME/bin/lsnrctl stop ";;
*)
echo "usage: $0 {start|stop}"
exit
;;
esac
这个就可以控制oracle的启动和关闭。为了完成自启动,可以在/etc/rc3.d/(runlevel 是3,如果runlevel是5就在/etc/rc5.d/下)建立一个链接文件:ln -s /etc/init.d/oracle /etc/rc3.d/S98oracle。这样就可以完成自启动了。
- dbstart 报错 Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
- Oracle自动启动(解决了Failed to auto-start Oracle Net Listene和Message 1053 not found错误)
- RHEL 7 安装oracle rac 11.2.0.4执行root.sh报错ohasd failed to start
- 连接oracle报错“ORA-28547:connection to server failed,probable Oracle Net admin 解决办法
- 连接oracle报错“ORA-28547:connection to server failed,probable Oracle Net admin 解决办法
- 连接oracle报错“ORA-28547:connection to server failed,probable Oracle Net admin 解决办法
- 连接oracle报错“ORA-28547:connection to server failed,probable Oracle Net admin 解决办法
- 连接oracle报错“ORA-28547:connection to server failed,probable Oracle Net admin 解决办法
- navicat连接oracle报错ORA-28547:connection to server failed,probable Oracle Net admin error
- ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener解决方法
- Tomcat 报错:Failed to start Compenent
- Oracle TNSLSNR Full Client
- Oracle tnslsnr设置口令
- LINUX下AUTO START ORACLE
- Oracle 9中dbstart命令没有反应和报错的问题解决
- oracle安装错误:Could not execute auto check for display colors using command /usr/bin/xdpyinfo.
- Oracle 11gR2 RAC ohasd failed to start 解决方法
- Oracle 11gR2 RAC ohasd failed to start 解决方法
- 用.xsd (数据集)生成数据层(DAL)代码
- 2005年11月1日 歌曲:中产阶级
- 从Execl导入数据返回DataTable
- try...catch...finally java String 的用法
- 这段发c#邮件的代码怎么在自己机器上调试时怎么经常发送不了邮件啊
- dbstart 报错 Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
- contain remnants of that class
- 没事偷着乐!
- EGL RUI -- 游戏篇
- 2005年11月29日
- 我对 bo 的 优化
- 连接更新
- Oralce学习开始
- PHP中htmlentities和htmlspecialchars函数的区别