- 最后登录
- 2015-2-27
- 在线时间
- 8 小时
- 威望
- 0
- 金钱
- 38
- 注册时间
- 2015-1-22
- 阅读权限
- 10
- 帖子
- 7
- 精华
- 0
- 积分
- 0
- UID
- 2246
|
1#
发表于 2015-1-23 10:11:14
|
查看: 5176 |
回复: 10
本帖最后由 wxueyu 于 2015-1-26 14:33 编辑
各位好!
刚跳到新公司,没有DBA交接,衰!
在熟悉数据库的过程中,遇到同一台小机,不同监听端口,相同实例名字,数据库用户分别不同的问题,请大家帮忙分析分析,这个库要怎么连接。
[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
监听端口:1521,9521(开发提供的,测试两个端口都可以登录,实例配置均为 orcl ,但是数据库用户等信息不同)
ORCL_139=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=192.168.56.139)
(PORT=1521)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SERVICE_NAME=orcl)
)
)
ORCL_952=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=192.168.56.139)
(PORT=9521)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SERVICE_NAME=orcl)
)
)
在服务器端,只有一个监听listener.ora文件
[root@localhost ~]# find / -name listener.ora
/opt/oracle/product/11.2.0/db_1/network/admin/samples/listener.ora
/opt/oracle/product/11.2.0/db_1/network/admin/listener.ora
监听文件:
cat /opt/oracle/product/11.2.0/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /opt/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /opt/oracle
监听状态:
[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 23-JAN-2015 09:56:42
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 10-JAN-2014 13:53:47
Uptime 377 days 20 hr. 2 min. 54 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
端口 1521,9521 均有占用信息:
netstat -anp |grep 1521 |more
tcp 0 0 ::ffff:192.168.56.139:1521 ::ffff:11.26.1.16:51648 ESTABLISHED 23352/oracleorcl
.............................
netstat -anp |grep 9521 |more
tcp 0 0 ::ffff:192.168.56.139:9521 ::ffff:192.168.56.141:39521 ESTABLISHED 21731/oracleorcl
...............................
现在,我在服务器端,默认监听是 1521。
1:是通过怎么样的设置,才能达到这种效果?
2:要怎么操作,才能连接到 9521的端口? |
|