python安裝cx_oracle插件后 去做資料庫查詢,但是執行的時間長就會報 cx_Oracle.OperationalError: ORA-03113: 通信通道的檔案結尾
各位大牛 有什么 辦法可以破解,百度上搜索之后都是ORA-03113 相關的解釋,和python不沾邊
前提是對這個資料庫只有查詢權限 同樣一個SQL我執行了很多遍后就會報這個錯誤
代碼大概就是下面這個樣子
scconn_cmra = cx_Oracle.connect('dbquery/[email protected]/crmadb')
sccurs_cmra = scconn_cmra.cursor()
sql1 = "select a.attr_value,b.attr_value from ur_usersvcattrtrace_info a,ur_usersvcattrtrace_info b " \
"where a.id_No=b.id_No(+) " \
"and a.svcins_id =b.svcins_id(+) " \
"and a.attr_id ='23B632' " \
"and a.attr_value =:userid " \
"and '23B628' =b.attr_id (+) " \
"and a.exp_date>sysdate " \
"and sysdate<b.exp_date(+) "
sccurs_cmra.prepare(sql1)
sccurs_cmra.execute(None, {'userid': userid})
報錯資訊
Exception in thread Thread-18:
Traceback (most recent call last):
File "D:\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "D:\Python\Python37\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "D:/study/mbhdz.py", line 52, in qywaddfunc
sccurs_cmra.execute(None, {'userid': userid})
cx_Oracle.OperationalError: ORA-03113: 通信通道的檔案結尾
行程 ID: 24905638
會話 ID: 2612 序列號: 27740
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/23105.html
