Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT =1525)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bys3)))
OK (0 msec)
[oracle@bys3 admin]$ tnsping bys3
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 14-JAN-2014 22:30:46
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT =1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bys3)))
OK (10 msec)
[oracle@bys3 admin]$ sqlplus bys/bys@bys3
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 14 22:32:02 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
BYS@ bys3>exit
[oracle@bys3 admin]$ sqlplus bys/bys@test
BYS@ test>exit
###############################################################
配置静态监听:
1.配置listener.ora,增加相应条目
[oracle@bys3 admin]$ cat listener.ora# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT = 1525))
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT = 1521))
)
)
l3 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT = 1526))
)
)
SID_LIST_l3=
(SID_LIST=
(SID_DESC=
(SID_NAME=bys3)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)))
ADR_BASE_LISTENER = /u01
2.启动监听,查看状态:
[oracle@bys3 ~]$ lsnrctl status l3LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-JAN-2014 22:19:49
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bys3.bys.com)(PORT=1526)))
STATUS of the LISTENER
------------------------
Alias l3
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 14-JAN-2014 22:15:15
Uptime 0 days 0 hr. 4 min. 34 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/diag/tnslsnr/bys3/l3/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bys3.bys.com)(PORT=1526)))
Services Summary...
Service "bys9" has 1 instance(s).
Instance "bys3", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
#################
3.使用SQLPLUS进行登陆测试
[oracle@bys3 admin]$ cat tnsnames.oratest9 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT =1526))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = bys9)
)
)
[oracle@bys3 ~]$ tnsping test9
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 14-JAN-2014 22:37:56
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT =1526))(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bys9)))
OK (10 msec)
[oracle@bys3 ~]$ sqlplus bys/bys@test9