-
Notifications
You must be signed in to change notification settings - Fork 365
Can't connect via wallet to two different databases at the same time #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
See #553 |
Hi @cjbj, I saw this issue but I don't get how it solves my problem. The solution that @anthony-tuininga proposes in #485 expects an user and password but all I don't have it... Also, do you have a clue about when is this going to be solved in cx_Oracle? It seems weird that we should write that much code to be able to connect to different databases using two different wallets... |
@thiagodma I don't believe whether you have or don't have credentials matters. I think the fundamental thing is that you need a single tnsnames.ora & sqlnet.ora files in the one directory. Then you need to make sure the different connect strings in that tnsnames.ora refer to your different wallets. (And use 21c client). Try it out and let me know. (And use 21c client) The code Anthony has is just to save some manual effort for cloud wallet (where you download a zip from the cloud). If you are creating your own files, then you don't have to write any extra code: just make sure your connection descriptors use the correct wallet. For background: This is not a cx_Oracle problem. Connectivity and security are several layers lower in the Oracle Client libraries. You'd have the same behavior with SQL*Plus. |
Thank you for your answer, @cjbj . About the tnsnames.ora, should it be something like this? (DESCRIPTION= (ADDRESS=(PROTOCOL=tcps)(HOST=salesserver)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=sales)) (SECURITY=(SSL_SERVER_DN_MATCH=TRUE)(SSL_SERVER_CERT_DN=cn=sales,cn=OracleContext,dc=us,dc=example,dc=com)(MY_WALLET_LOCATION=/tmp/oracle))) If so, I'll try it with 21c client, I tried with 19c instant client and it didn't work tho.. Are you also suggesting for me to use the full client, not the instant client? |
Database Version: 18c
platform.platform: Linux-3.10.0-957.5.1.el7.x86_64-x86_64-with-centos-7.6.1810-Core
sys.maxsize > 2**32: True
platform.python_version: 3.6.9
cx_Oracle.version 8.1.0
cx_Oracle.clientversion (19, 6, 0, 0, 0)
Is it an error or a hang or a crash? Error
What error(s) or behavior you are seeing?
Traceback (most recent call last):
File "test.py", line 27, in
sis = Sisredex()
File "test.py", line 19, in init
cx_Oracle.init_oracle_client(config_dir="/opt/flx/config/sisredex")
cx_Oracle.ProgrammingError: Oracle Client library has already been initialized
In my application I want to extract data from a database and load it in other database. For security reasons, I'd like to connect to the databases using wallets. Basically, I have an object that connects to the source database, makes a select and loads the data in memory and the I use another object that connects to the target database to insert the data. I have wallets to connect to both databases but can't find a way to have two objects that connect to each database when using wallets.
Do you have any suggestions?
The text was updated successfully, but these errors were encountered: