wbsurfver-/E1597aS9LQAvxtiuMwx3w@public.gmane.org
2007-Nov-15 15:19 UTC
Problems connecting to remote Oracle DB on windows using active record
I am trying to connect to an older oracle DB remotely, I think version 8 or 9. I downloaded the instant client stuff from oracle and copied oci.dll and oraociei10.dll to my windows/system folder (windows XP) I get the error. C:\rb-play>ar_connect_ss.rb env.c:257:in oci8lib.so: ORA-12514: TNS:listener does not currently know of serv ice requested in connect descriptor (OCIError) from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:228:in `initialize'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/ active_recor d/connection_adapters/oracle_adapter.rb:585:in `new'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/ active_rec If I change the adapter to ''oracle'' I get C:\rb-play>ar_connect_ss.rb env.c:257:in oci8lib.so: ORA-12154: TNS:could not resolve the connect identifier specified (OCIError) from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:228:in `initialize'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/ active_recor d/connection_adapters/oracle_adapter.rb:585:in `new'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/ active_recor d/connection_adapters/oracle_adapter.rb:585:in `new_connection'' I''ve done a bunch of google searches on this. I read if I am using instant client I don''t need a tnsnames.ora file, which I''m not that familiar with that file anyway. Any ideas on this let me know, it has not been as easy as I''ve hoped for this. ################################### require ''active_record'' ActiveRecord::Base.establish_connection( :adapter => ''oci'', :database => ''mydb'', :host => ''pennies.dev.mycompany.com:1521/ENG'', :username => ''me'', :password => ''mypassword'' ) class Template < ActiveRecord::Base set_table_name ''template'' end rec = Template.find(:first) puts rec.TITLE --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Seemingly Similar Threads
- "ORA-12154: TNS:..." error after successful oracle connection
- ORA-12514: TNS:listener d oes not currently know of service requested in connect descriptor (OCIEr
- Ruby on Rails and Oracle
- Oracle listner with port forwarding issue
- Rails AR/Oracle Unit Test: [5310] failed (but getting better)