Specifying the SERVICE_NAME for Oracle DB connections

71 views
Skip to first unread message

Josh Smeaton

unread,
Aug 25, 2014, 6:47:36 AM8/25/14
to django-d...@googlegroups.com
Oracle has two concepts of database names - the SID or the SERVICE NAME. I'll gloss over the details, but the SID is the database instance, and the SERVICE NAME is an alias to an instance or cluster. Currently the database['NAME'] entry represents the SID unless HOST and PORT are empty, then the NAME references an entry in the tnsnames.ora file (which can point to a SERVICE NAME).

The recommended way for connecting to a service is by leaving HOST and PORT empty, and specifying a NAME which maps to the tnsnames.ora file. There isn't really a way of connecting to a service purely with django configuration. I would like to propose an option in the OPTIONS sub-dictionary called "use_service_name" (or some other option name), which will tell django to use the NAME as a SERVICE_NAME rather than a SID.

A more explicit solution would be to abandon the NAME field for Oracle, and require SID or SERVICE_NAME instead. I'm unsure of the implications in going down that path though.

I'm interested in hearing feedback on this topic so I can put together a patch if my proposal is accepted.
Reply all
Reply to author
Forward
0 new messages