Python cx_oracle and server information

To demonstrate the Oracle security feature, you must call OCIServerVersion () or OCIServerRelease () when the user session is not already established.

If the database parameter is sec_return_server_release_banner = false . I use the cx_Oracle Python module for this, but I'm not sure how to get the server version before establishing a connection. Any ideas?

+7
source share
2 answers

Depends on your SW architecture and your intention to be ready to move to another platform.

cx_Oracle is dependent on the Oracle client. Thus, you are sure that the Oracle client is following a known path. Even if you do not want to use the Oracle client for a regular session, you can use it to pre-test the server.

On linux / unix, you can run the following subprocess code:

 sqlplus user/ pasword@INSTANCE <<< "quit"| grep "Oracle Database"| head -n 1 

Grep and other processing can be done in your code and on Windows, this is necessary. By the code, you will receive the version of Oracle, and you will find out whether the connection information is correctly specified.

0
source

Disable connection establishment. No, you can never ask for anything. It's like a Google Page (Internet Architecture - if you call it a session or session)

As for Authentical, if no permissions are set, Oracle uses the username "nobody" as the user, and thus gives each user a session.

I am an Oracle APEX user and I am using Python, PLSQL regurlary.

This is a good question. Thanks.

0
source

All Articles