Message 850 not found; No message file for product=network, facility=NL

 

用户juice登陆ssh 后切换用户 su oralce 使用命令启动 lsnrctl start  出现bash 不识别

查看环境变量

echo $PATH

/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/juice/bin

 

 

之后使用find / -name lsnrctl  查看lsnrctl  绝对路径  

 

          [root@dell juice]# find / -name lsnrctl 

          /opt/oracle/102/bin/lsnrctl

 

 

在目录下 启动 ./lsnrctl  

 

        [root@dell juice]# cd /opt/oracle/102/bin/

 

        [root@dell bin]# ./lsnrctl

 

        LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 30-APR-2014 01:18:15

 

        Copyright (c) 1991, 2009, Oracle.  All rights reserved.

 

        Message 850 not found; No message file for product=network, facility=NL

 

出现错误“  Message 850 not found; No message file for product=network, facility=NL

 看了一下 .bash_profile没有发现问题,于是source .bash_profile了一下,正常启动了oracle

 

 

[oracle@dell ~]$ lsnrctl status

 

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 30-APR-2014 01:47:15

 

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date                30-APR-2014 01:43:43

Uptime                    0 days 0 hr. 3 min. 31 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /opt/oracle/102/network/admin/listener.ora

Listener Log File         /opt/oracle/diag/tnslsnr/dell/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

The listener supports no services

 

The command completed successfully

===============================================================================================

想了一阵子之后明白了问题所在:用ssh登录服务器时用的是其它用户名,而切换至oracle时用的是su oracle而不是su - oracle,用su oracle时不会切换用户环境,也不会加载新用户的环境变量

 

在网上查了一下发现加不加这一个小横杠的区别大了:

 

 

 

 

Java代码   收藏代码
  1. su 是切换到其他用户,但是不切换环境变量(比如说那些你用export命令查看一下,就知道两个命令的区别了)  
  2. su - 是完整的切换到一个用户环境  

 

再贴点资料:

 

Java代码   收藏代码
  1. .bash_profile只在登陆的时候读取,在X下登陆打开一个console的话是不读取该文件的。如果你在字符模式下登陆输入用户和密码的话是读取的。如果在X下打开一个console要读取配置,就要写在.bashrc里面,而不是.bash_profile里面.   
  2.   
  3. 你可以在.bashrc里面加入:  
  4.   
  5. if test -f .bash_profile; then  
  6. . .bash_profile  
  7. fi  
  8.   
  9.   
  10. 这样.bash_profile里面内容变了就不需要再改.bashrc面的内容了.  
  11.   
  12. bash 登陆的时候读取配置文件的顺序如下:  
  13. .bash_profile  
  14. .bash_login  
  15. .profile  
  16.   
  17. 按这个顺序只要读到一个就不再读取其他的两个. 当然全局的/etc/profile是最先读的,/etc/profile里面的配置可以在以上三个文件中覆盖掉.  
  18.   
  19. 当bash不是作为登陆shell打开时,比如你先用csh登陆,然后再输入bash切换到bash ,那么只读取.bashrc  
  20. 里的内容.不读取.bash_profile  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值