监听独立于数据库服务器的配置,解决ORA-12520及ORA-12545错误(二)
or this service...
The command completed successfully
2、配tnsnames.ora
remote_130 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.217.133)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ocm)
)
)
3.连接测试
[oracle@ocm admin]$ sqlplus hr/hr@remote_130
SQL*Plus: Release 11.2.0.3.0 Production on Wed May 29 23:07:19 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-12520: TNS:listener could not find available handler for requested type of
server
Enter user-name:
4、解决方法:(192.168.217.133)主机上一定要配一下
vi /etc/hosts
192.168.217.130 ocm
192.168.217.133 ocp
四、从
windows客户端连接
remote_130 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.217.133)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ocm)
)
)
C:\Users\Administrator>sqlplus hr/hr@remote_130
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 5月 29 21:02:34 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12545: 因目标主机或对象不存在, 连接失败
请输入用户名:
解决方法在C:\Windows\System32\drivers\etc
编辑hosts添加如下:
192.168.217.130 ocm
192.168.217.133 ocp
五、最后总结配置的整过程和解决:
1、配tnsnames.ora
LISTENER_OCP =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.217.133)(PORT = 1521))
)
2、配参数
sys@OCM> alter system set remote_listener=LISTENER_OCP;
3、查服务
[oracle@ocm ~]$ lsnrctl services
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-MAY-2013 23:28:55
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
Service "ocm" has 1 instance(s).
Instance "ocm", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "ocmXDB" has 1 instance(s).
Instance "ocm", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:972 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=ocm.example.com)(PORT=46963))
Service "ocp" has 1 instance(s).
Instance "ocp", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:5 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=ocp)(PORT=1521))
The command completed successfully
(ADDRESS=(PROTOCOL=TCP)(HOST=ocp)(PORT=1521))从这里发现问题的所在。。。。明白了监听是用主机名,这里必须配/etc/hosts或DNS
4、在windows客户端配tnsnames.ora,或在linux客户端配tnsnames.ora
remote_130 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.217.133)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ocm)
)
)
5、连接报错
windows中报错
ERROR:
ORA-12545: 因目标主机或对象不存在, 连接失败
请输入用户名:
linux中报错
ERROR:
ORA-12520: TNS:listener could not find available handler for requested type of
server
Enter user-name:
6、最后解决办法:
(1)windows