7

我在使用 bash shell 在我的 Linux 机器上为我的 Oracle XE DB 启动 TNS Listener 时遇到了问题:

LSNRCTL> start
Starting /oracle/product/11.2.0/xe/bin/tnslsnr: please wait...

TNS-12537: TNS:connection closed
 TNS-12560: TNS:protocol adapter error
  TNS-00507: Connection closed
   Linux Error: 29: Illegal seek
LSNRCTL> exit

我在互联网上尝试了很多不同的解决方案,最后在参考帖子后问题得到了解决 - https://dba.stackexchange.com/questions/23308/linux-error-29-illegal-seek-in-lsnrctl-for -linux-version-11-2

我的情况的解决方案是:

export LD_BIND_NOW=1

我已经在多个 Linux 机器中安装了 Oracle XE DB,但我只有 1 个机器就遇到了这个问题。这个变量是什么以及它如何解决非法搜索问题?

我的 Linux 盒子详细信息是:

bash-4.1$ uname -a
Linux <hostname> 2.6.39-100.5.1.el6uek.x86_64 #1 SMP Tue Mar 6 20:26:00 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
4

3 回答 3

1

Controlling the operation of the dynamic loader

There are a range of environment variables that the dynamic loader will respond to. Most of these are more use to ldd than they are to the average user, and can most conveniently be set by running ldd with various switches. They include

LD_BIND_NOW --- normally, functions are not `looked up' in libraries until they are called. Setting this flag causes all the lookups to happen when the library is loaded, giving a slower startup time. It's useful when you want to test a program to make sure that everything is linked.

In simple terms - If LD_BIND_NOW variable is set to 1, in C, C++ it causes lazy load, of libraries (i.e load libraries when required) or when its used - instead of loading during startup

If the software operates in mixed mode, this is set too.

May be in your case, its a start up issue and this library was never used...!

于 2013-09-26T23:45:16.200 回答
1

今天我遇到了同样的问题。该问题似乎是二进制tnslsnr可执行文件中的错误。

我的解决方案是将主机名更改为位于 listener.ora 中的 IP 地址/oracle/product/11.2.0/xe/network/admin/listener.ora

# listener.ora Network Configuration File:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/product/11.2.0/xe)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)

如其他答案中所述,调整文件/etc/hosts并覆盖 localhost 语句不起作用。

我不知道是否建议使用 IP 地址而不是主机名,但对我来说,它确实有用。

于 2015-11-17T14:02:12.643 回答
0

/etc/hosts文件中包含以下行:

127.0.0.1 localhost.localdomain localhost
于 2015-08-05T12:03:39.723 回答