kubo / ruby-oci8

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

oci8lib_260.so: ORA-12154: TNS:could not resolve the connect identifier specified (OCIError) #219

Closed tiagobzr closed 4 years ago

tiagobzr commented 4 years ago

I'm getting: "oci8lib_260.so: ORA-12154: TNS:could not resolve the connect identifier specified (OCIError)" when trying to connect to a oracle DB.

ruby version: ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux]

oci8 version: 2.2.7

Wrote the connection string that way: conn = OCI8.new('user/password@//host.intranet:1521/SID')

Traceback (most recent call last): 3: from features/support/lib/database.rb:7:in <main>' 2: from features/support/lib/database.rb:7:innew' 1: from /home/tiagob/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/ruby-oci8-2.2.7/lib/oci8/oci8.rb:142:in `initialize' oci8.c:561:in oci8lib_260.so: ORA-12154: TNS:could not resolve the connect identifier specified (OCIError)

kubo commented 4 years ago

@tiagobzr This won't be a ruby-oci8 issue. Could you connect to the server with the connect string with sqlplus?

sqlplus user/password@//host.intranet:1521/SID
tiagobzr commented 4 years ago

You were right! After that I reviewed and got the right info. Thank you!