Error while loading shared libraries while running sqlplus - oracle

I am trying to install and run sqlplus in my ubuntu machine. I get the above error
error while loading shared libraries: libclntsh.so.12.1: cannot open shared object file: No such file or directory
when I run
sudo sqlplus64 <user>/<pass>#//<ip>:<port>/db
despite following the steps mentioned in the oracle install client document https://help.ubuntu.com/community/Oracle%20Instant%20Client
I have correctly set ORACLE_HOME and LD_LIBRARY_PATH
My strace sqlplus /nolog output shows below error
write(2, "SP2-0667: Message file sp1<lang>"..., 47SP2-0667: Message file sp1<lang>.msb not found
) = 47
write(2, "SP2-0750: You may need to set OR"..., 76SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
) = 76
I can also attach complete strace if needed. Can someone help me fix the issue ?

Here is a shortened version of the process I use when installing the Oracle instant client on my machines:
1 - Get alien sudo apt-get install alien
2 - Download the Oracle Instant Client (Download basic, devel, and sqlplus)
3 - Use Alien to install the .rpm packages
sudo alien -i oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
sudo alien -i oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
sudo alien -i oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
4 - Navigate to the installation directory for sqlplus $ cd /usr/lib/oracle/12.X/client64/bin/
5 - Run sqlplus $ ./sqlplus and see if you get an error regarding libaio1
6 - You may need to install libaio1 ($ sudo apt-get install libaio1)
7 - If you are still getting module errors, try running ldd $ ldd sqlplus. Install what you need.
8 - Set the following environment variables
export ORACLE_HOME=/usr/lib/oracle/12.1/client64/
export PATH=$PATH:/usr/lib/oracle/12.1/client64/bin/
export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib/
You can set this for all users in /etc/bash.bashrc. A discussion of setting environment variables for one or many users for different types of shells is outside the realm of this question.
Good luck!

It looks variables are not set properly or there is no oracle client in folder where variables are set or it has no rights to execute.
Please do in terminal you're going to run sqlplus:
echo $ORACLE_HOME
echo $LD_LIBRARY_PATH
If they don't show correct values it means you haven't set variables properly (either export them before runing sqlplus or set them for each terminal session). If they show correct value please go to folder check if there are Oracle client files. If yes please check execution rights for files there (ls -la). If files have no grants to be open and execute pleaswe add it (chmod). If all three are ok client should work.

Alternatively Downloaded and installed sql developer from oracle from the link http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html

Related

Running Oracle NETCA/NETGMGR/DBCA on Docker for Windows

I am trying to run dbca/netca commands on docker.
I already have Oracle 12c installed on docker, but I keep running into a issue.
When I run the dbca command, I get the error:
DBCA cannot be run as root.
When I run the netca command, I get the error:
Oracle Net Configuration Assistant cannot be run as root.
When I run the netmgr command, I get the error:
Could not find the main class: oracle.net.mgr.container.NetApplication. Program will exit.
-netca/netmgr/dbca are all GUI tools managed by Oracle.
When I sudo su - oracle user, and I run the above commands, the docker/ system no longer even recognizes those commands.
See below:
oracle#6cc1eee63141:~$ dbca
-su: dbca: command not found
oracle#6cc1eee63141:~$ netca
-su: netca: command not found
oracle#6cc1eee63141:~$ netmgr
-su: netmgr: command not found
oracle#6cc1eee63141:~$ NETMGR
I have already exported my display to my computer IP address.
What am I doing wrong and how can I fix it?

Unable to execute cr9idata.pl

Oracle Database Home patches installed successfully
Executing cr9idata.pl
Executing: perl /u01/db/VIS/12.1.0/nls/data/old/cr9idata.pl
Unable to execute cr9idata.pl
RW-50010: Error: - script has returned an error: 2
RW-50004: Error code received when running external process. Check log file for details.
Running Database Install Driver for VIS instance
I executed command in terminal with root account:
[root#ntcs ~]# perl /u01/db/VIS/12.1.0/nls/data/old/cr9idata.pl
Directory /u01/db/VIS/12.1.0/nls/data/9idata already exist. Overwriting...
Copying files to /u01/db/VIS/12.1.0/nls/data/9idata...
Copy finished.
Please reset environment variable ORA_NLS10 to /u01/db/VIS/12.1.0/nls/data/9idata!
Thanks advanced for helping !
After serveral day debugging. I found the reason is my oracle user error.
I installed perl into /home/oracle/perl5...then make oracle user error.
I cannot su oracle from root user.
when i install perl for oracle user then .bashrc of oracle user auto add two routine line:
eval perl -I ~/perl5/lib/perl5 -Mlocal::lib
export MANPATH=$HOME/perl5/man:$MANPATH
I just remove above two lines above then i can su oracle from root user.
Conclusion:
When you install Oracle EBS 12.2.0 on CentOS 7.3. rapidwiz tool will su to oracle user automatically to install DB. But our oracle error cannot be su to so make error. But it show the symtom very strange so it is difficult to debug.
Now i install Oracle EBS 12.2 sucessfully !
I am very happy to share this to anyone meet this error.
I am installing EBS 12 at the moment.
Looking a bit deeper into the logs for the cr9idata.pl script, I saw that this error is caused by a missing Perl module. The Perl version that is installed with Oracle includes this library, so setting the path manually works in that case.
If you (like me) have installed Perl from YUM, install this module: perl-File-CheckTree

-bash: initdb: command not found

I have installed PostgreSQL using the EnterpriseDB installation.
I ran sudo ./postgresql-9.3.5-3-osx.app/Contents/MacOS/installbuilder.sh --mode unattended and then ran open /Applications/TextEdit.app .profile to edit my .profile file newly created in /Users/Dhruv to add the line source /Library/PostgreSQL/9.3/pg_env.sh.
Running createuser Dhruv --pwprompt --username=postgres I got
-bash: createuser: command not found
Then running unknown-88-1f-a1-1b-c2-ec:9.3 dhruv$ sudo -u postgres /bin/createuser and various other methods I was able to set up something using some sort of password prompt. I know this later because using sudo -u postgres /Library/PostgreSQL/9.3/bin/createuser I got
createuser: creation of new role failed: ERROR: role "postgres" already exists
Running then initdb -D /Library/PostgreSQL/9.3/data I get
-bash: initdb: command not found.
Similiarly, if I try the same thing but while connected to postgres, sudo su - postgres and then initdb -D /Library/PostgreSQL/9.3/data I get again
-bash: initdb: command not found.
At a loss at what to do. 1) how do I know details of this supposed role "postgres" I created magically and 2) why is initdb not working?
How I fixed this is run brew doctor, and you might see the postgresql un der the Warning: that indicates there's unlinked kegs in your Cellar.
Try to run brew link postgresql. It will show some symlinks got created. Then run init db ... again.
Hope this help!
Who are you logged in as?
When you do sudo or su -, it will run init scripts for root, such as .bashrc and .bash_profile.
These may set up difference executable search paths between root, postgres, and you.
Try something like sudo initdb, or su - postgres -c initdb ... whichever user has the paths constructed correctly, so that the path gets set up.
You could also duplicate the path/lib creation code in your own environment, but that will break if it is ever changed.
Same thing happened to me. I'm new to OS X coming from Linux, here's what I had to do. I installed postgres via homebrew and when I did so I noticed it put everything it download to: /usr/local/Cellar/postgresql/($postgres_version)/
When I cd'd into that folder I saw a directory named bin so I cd'd and saw initdb right there. So I had to then add this to my path so I could use the command:
$ export PATH=/usr/local/Cellar/postgresql/9.4.4/bin:$PATH
hope that helps you

ASM and ORACLE switching environments?

I've just installed ASM and try to change environment using this commands but its not working
1)Did you installed it properly? May be you missed something...
2)Check your .bash_profile file. It is a hidden file stored in oracle users’ home directory /home/oracle
3)You have a lot of mistakes try this
change root to oracle:
su - oracle
then try this commands
export ORACLE_SID=+ASM
export ORAENV_ASK=NO
. oraenv
and then check with this command: which sqlplus
If its not working reboot it.

Install Oracle 10.2 64bit on CentOS 5 64bit

I'm installing Oracle on 64 bit CentOS in silent mode. After the installation, it says:
WARNING:The following configuration
scripts
/opt/oracle/product/10.2.0/root.sh
need to be executed as root for
configuring the system.
But, when i execute root.sh as root, there're some errors. I found in the script it uses variables instead of plain command:
if [ ! -d /var/tmp/.oracle ]
then
**$MKDIR** -p /var/tmp/.oracle;
fi
**$CHMOD** 01777 /var/tmp/.oracle
**$CHOWN** root /var/tmp/.oracle
and these variables are not defined. I don't know why it uses variables instead of the command itself.
You are aware that oracle is not certified/supported on centos?

Resources