C#以编程方式执行TNSPing [英] C# perform a TNSPing programmatically

查看:68
本文介绍了C#以编程方式执行TNSPing的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以以编程方式在Oracle数据库上执行TNSP?

Is it possible to perform a TNSPing on an Oracle Database programmatically?

我知道我可能可以调用TNSPing程序并解析任何生成的输出,但是我正在寻找一种更健壮的方法来处理数据库TNS Ping.

I'm aware I could probably call the TNSPing program and parse any output generated but I'm looking for a more robust method of handling the database TNS Ping.

见过 Ping类在MSDN上,我尝试使用找到的示例代码,但是我认为我需要某种方法将TNS名称解析为实际的IP地址,此方法才能起作用.这可能吗?

Having seen the Ping class on MSDN, I tried to use the example code found, but I think I would need some way to resolve the TNS name into an actual IP address for this method to work. Is this possible?

推荐答案

This Forum seems to suggest that attempting to use TNSPing is a waste of time and that actually attempting the connection would be of more use!

似乎,捕获与数据库通信期间可能引发的异常可能是测试oracle数据库仍然存在的唯一可靠方法.

It seems that catching the exceptions that might get raised during communications with a database might be the only reliable way to test that an oracle database is still there.

这篇关于C#以编程方式执行TNSPing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆