Good, that's progress actually!

So now cx_Oracle is finding the oracle libs correctly and giving up
when it can't figure out how to connect to the database you've
specified.  So it needs to use one of Oracle's naming mechanisms to
resolve the database location, such as LDAP or Oracle's own
TNSNAMES.ORA flat file.

Typically the client looks for
$ORACLE_HOME/network/admin/tnsnames.ora.  If you don't have that file
or that directory structure under
/Users/bft228/Library/Oracle/instantclient_10_2, you should go ahead
and create them.  Then try connecting again, and either it will work
fine, or you'll have to do some editing of TNSNAMES.ORA to ensure
hostnames and ports are all correct.

There are ways to customize the location of TNSNAMES.ORA through
environment variables, or to specify which set of naming methods to
try, but probably this is sufficient for your use.

Matt

On Fri, Feb 20, 2009 at 12:21 PM, Brandon Taylor
<btaylordes...@gmail.com> wrote:
>
> Hi Matt,
>
> Ok, I modified manage.py to add two environ variables:
>
> import os
> oracle_home = '/Users/bft228/Library/Oracle/instantclient_10_2'
> os.environ['ORACLE_HOME'] = oracle_home
> os.environ['DYLD_LIBRARY_PATH'] = oracle_home
>
> Now I'm getting an error:
> DatabaseError: ORA-12505: TNS:listener does not currently know of SID
> given in connect descriptor
>
> Everything I've found online seems to point to a "tnsnames.ora" file
> that describes the connection information. A co-worker sent me their
> "tnsnames.ora" file, but I'm unsure where to put this in OS X.
>
> My ORACLE_HOME is "/Users/bft228/Library/Oracle/instantclient_10_2"
>
> Thoughts?
> Brandon
>
>
> On Feb 20, 11:04 am, Matt Boersma <m...@sprout.org> wrote:
>> Brandon,
>>
>> Usually that error arises from cx_Oracle when the ORACLE_HOME
>> environment variable isn't set.  Try doing "manage.py shell" and
>> looking at what's in os.environ--if you don't see ORACLE_HOME set to
>> the correct location there, try fixing that first.
>>
>> Matt
>>
>> On Fri, Feb 20, 2009 at 9:41 AM, Brandon Taylor <btaylordes...@gmail.com> 
>> wrote:
>>
>> > Hi everyone,
>>
>> > I'm using Oracle instantclient_10_2 (Intel), cx_Oracle-5.0.1, OS X
>> > 10.5.6 (Intel), Python 2.6.1 and Django trunk.
>>
>> > My built-in server will start up correct, but, when I attempt to get
>> > objects for a model, I receive the following error:
>>
>> > InterfaceError: Unable to acquire Oracle environment handle
>>
>> > Can anyone help me resolve this problem?
>>
>> > TIA,
>> > Brandon
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to