kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

shared memory realm does not exist? #157

Closed ojbucao closed 7 years ago

ojbucao commented 7 years ago

I'm getting this error and is unable to connect:

OCIError: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86 Error: 2: No such file or directory
from oci8.c:694:in oci8lib_210.bundle
...

I'm trying to connect to a remote db on the server. my OS is El capitan. remote Oracle version is 12c. I'm using the ruby-oci8 version 2.2.2 (also tried the latest version) I have the 12c instantclient files under /opt/oracle/instantclient client library is version 12.1.0.2.0

the following is in .bash_profile:

export PATH=$PATH:/opt/oracle/instantclient
export ORACLE_HOME=/opt/oracle/instantclient
export DYLD_LIBRARY_PATH=/opt/oracle/instantclient
export LD_LIBRARY_PATH=/opt/oracle/instantclient
export TNS_ADMIN=/opt/oracle/instantclient/network/admin
export OCI_DIR=/opt/oracle/instantclient
export CLASSPATH=$CLASSPATH:$ORACLE_HOME

I have a tnsnames.ora file under $TNS_ADMIN

sqlplus works on the terminal. I'm able to connect to the same database using the tnsnames.ora definitions.

However i get the above error when I'm in rails using ruby-oci8.

Any help resolving this is greatly appreciated.

ojbucao commented 7 years ago

Nevermind. It was an issue with my connection string format. O_o