问题描述
这是ODP.NET,伟大的ConnectionStrings.com字符串,但什么是数据源?
它是控制面板中的DSN?
一个服务器名称?
一个TNS名称服务名称?
感谢
卢克
如果您正在使用ODP.NET与TNS这不过是适配器的一个用于连接到Oracle database.The文件保持TNS条目是TNSNAMES .ORA
在tnsnames.ora中的条目示例(用于文件路径通常是ORACLE_HOME \网络\ ADMIN)样品条目类似于以下
TORCL =(DESCRIPTION =
(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = MYHOST)(PORT = MyPort上)))
(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = MyOracleSID)))
下面TORCL是一个别名为数据源,MYHOST是数据库服务器的名称或IP地址,端口是数据库监听端口,MyOracleSID是您的Oracle服务
因此
数据源= TORCL;用户ID =名为myUsername;密码= MYPASSWORD;
是一样的。
数据源=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = MYHOST)(PORT = MyPort上)))(CONNECT_DATA =(SERVER = DEDICATED)( SERVICE_NAME = MyOracleSID)));用户ID =名为myUsername;密码= MYPASSWORD;
This is the ConnectionStrings.com string of ODP.NET, great, but what is Data Source?
Is it a DSN in Control Panel?
A server name?
A TNS names service name?
Thanks
Luke
If you are using ODP.NET with TNS which is nothing but one of the adapter for connecting to the oracle database.The file for maintaining the TNS Entries is Tnsnames.Ora
A Sample entry in tnsnames.ora(path for the file is normally ORACLE_HOME\NETWORK\ADMIN)sample entry looks like the below
TORCL=(DESCRIPTION=
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost) (PORT=MyPort)))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)))
Here TORCL is an alias for the Data source,MyHost is your Database server name or Ip Address,Port is the database listener port and MyOracleSID is your Oracle Service
Hence
Data Source=TORCL;User Id=myUsername;Password=myPassword;
is same as
Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost) (PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;
这篇关于甲骨文ODP.NET连接字符串:在发生什么数据源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!