How to config Django for Oracle RAC mode

15 views
Skip to first unread message

hu huaxuan

unread,
May 21, 2017, 8:16:40 AM5/21/17
to django...@googlegroups.com

Dear django-users,


We have two kinds of web servers. One is based on Java(tomcat + spring boot), while another is based on Python(Django).

Recently we changed our Oracle db to RAC mode, which theJava server can successfully connect to it by following config:

jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=177.177.50.112) (PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=177.177.50.113)(PORT=1521))(LOAD_BALANCE=NO)(FAILOVER=YES))(CONNECT_DATA=(SERVICE_NAME=aldb)(SERVER=DEDICATED)))

However for Django server, we can't find a proper way to config such connection. Anyone has experience to config Oracle RAC for Django?

Below is our old config which currently works well on non-RAC mode as a reference:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.oracle',
        'NAME': 'devdb',
        'USER': 'devuser',
        'HOST': '177.177.50.110',
        'PASSWORD': 'devpassword',
        'PORT': '1521',
        'CONN_MAX_AGE': 60 * 60 * 24 * 30 * 3, 
    }
}

Regards,

Felix Hu


Reply all
Reply to author
Forward
0 new messages