Skip to content
Discussion options

You must be logged in to vote

I made a successful local OS authentification with env variables like this :

import oracledb
import os

oracledb.init_oracle_client()

os.environ['ORACLE_SID'] = 'LABOAAD1'
print(os.environ.get('ORACLE_SID'))
connection = oracledb.connect()
cursor = connection.cursor()
cursor.execute("SELECT SYS_CONTEXT ('USERENV', 'SESSION_USER')  FROM DUAL")
print(cursor.fetchall())

os.environ['ORACLE_SID'] = 'LABOBBD1'
print(os.environ.get('ORACLE_SID'))
connection2 = oracledb.connect()
cursor = connection2.cursor()
cursor.execute("SELECT SYS_CONTEXT ('USERENV', 'SESSION_USER')  FROM DUAL")
print(cursor.fetchall())

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

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

Answer selected by pepinno
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