Issue with oracle connection while using thik mode #363
Closed
ajit-satav
started this conversation in
General
Replies: 1 comment 1 reply
-
resolved. it was issue with local directory access |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using oracledb package along with instantclient_23_3 to connect oracle database with thik mode. Below it he sample code for same. oracle_config is the local directory which contains tnsnames.ora and sqlnet.ora
sqlnet.ora -
WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=/<LOCAL_DIR_PATH>/oracle/wallet)))
tnsnames.ora -
oracle_qa =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCPS)(HOST = )(PORT = ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = <service_name>)
)
)
Python file -
oracledb.init_oracle_client(lib_dir="//instantclient_23_3",config_dir = "oracle_config")
connection = oracledb.connect(
user="",
password="",
dsn="oracle_qa"
)
if not connection:
return {"error": "Failed to connect to Oracle database"}
else:
return "connection successful"
With this code while establishing connection, on line oracledb.connect program terminates without any error, nothing gets executed after this line and connection is not getting established. Do we see any issue with above code? what could be possible reasons for program getting terminated without any error.
Beta Was this translation helpful? Give feedback.
All reactions