python cx_oracle 和服务器信息
为了演示 Oracle 的安全功能,必须在用户会话尚未建立时调用 OCIServerVersion() 或 OCIServerRelease()。
同时具有数据库参数sec_return_server_release_banner = false
。 我为此使用 Python cx_Oracle 模块,但我不确定如何在建立连接之前获取服务器版本。有什么想法吗?
In order to demonstrate the security feature of Oracle one has to call OCIServerVersion() or OCIServerRelease() when the user session has not yet been established.
While having the database parameter sec_return_server_release_banner = false
.
I am using Python cx_Oracle module for this, but I am not sure how to get the server version before establishing the connection. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
取决于您的软件架构和您准备跨平台的意图。
cx_Oracle 依赖于 Oracle 客户端。所以您确定已知路径上有 Oracle 客户端。即使您不想使用 Oracle 客户端进行常规会话,您也可以使用它对服务器进行初步检查。
在 linux/unix 上,您可以在子进程中运行以下代码:
Grep 和其他处理可以在您的代码中完成,而在 Windows 中这是必要的。通过代码您将获得Oracle的版本,并且您将知道连接信息是否正确。
Depends on your SW architecture and your intention to be cross platform ready.
cx_Oracle is dependent on Oracle client. So you are sure that there is Oracle client on known path. Even through you don't want to use Oracle client for regular session you could use it for preliminary check of the server.
On linux/unix you could run in subprocess following code:
Grep and other processing could be done in your code and in Windows it is necessary. By the code you will get version of Oracle and you will know if the connection info is correct.
无需建立连接,。不,你永远不能问任何事情。这就像访问 Google Page。(互联网架构 - 无论您称之为无会话还是基于会话)
至于真实,如果未设置权限 - Oracle 使用用户名“nobody”作为用户,从而为每个用户提供一个会话。
我是Oracle APEX的用户,我使用Python,PLSQL regurlary。
这是一个很好的问题。谢谢。
With-out establishing a connection,. No you can never asking anything. It's like going to Google Page.(Internet Architecture - wether you call it sessionless or session based)
As for Authentical, if no permission are set - Oracle uses a username 'nobody' as a user and thus gives every user a session.
I am a user of Oracle APEX, and I use Python, PLSQL regurlary.
That's one nice question. Thanks.