V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
nemo95
V2EX  ›  Python

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

  •  1
     
  •   nemo95 · 2021-09-26 17:19:34 +08:00 · 2382 次点击
    这是一个创建于 1136 天前的主题,其中的信息可能已经有所发展或是发生改变。

    一些用了很久的脚本需要迁移到 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)
    
    3 条回复    2021-09-27 08:25:26 +08:00
    wuwukai007
        1
    wuwukai007  
       2021-09-26 17:41:13 +08:00   ❤️ 1
    cx_oracle 用的那个版本
    nemo95
        2
    nemo95  
    OP
       2021-09-27 08:10:28 +08:00
    @wuwukai007

    cx-Oracle 8.2.1

    以前在 Linux 上用的是 8.0.1
    nemo95
        3
    nemo95  
    OP
       2021-09-27 08:25:26 +08:00
    @wuwukai007

    降级后运行正常了,非常感谢,我们还以为是操作系统变量问题呢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3193 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 12:41 · PVG 20:41 · LAX 04:41 · JFK 07:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.