我需要在Django(1.8),cx_Oracle 5.2和python33
中使用Oracle12 DRCP连接池这是我的配置
TNS名称配置
TNS_NAME_DRCP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = my_host_name)(PORT = 1521))
(CONNECT_DATA =
(SID = MY_SID)
(SERVER = POOLED)
)
)
Django连接设置
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'TNS_NAME_DRCP',
'USER': 'USERNAME',
'PASSWORD': 'PASSWORD',
'HOST': '',
'PORT': '',
'CONN_MAX_AGE': 10000,
'OPTIONS': {
'purity': cx_Oracle.ATTR_PURITY_SELF,
'cclass': 'MY_CLASS_NAME',
'threaded': True,
},
}
}
连接和应用程序正常工作。 但是当我试图通过查询来查看连接池是否正常工作时
SQL> select num_hits, num_misses,num_requests from v$cpool_cc_stats;
我得到Zero Hits。 (100%未命中) 我查看了以下页面以获取更多信息
DATABASE RESIDENT CONNECTION POOLING (DRCP ) DRCP with cx_Oracle doesn't appear to work as expected
任何提示我可能做错了什么?