本机IP:192.168.0.244
主机名:xiaoy
远程数据库服务器IP:192.168.0.3 主机名:E450 ORACLE_SID=orcl
本机tnsnames.ora内容。
C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>write tnsnames.ora
# tnsnames.ora Network Configuration File: c:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
TEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xiaoy)(PORT = 1522))
)
(CONNECT_DATA =
(SERVICE_NAME = test)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
E450 listener.ora内容
bash-3.00$ vi /export/home/oracle/oracle/product/10.2.0/network/admin/listener.ora
# listener.ora Network Configuration File: /export/home/oracle/oracle/product/10.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /export/home/oracle/oracle/product/10.2.0)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = E450)(PORT = 1521))
)
E450 tnsnames.ora文件内容
bash-3.00$ vi /export/home/oracle/oracle/product/10.2.0/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /export/home/oracle/oracle/product/10
.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
在本机(xiaoy)在命令行中连接远程orcl数据库可以实现。
C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>sqlplus [email=[B]scott/tiger@orcl]scott/tiger@orcl[/email]
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Dec 25 09:50:19 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>
在E450机器本地登录
bash-3.00$ sqlplus [email=[B]scott/tiger@orcl]scott/tiger@orcl[/email]
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Dec 25 10:11:43 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>
在isqlplus中 http://192.168.0.3:5560/isqlplus/
1.
*用户名
scott
*口令
*****
连接标识符
192.168.0.3/orcl
2.
*用户名
scott
*口令
*****
连接标识符
像1 标识符输入IP/orcl和2 不输入标识符,使用默认数据库都能成功
3 如果是下面这种情况的标识符就会 报12154错误
错误
ERROR - ORA-12154: TNS:could not resolve the connect identifier specified
登录
严禁未经授权使用此站点, 否则可能会面临民事和刑事起诉。
*表示必需的字段
*用户名
scott
*口令
*****
连接标识符
orcl
目前还没有明
白是哪里出了问题。
晕了哇,上面第3种情况死活连不上,无论是在xiaoy机还是在E450机。
无聊中,把isqlplus重启动了下。 奶奶的,竟然能用第3种情况登录上去了。
20110817 ps: 文档是在livespace的时候写的.现在源已经没有了.所以图片也转不过来.
远程数据库服务器IP:192.168.0.3 主机名:E450 ORACLE_SID=orcl
本机tnsnames.ora内容。
C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>write tnsnames.ora
# tnsnames.ora Network Configuration File: c:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
TEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xiaoy)(PORT = 1522))
)
(CONNECT_DATA =
(SERVICE_NAME = test)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
E450 listener.ora内容
bash-3.00$ vi /export/home/oracle/oracle/product/10.2.0/network/admin/listener.ora
# listener.ora Network Configuration File: /export/home/oracle/oracle/product/10.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /export/home/oracle/oracle/product/10.2.0)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = E450)(PORT = 1521))
)
E450 tnsnames.ora文件内容
bash-3.00$ vi /export/home/oracle/oracle/product/10.2.0/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /export/home/oracle/oracle/product/10
.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
在本机(xiaoy)在命令行中连接远程orcl数据库可以实现。
C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>sqlplus [email=[B]scott/tiger@orcl]scott/tiger@orcl[/email]
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Dec 25 09:50:19 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>
在E450机器本地登录
bash-3.00$ sqlplus [email=[B]scott/tiger@orcl]scott/tiger@orcl[/email]
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Dec 25 10:11:43 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>
在isqlplus中 http://192.168.0.3:5560/isqlplus/
1.
*用户名
scott
*口令
*****
连接标识符
192.168.0.3/orcl
2.
*用户名
scott
*口令
*****
连接标识符
像1 标识符输入IP/orcl和2 不输入标识符,使用默认数据库都能成功
3 如果是下面这种情况的标识符就会 报12154错误
错误
ERROR - ORA-12154: TNS:could not resolve the connect identifier specified
登录
严禁未经授权使用此站点, 否则可能会面临民事和刑事起诉。
*表示必需的字段
*用户名
scott
*口令
*****
连接标识符
orcl
目前还没有明
白是哪里出了问题。
晕了哇,上面第3种情况死活连不上,无论是在xiaoy机还是在E450机。
无聊中,把isqlplus重启动了下。 奶奶的,竟然能用第3种情况登录上去了。
20110817 ps: 文档是在livespace的时候写的.现在源已经没有了.所以图片也转不过来.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11780477/viewspace-705084/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11780477/viewspace-705084/