ASM and ORACLE switching environments? - oracle

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.

Related

Error while loading shared libraries while running sqlplus

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

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

Why when i restart the shell, java is unavailable?

I have installed java 1.7 on my mac, and I have edited ~/.bash_profile as the following:
export JAVA_HOME=/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Content s/Home
export PATH=${JAVA_HOME}/bin:$PATH
When I execute source /.bash_profile, the java become available. But when I restart the shell, I got the following error message:
No Java runtime present, requesting install.
I have to re-execute source /.bash_profile to make it available.
I am so confused, hope someone can help me.
It is because variables you export are only valid in the current ssh session.
Look here for deeper explanation:
Mac OS X 10.9 - setting permanent environment variables
As #trojanfoe stated there:
The .bash_profile is only executed for a login-shell, whereas .bashrc
is executed for every new shell instance
Check this posting out please. I don't believe your problem is a JAVA problem but it looks rather misunderstanding on BASH side.

Stardog Command not found

I am trying to get to install stardog on mac 10.8.5 using the instructions provided at http://docs.stardog.com/quick-start/.
The export path particular directory has been created and for which echo’ed to make sure that environmental variable is set up. The license key that is provided is also in the correct directory. When I try to run “$ ./stardog-admin server start” the command is not recognized. So I tried to create an export PATH to stardog’s bin, which did not work either.
I have also tried manually adding the path in the following:
- ~/.bash_profile
- ~/.profile
Still no luck, any ideas?
Using zsh I had a similar problem. For some reason, the docs suggest that from the stardog-directory-name directory you can run the command, but it didn't work until you cd into the bin directory. Once there ./stardog-admin server start should run correctly.
It sounds like you simply have something incorrect in your .bash_profile or .profile. If you run either of the stardog scripts from it's bin directory, it will work. If you're getting a command not recognized error, that sounds like bash cannot find the stardog-admin script.

installing Oracle Instantclient on Mac OS/X without setting environment variables?

Oracle's instructions specify setting DYLD_LIBRARY_PATH. This makes my application dependent on random users' configuration and is very troublesome to set up.
How can I avoid having to set any environment variables?
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html
related note for linux: installing Oracle Instantclient on Linux without setting environment variables?
Oracle's instantclient installation instructions specify that the user set DYLD_LIBRARY_PATH. This is very troublesome to manage for multiple users.
To use the instantclient without setting any environment variables:
Download the instantclient distribution from oracle.com. For doing non-java software development, you will need (assuming Oracle 10.2):
instantclient-basic-macosx-10.2.0.4.0.zip
instantclient-sdk-macosx-10.2.0.4.0.zip
instantclient-sqlplus-macosx-10.2.0.4.0.zip
Unzip the three files. This will give you a directory
instantclient_10_2/
Copy the files to /usr, which is one of the default places the dynamic loader searches.
sudo cp instantclient_10_2/sdk/include/*.h /usr/include
sudo cp instantclient_10_2/sqlplus /usr/bin
sudo cp instantclient_10_2/*.dylib /usr/lib
If you use tnsnames.ora, copy it to /etc, which is the default global place the oracle runtime searches.
sudo cp tnsnames.ora /etc
Test with
/usr/bin/sqlplus scott/tiger#myoracle
If your goal is simply to run sqlplus on your MacBook, this might work for you. Remove the DYLD_LIBRARY_PATH environment variable from ~/.bashrc and replace it with an alias:
alias sqlplus="DYLD_LIBRARY_PATH=/Applications/instantclient_11_2 sqlplus"
Blog entry: sqlplus and DYLD_LIBRARY_PATH on Mac OS/X
After much research I found an sustainable solution to this error, that involves editing Apache's launchd configuration .plist file to specify the required DYLD_LIBRARY_PATH, ORACLE_HOME, and LD_LIBRARY_PATH environment variables.
You can view the full answer here: https://stackoverflow.com/a/20670810/1914455

Resources