Monday, September 1, 2008

On Solaris 64 bit Rman fails with libclntsh.so.10.1, ld.so.1, Segmentation Fault (core dumped)

Problem Description and Solution Step by Step
1.
Whenever you try to connect to rman then it fails with ld.so.1: rman: fatal: libclntsh.so.10.1: open failed: No such file or directory like,
bash-3.00$ rman target /
ld.so.1: rman: fatal: libclntsh.so.10.1: open failed: No such file or directory
Killed

2.
But you browse the directory $ORACLE_HOME/lib32 and see libclntsh.so.10.1 is present and also has the correct permission on it.
bash-3.00$ ls -l $ORACLE_HOME/lib32/libclntsh.so.10.1
-rwxr-xr-x 1 oracle oinstall 24094536 Apr 17 12:35 /oracle/app/oracle/product/10.2.0/db_1/lib32/libclntsh.so.10.1

3.
The missing thing is your LD_LIBRARY_PATH is not set. So I have set it below on my bash shell. If you use another shell then use shell specific command to set the environmental variable. On C shell use setenv LD_LIBRARY_PATH=$ORACLE_HOME/lib32. If you are on windows machine then use
set LD_LIBRARY_PATH=$ORACLE_HOME\lib32
As I am on bash shell on solaris so I set it as,
bash-3.00$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib32

4.
Now try to connect rman and see it fails with rong ELF class: ELFCLASS32.
bash-3.00$ rman target /
ld.so.1: rman: fatal: /oracle/app/oracle/product/10.2.0/db_1/lib32/libclntsh.so.10.1: wrong ELF class: ELFCLASS32
Killed

5.
As my Solaris is 64 bit so I need to set LD_LIBRARY_PATH_64 environmental variable also.
bash-3.00$ export LD_LIBRARY_PATH_64=$ORACLE_HOME/lib

6.
You can easily avoid every time setting of these export or setenv or set command on your system each time by editing the profile or setting environmental variable on windows and make it permanent.

7.
On Solaris machine it is .profile
If you use linux bash shell then it is .bash_profile on home directory.

8.
I modified .profile file and added two lines in it like below
-bash-3.00$ vi .profile
export LD_LIBRARY_PATH=$ORACLE_HOME/lib32
export LD_LIBRARY_PATH_64=$ORACLE_HOME/lib


9.
To make the immediate affect of these changes use source command like,
-bash-3.00$ source .profile

10.
Now try to connect to your database.
bash-3.00$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Sep 2 02:25:13 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Segmentation Fault (core dumped)

11.
Oh, you still fails. However I restarted the server machine and try to connect to rman and then see errors goes away and connect to rman.
I did it

bash-3.00$ su -
Password:
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
# reboot

12.
Then after starting up I issued rman command.
bash-3.00$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Sep 2 03:46:31 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: ARJU (DBID=2871324595)

No comments:

Post a Comment