[Python] Python 操作 Oracle 报错 ORA-12715,但 NLS 已经设置过了

一些用了很久的脚本需要迁移到 windows server 2012 R2,但运行操作 Oracle 时候都会报错 ORA-12715,网上搜到的解释都指向 NLS_LANG

不过我检查了一下这不配置过了吗

SIMPLIFIED CHINESE_CHINA.ZHS16GBK

另外这台机器上的 navicat 访问 Oracle 是正常的,sublime 和 jupyter notebook 会报错

Error while trying to retrieve text for error ORA-12715
(Background on this error at: https://sqlalche.me/e/14/4xp6)
Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\engine\base.py", line 3212, in _wrap_pool_connect return fn() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 307, in connect return _ConnectionFairy._checkout(self) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 767, in _checkout fairy = _ConnectionRecord.checkout(pool) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 425, in checkout rec = pool._do_get() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\pool\impl.py", line 146, in _do_get self._dec_overflow() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\util\langhelpers.py", line 72, in __exit__ with_traceback=exc_tb, File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\util\compat.py", line 207, in raise_ raise exception File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\pool\impl.py", line 143, in _do_get return self._create_connection() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 253, in _create_connection return _ConnectionRecord(self) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 368, in __init__ self.__connect() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 611, in __connect pool.logger.debug("Error on connect(): %s", e) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\util\langhelpers.py", line 72, in __exit__ with_traceback=exc_tb, File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\util\compat.py", line 207, in raise_ raise exception File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 605, in __connect connection = pool._invoke_creator(self) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\engine\create.py", line 578, in connect return dialect.connect(*cargs, **cparams) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\engine\default.py", line 584, in connect return self.dbapi.connect(*cargs, **cparams)

发表回复

您的电子邮箱地址不会被公开。