Oracle 10 g - 设置 ODBC 连接以及什么是 TNSNames.ora
我不明白 Oracle 是如何工作的。这是我第一次接触 Oracle,所以如果这个问题听起来很愚蠢,甚至愚蠢得可笑,请接受我的歉意。
Oracle DBA 团队创建数据库或模式(有什么区别?)。我们将其称为 SIT_Release2。我要为其设置 ODBC 连接。我有一些名为 TNSNames.ora 的文件,它位于 ORACLE_HOME\Network\Admin 路径中。
TNSNames.ora 具有以下信息
SIT = (描述= (地址列表= (地址=(协议= TCP)(主机=“IP地址”)(端口= 1875)) ) (连接数据= (SID =“坐”) (服务器=专用) ) )
现在,不同数据库或模式已存在的 ODBC 连接(名称为 SIT_Release1)如下所示。
数据源名称填充有特定值。
描述中填充有特定值。
TNS 服务名称由 SIT 值填充。
用户 ID 已填充。
问题
TNSNames.ora 只是指定我通过哪个端口连接和侦听哪个服务器。
我们究竟在哪里指定此 ODBC 连接指向此特定数据库?
编辑
答案
我仍然不明白它是如何工作的。但这就是发生的事情 -
SID="sit" 仍然保持原样,但我给出的凭据将其指向不同的数据库。
因此,在上面的屏幕截图中,TNS 服务名称仍然相同。但是,用户名/密码不同,我可以连接到不同的数据库。
I do not understand how Oracle works. This is my first tryst with Oracle, so please accept my apologies if this questions sounds silly or even ridiculously silly.
The Oracle DBA team creates a database or a schema (what is the difference?). Let us call it SIT_Release2. I am to setup the ODBC connections for it. I have some file called TNSNames.ora which resides in ORACLE_HOME\Network\Admin path.
The TNSNames.ora has the following information
SIT =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = "IPAddress")(PORT = 1875))
)
(CONNECT_DATA =
(SID = "sit")
(SERVER = DEDICATED)
)
)
Now, the ODBC Connection that already exists for a different database or schema (Name of it is SIT_Release1) is as below.
The Data Source Name is populated with a certain value.
The Description is populated with a certain value.
The TNS Service Name is populated with value of SIT
The User Id is populated.
Question
The TNSNames.ora just specifies to which server I am connecting and listening via which port.
Where exactly are we specifying that this ODBC connection points to this particular database?
EDIT
ANSWER
I still do NOT understand how it works. But this is what happened -
The SID="sit" still remains as such, but the credentials I give point it to different databases.
So, in the above screenshot, the TNS Service Name is still the same. However, the username/password is different and I am able to connect to a different database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它的
SID="sit"
部分指向您的数据库。Oracle 系统 ID (SID) 用于唯一标识系统上的特定数据库。
因此,一台计算机系统上不能有多个具有相同 SID 的数据库,
请参阅此处或此处了解更多详细信息。
Its the
SID="sit"
part that points to your database.The Oracle System ID (SID) is used to uniquely identify a particular database on a system.
For this reason, one cannot have more than one database with the same SID on a computer system
Refer here or here for some more details.