Skip to content

How to create a connection pool using the sys user? #70

Closed Answered by cjbj
Stephenxman asked this question in Q&A
Discussion options

You must be logged in to vote

You can currently use SYSDBA via standalone connections in Thin and Thick modes, and via pooled connections in Thin mode. In Thin mode you will always need to pass the credential and connection string, because this mode doesn't support Oracle's 'Bequeath' connections. In Thick mode you can pass credentials and connection string, or optionally use OS authentication. The following code works when python-oracledb uses the client libraries in $ORACLE_HOME:

import oracledb
oracledb.init_oracle_client()
connection = oracledb.connect(mode=oracledb.AUTH_MODE_SYSDBA)
with connection.cursor() as cursor:
    for r in cursor.execute("select user from dual"):
        print(r)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Stephenxman
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by cjbj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants