oracle OCI 连接字符串...需要帮助

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/539730/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 17:48:25  来源:igfitidea点击:

OCI connection string... need help

coracleoci

提问by Signal9

Does anyone know the OCI connection string used for the dbname parameter in the function OCILogon() for the oracle 10g C API ?

有谁知道用于 oracle 10g C API 的 OCILogon() 函数中的 dbname 参数的 OCI 连接字符串?

I know you can specify the tnsnames.ora entry for the service, but does it have the ability to take something like: oci:connect:myserver.com:1521/myservicename ?

我知道您可以为服务指定 tnsnames.ora 条目,但它是否能够采用以下内容: oci:connect:myserver.com:1521/myservicename ?

回答by Nikolai

You may use the following format for dbname:

您可以对 dbname 使用以下格式:

[//]host[:port][/service name]

[//]host[:port][/service name]

You can read more on subject here: Database Connection Strings for OCI Instant Client

您可以在此处阅读有关主题的更多信息: OCI Instant Client 的数据库连接字符串

回答by Ryan Emerle

You may be able to specify dbname as follows (without tnsnames.ora):

您可以按如下方式指定 dbname(不带 tnsnames.ora):

(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)))

(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)))