# Problem Connecting to Oracle

**URL:** <https://www.ruby-forum.com/t/problem-connecting-to-oracle/51792>\
**Category:** Ruby\
**Created:** [January 7, 2006, 1:42am UTC](https://www.ruby-forum.com/t/problem-connecting-to-oracle/51792 "2006-01-07T01:42:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcarlson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mcarlson](https://www.ruby-forum.com/u/mcarlson)\
**Post date:** [January 7, 2006, 1:42am UTC](https://www.ruby-forum.com/t/problem-connecting-to-oracle/51792/1 "2006-01-07T01:42:11Z")

</div>

Howdy,

I’m hoping someone can assist me with a problem I’m having connecting to  
a remote Oracle database.

Details:  
Running windows 2000. Have Oracle 92 client installed. The install was  
successful, as I’m able to use sqlplus/toad etc without issue

Downloaded oci8 adapter. This too was successful, as I’m able to run  
test scripts via the Ruby interpreter against the database with no  
issues.

When I try to run scaffolding with Rails however, I run into issues.

I took these details from the 2 wiki postings on Oracle.

My database.yml:  
development:  
adapter: oci  
database:  
host: SID  
username: user  
password: password

With this configuration, I get: ORA-01017: invalid username/password;  
logon denied. Both the user and password are correct though - I am sure  
of this.

If I modify the database.yml to the following:  
development:  
adapter: oci  
database: SID  
host: HOST/PORT  
username: user  
password: password

I get the following error: ORA-06401: NETCMN: invalid driver designator.  
I’ve googled the hell out of this error, and while the solution seems  
straightforward in most of the postings, none of them have been able to  
solve my problem. Either that, or I’m just not understanding some  
Oracle functionality very thoroughly…

I’ve subsequently tried a number of other combinations in the yml,  
including using the IP and SID, IP alone, etc…all to no avail.

Any help anyone can offer would be greatly appreciated. I’m happy to  
provide more details as well, as I’m anxious to get up and running on  
our corporate dbases to show rails off a bit.

Thanks,  
Matt

---

<div class="post-metadata">

**Author:** ![mcarlson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mcarlson](https://www.ruby-forum.com/u/mcarlson)\
**Post date:** [January 7, 2006, 7:56am UTC](https://www.ruby-forum.com/t/problem-connecting-to-oracle/51792/2 "2006-01-07T07:56:22Z")

</div>

Try taking the whole (((LOTS)OF)PARENS) definition for your DB from  
your TNSNAMES.ORA file, taking out all the line breaks (so it’s a  
one-liner), and putting that on the host: line.  
(Yes, this actually works)

Also, you can take the “database:” line out of the config. The OCI8  
adapter doesn’t use it.
