-
Notifications
You must be signed in to change notification settings - Fork 357
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
Connect to Oracle DB using Wallet #260
Comments
Yes, you can use an Oracle wallet to connect to the database. I'll look up an example for you. |
Ok. Follow the instructions found here. You need to set WALLET_LOCATION and WALLET_OVERRIDE in your sqlnet.ora file. Once you have done that, you can connect to the database as follows: conn = cx_Oracle.connect(dsn="my_dsn") In other words, you don't have to specify the user name and password. That will be looked up in the wallet and used instead in a secure fashion. Does that make sense? If you have multiple connections and intend to use a pool, however, you have to do something like this instead: pool = cx_Oracle.SessionPool(dsn='my_dsn', externalauth=True,
homogeneous=False) In both cases 'my_dsn' refers to a NET alias found in your tnsnames.ora file or an EZ connect string (in the format hostname/servicename). If you have further questions let me know! |
Thank You so much ! This makes sense. But, my requirement is a little
different. Will appreciate if you can help out. We have Linux server where
python is installed. Wallet is too. Now, I have to use the wallet and
connect from the Linux server. we have the Oracle client installed on the
Linux server.How do I set the wallet_location and wallet_override
parameters on the Linux server so the connection would know to use them ?
Thanks again
Ravi
…On Thu, Jan 31, 2019 at 4:32 PM Anthony Tuininga ***@***.***> wrote:
Ok. Follow the instructions found here
<https://docs.oracle.com/en/database/oracle/oracle-database/18/dbseg/configuring-authentication.html#GUID-3EA07020-A9F3-4FF9-9518-E1AEA3BDDBBE>
.
You need to set WALLET_LOCATION and WALLET_OVERRIDE in your sqlnet.ora
file. Once you have done that, you can connect to the database as follows:
conn = cx_Oracle.connect(dsn="my_dsn")
In other words, you don't have to specify the user name and password. That
will be looked up in the wallet and used instead in a secure fashion. Does
that make sense?
If you have multiple connections and intend to use a pool, however, you
have to do something like this instead:
pool = cx_Oracle.SessionPool(dsn='my_dsn', externalauth=True,
homogeneous=False)
In both cases 'my_dsn' refers to a NET alias found in your tnsnames.ora
file or an EZ connect string (in the format hostname/servicename). If you
have further questions let me know!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#260 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AmJZfJ6V8ZgD8Hs7X4qfD0GPhvHwYm0wks5vI2DagaJpZM4ac-jn>
.
--
Ravi Shankar Duvvuru
|
Which bit is different? Are you uncertain about where to put the Here are doc links for WALLET_OVERRIDE and WALLET_LOCATION. |
Thanks for the quick reply. Yes, that's what I wasn't sure about.
…On Sun, Feb 3, 2019 at 11:06 PM Christopher Jones ***@***.***> wrote:
Which bit is different? Are you uncertain about where to put the
sqlnet.ora file? Create that file and set the TNS_ADMIN environment
variable to the directory containing the file. cx_Oracle will then find
$TNS_ADMIN\sqlnet.ora. You can put other configurations files like
tnsnames.ora and oraaccess.xml in the same directory, too.
Here are doc links for WALLET_OVERRIDE
<https://docs.oracle.com/en/database/oracle/oracle-database/18/netrf/parameters-for-the-sqlnet-ora-file.html#GUID-4A97EB10-B01F-4840-9BEF-4E5BD6DF0BDE>
and WALLET_LOCATION
<https://docs.oracle.com/en/database/oracle/oracle-database/18/netrf/parameters-for-the-sqlnet-ora-file.html#GUID-08373DE9-9CDD-4058-A8F8-9CB297CB2431>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#260 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AmJZfOj5d4Qqf0pUAuwXEaONKqiWvuk7ks5vJ7HdgaJpZM4ac-jn>
.
--
Ravi Shankar Duvvuru
|
Hi, |
There's nothing particularly special. I recall some whitespace issues when copying between Linux & Windows. I don't use Windows! Your error sounds more like the wrong path in one of the files. |
Yes, I found my error, it was someting wrong with the file unzip, Windows10 couldn't change the permissions, so I change inside Python and now it getting another error, "ORA-28860: Fatal SSL error". |
We'll follow up in the other issue you created , #271 |
Hi ,
Is there a way to use Oracle wallet to connect to the DB through cx_oracle ? Would like to use python in our company, but the challenge is how to connect using service account whose password is being closely protected by the DBAs. Thanks in advance for all the help
The text was updated successfully, but these errors were encountered: