检查 ODP 连接性的最简单测试
我想将新版本的 ODP 安装到生产环境中,并且正在寻找最简单的测试,以确保驱动程序实际上运行正常,并且服务器上的定制应用程序仍然可以连接到数据库。
听起来很简单,但有一些注意事项...
首先,除了 Oracle 设置之外,我需要做的一件事是手动在注册表中引入一个键 TNS_ADMIN。这对于我要安装的环境至关重要,当此密钥丢失或路径不正确时,这是问题的正常原因。实际上,这就是我真正想要测试的。
接下来,由于这些是生产服务器,因此它们上没有安装任何工具,因此我不能只运行 Toad 的副本。对于现有软件,唯一真正安全的假设是操作系统 (Windows 2003) 和 Oracle 驱动程序(ODP 11.2 R3,在撰写本文时是 Oracle 当前的生产版本)。
其次,那里的定制应用程序通常是面向服务的,因此简单地说“只运行其中一个应用程序”可能说起来容易做起来难。同样在这一点上,实际上并不是我来运行这些驱动程序,而是一个对他们正在做的事情了解有限的操作员(悲伤但真实)。因此,无论我选择哪种测试,它都必须足够容易让那个人遵循,并且足够容易让他解释结果。
接下来,我完全意识到我可以编写一个 5 行测试装置来打开和关闭连接。这样做的优点是使操作员的工作变得轻松,并且绝对是一个后备选项,但不禁想知道是否有更简单的方法。
我想我只是想知道是否有人知道某种实用程序,它很可能随 ODP 一起提供,这将影响连接测试。即使我最终给操作员一个 .bat 文件来执行,它也会比编写我自己的应用程序更简单(并且更不容易出错???)。
最佳建议加分, 皮特
I want to install a new version of ODP into a production environment and I'm looking for the simplest test that the drivers have actually gone on ok, and the bespoke apps on the server can still connect to the database.
Sounds easy, but there are some caveats...
First, one thing I need to do over-and-above the Oracle setup is to manually introduce a key into the registry, TNS_ADMIN. This is critical to the environment I'm installing to and when this key is missing, or the path is incorrect, this is the normal cause of problems. Effectively, this is what I'm actually looking to test.
Next, since these are production servers, there are no tools installed on them, so I can't just run up a copy of Toad, for example. The only truly safe assumption for the software present will be the operating system (Windows 2003) and the Oracle drivers (ODP 11.2 R3 which at the time of writing is Oracle's current production version).
Next, the bespoke apps on there are generally service-oriented, so simply saying "just run up one of the apps" might be easier said than done. Also on this point, it won't actually be me whose running these drivers in, but will be an operator who will have limited knowledge of what they're doing (sad but true). So whatever test I settle on, its got to be easy enough for the guy to follow, and easy enough for him to interpret the results.
Next, I'm fully aware I could write a 5-line test rig just to open and close a connection. This has the advantage of making life easy for the operator, and is definitely a fallback option, but can't help wondering if there is an easier approach.
I guess I'm just wondering whether anyone knows of some kind of utility, which more than likely ships with ODP, which will effect a connection test. Even if I end up giving the operator a .bat file to execute it'll be simpler (and less error prone???) than writing my own app.
Points for the best suggestion,
Pete
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为 ODP.net 中没有这样一个,没有。至少,我在实体框架测试版(我已经安装)中没有看到任何内容。
在较大的驱动程序包中,您可以使用 SQL*Plus,它是一个命令行工具。但就您的目的而言,最简单的答案可能是编写一个非常小的应用程序,该应用程序仅连接并执行
SELECT * FROM DUAL;
I don't think there is one in just ODP.net, no. At least, I don't see anything in the Entity Framework beta version of it (which I have installed).
In the larger driver packages you could use SQL*Plus, which is a command line tool. But for your purposes the simplest answer is likely to write a very small app that just connects and does a
SELECT * FROM DUAL;
我让操作员创建 ODBC 连接并对其进行测试。我只需使用 Windows 即可完成此操作,无需其他软件,他们只需要确保使用正确的驱动程序并拥有有效的数据库登录信息
I got the operator to create an ODBC connection and to test it. I can do this just using Windows, no additional software required, they just need to make sure they use the right driver and have a valid database login to hand