Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set LD_BIND_NOW variable to solve TNS Linux Error: 29: Illegal seek error

I faced issue while starting TNS Listener for my Oracle XE DB on my Linux box using bash shell:

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

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?

My Linux box details are:

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
like image 361
chaitanya Avatar asked Apr 04 '13 09:04

chaitanya


2 Answers

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...!

like image 60
Muthuveerappan Avatar answered Oct 21 '22 00:10

Muthuveerappan


Today I experienced the same issue. The problem appears to be a bug inside the binary tnslsnr executable.

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 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/hosts and overriding the localhost statement, like described in other answers, does not work.

I don't know if using IP addresses instead of hostname is recommended but, for me, it does the trick.

like image 20
wget Avatar answered Oct 21 '22 00:10

wget