Skip to content

Unable to connect as SYSDBA using connection pool with thick mode #442

@P-Lng

Description

@P-Lng

oracledb.connect works as expected with AUTH_MODE_SYSDBA.

oracledb.create_pool also accepts mode=oracledb.AUTH_MODE_SYSDBA but it does not seem to make a difference. I still get:

ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

Thanks!


  1. What versions are you using?

    Oracle Database 23ai Free Release 23.0.0.0.0 - Version 23.5.0.24.07
    platform.platform: Linux-4.18.0-348.el8.x86_64-x86_64-with-glibc2.28
    sys.maxsize > 2**32: True
    platform.python_version: 3.10.2
    oracledb.version: 2.5.1

  2. Is it an error or a hang or a crash?
    Error

  3. What error(s) or behavior you are seeing?

Traceback (most recent call last):
  File "test_oracle.py", line 10, in <module>
    pool.acquire()
  File ".../site-packages/oracledb/pool.py", line 406, in acquire
    return oracledb.connect(
  File ".../site-packages/oracledb/connection.py", line 1194, in connect
    return conn_class(dsn=dsn, pool=pool, params=params, **kwargs)
  File ".../site-packages/oracledb/connection.py", line 579, in __init__
    impl.connect(params_impl, pool_impl)
  File "src/oracledb/impl/thick/connection.pyx", line 502, in oracledb.thick_impl.ThickConnImpl.connect
  File "src/oracledb/impl/thick/utils.pyx", line 446, in oracledb.thick_impl._raise_from_info
oracledb.exceptions.DatabaseError: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

  1. Does your application call init_oracle_client()?
    Yes, thick mode.

  2. Include a runnable Python script that shows the problem.

import oracledb

oracledb.init_oracle_client()  # Switch to thick mode
sys_dsn = <identifier from tnsnames.ora>

# Works as expected
oracledb.connect(sys_dsn, mode=oracledb.AUTH_MODE_SYSDBA, externalauth=True)

pool = oracledb.create_pool(sys_dsn, mode=oracledb.AUTH_MODE_SYSDBA, externalauth=True, homogeneous=False)
pool.acquire()
# oracledb.exceptions.DatabaseError: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

Metadata

Metadata

Assignees

No one assigned

    Labels

    Client Library or DatabaseAn issue with Oracle Client library or Oracle DatabasebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions