【问题标题】:Why can I not connect to my Oracle Cloud ADB with python-oracledb?为什么我无法使用 python-oracledb 连接到我的 Oracle Cloud ADB?
【发布时间】:2022-08-09 05:02:25
【问题描述】:

我在我的 Always Free Oracle ADB 上使用 Python 3.9.13 cx_Oracle 没有问题。

现在我试图在 Oracle ADB 上连接 python-oracledb 没有成功:

  • sqlplus -l 管理员@\'tcps://adb.eu-frankfurt-oraclecloud.com:1522/abc_db21cpresent_medium.adb.oraclecloud.com?wallet_location=C:/etc_atp21c-present\'

    => 有效。

  • csx = \"tcps://adb.eu-frankfurt-oraclecloud.com:1522/abc_db21cpresent_medium.adb.oraclecloud.com?wallet_location=C:\\etc_atp21c-present&retry_count=20&retry_delay=3\"

    连接 = oracledb.connect(用户=\'northwind\', 密码=\'*****\', dsn=csx)

    => 不起作用:oracledb.connect 不会返回(没有错误)。

有什么提示吗?

油炸

    标签: python oracle python-oracledb


    【解决方案1】:

    它现在有效:

    您必须指定三个参数(Windows 10):

    connection = oracledb.connect(user='northwind', password=pw, dsn='db21cpresent_medium',
                             config_dir="c:\\my\\wallet\\dir",
                             wallet_location="c:\\my\\wallet\\dir", 
                             wallet_password=wpw
     )
    

    在我的 wallet-dir 中,解压 wallet.zip 文件后,有 tnsname.ora 和 ewallet.pem 文件。

    油炸

    【讨论】:

    【解决方案2】:

    我在哪里可以找到 wallet.zip 文件?

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-07-30
    • 2017-11-12
    • 1970-01-01
    • 1970-01-01
    • 2017-07-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多