bash 设置LD_BIND_NOW变量解决TNS Linux Error: 29: Illegal seek error
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15807077/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Set LD_BIND_NOW variable to solve TNS Linux Error: 29: Illegal seek error
提问by chaitanya
I faced issue while starting TNS Listener for my Oracle XE DB on my Linux box using bash shell:
我在使用 bash shell 在我的 Linux 机器上为我的 Oracle XE DB 启动 TNS 侦听器时遇到了问题:
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
I tried a lot with different solutions given in internet and finally the issue got solved after referring to post - https://dba.stackexchange.com/questions/23308/linux-error-29-illegal-seek-in-lsnrctl-for-linux-version-11-2
我尝试了很多互联网上给出的不同解决方案,最后在参考帖子后问题得到解决 - https://dba.stackexchange.com/questions/23308/linux-error-29-illegal-seek-in-lsnrctl-for -linux-version-11-2
The solution for my case is:
我的情况的解决方案是:
export LD_BIND_NOW=1
I have installed Oracle XE DB in multiple Linux boxes but I faced this issue with only 1 box. What is this variable and how it solves Illegal seek issue?
我已经在多个 Linux 机器中安装了 Oracle XE DB,但我只用 1 个机器就遇到了这个问题。这个变量是什么以及它如何解决非法搜索问题?
My Linux box details are:
我的 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
回答by Muthuveerappan
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.
控制动态加载器的操作
动态加载器将响应一系列环境变量。其中大多数对 ldd 比对普通用户更有用,并且可以通过使用各种开关运行 ldd 来最方便地进行设置。它们包括
LD_BIND_NOW --- 通常,函数在被调用之前不会在库中“查找”。设置此标志会导致在加载库时发生所有查找,从而导致启动时间变慢。当您要测试程序以确保所有内容都已链接时,它很有用。
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
简单来说 - 如果 LD_BIND_NOW 变量设置为 1,在 C、C++ 中它会导致延迟加载库(即在需要时加载库)或在使用时 - 而不是在启动期间加载
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...!
可能在你的情况下,它是一个启动问题,这个库从未使用过......!
回答by wget
Today I experienced the same issue. The problem appears to be a bug inside the binary tnslsnrexecutable.
今天我遇到了同样的问题。问题似乎是二进制tnslsnr可执行文件中的错误。
The solution I had was to change the hostname to an IP address in the listener.ora situated in /oracle/product/11.2.0/xe/network/admin/listener.ora
我的解决方案是将主机名更改为位于 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)
Tweaking the file /etc/hostsand overriding the localhost statement, like described in other answers, does not work.
调整文件/etc/hosts并覆盖 localhost 语句(如其他答案中所述)不起作用。
I don't know if using IP addresses instead of hostname is recommended but, for me, it does the trick.
我不知道是否建议使用 IP 地址而不是主机名,但对我来说,它确实有效。
回答by dilip
Include in /etc/hostsfile the following line:
在/etc/hosts文件中包含以下行:
127.0.0.1 localhost.localdomain localhost

