设为首页 收藏本站
查看: 732|回复: 0

[经验分享] oracle配置多网络接口多端口 listener

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-5-18 09:53:25 | 显示全部楼层 |阅读模式
环境:oracle 11.2.0.4
两个数据库实例:orcl test
主机名解析:192.168.1.30 orcl.lineqi.com orcl

[oracle@orcladmin]$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:40:07:9A
          inetaddr:192.168.1.30  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr:fe80::20c:29ff:fe40:79a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500 Metric:1
          RX packets:2548 errors:0 dropped:0overruns:0 frame:0
          TX packets:1875 errors:0 dropped:0overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:262084 (255.9 KiB)  TX bytes:263913 (257.7 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0C:29:40:07:A4
          inet addr:192.168.1.31  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr:fe80::20c:29ff:fe40:7a4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500 Metric:1
          RX packets:297 errors:0 dropped:0overruns:0 frame:0
          TX packets:11 errors:0 dropped:0overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:21490 (20.9 KiB)  TX bytes:746 (746.0 b)
一、在两个网络接口的不同端口监听一个实例1、配置listener[oracle@orcl 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.

LIST4 =
(DESCRIPTION_LIST =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.31)(PORT = 1524))
    )
  )
LIST3 =
(DESCRIPTION_LIST =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.30)(PORT = 1523))
    )
  )
LIST2 =
(DESCRIPTION_LIST =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.30)(PORT = 1522))
    )
  )

LIST1 =
(DESCRIPTION_LIST =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.30)(PORT = 1521))
     (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
2、接着配置tnsname.ora在/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsname.ora添加如下内容。
ALL_LISTENER =
(
    DESCRIPTION=
   (ADDRESS_LIST =
    (ADDRESS =(PROTOCOL = TCP)(HOST = 192.168.1.30)(PORT = 1521))
    (ADDRESS =(PROTOCOL = TCP)(HOST = 192.168.1.30)(PORT = 1522))
    (ADDRESS =(PROTOCOL = TCP)(HOST = 192.168.1.30)(PORT = 1523))
    (ADDRESS =(PROTOCOL = TCP)(HOST = 192.168.1.31)(PORT = 1524))
    )
  (
     CONNECT_DATA=
   (SERVICE_NAME = orcl)
  )
)
3、启动并查看各监听状态[oracle@orcladmin]$lsnrctl start list1
[oracle@orcladmin]$lsnrctl start list2
[oracle@orcladmin]$lsnrctl start list3
[oracle@orcladmin]$lsnrctl start list4
[oracle@orcladmin]$lsnrctl status list1
[oracle@orcladmin]$lsnrctl status list2
[oracle@orcladmin]$lsnrctl status list3
[oracle@orcladmin]$lsnrctl status list4
说明:正常情况下orcl实例会被注册到list1,其余监听上没有任何服务与实例。

执行下面操作
SQL> alter system set local_listener=' ALL_LISTENER’;
SQL> alter system register;
再次查看各侦听器状态
[oracle@orcl admin]$ lsnrctl status list2

LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 17-MAY-2015 19:35:57

Copyright(c) 1991, 2013, Oracle.  All rightsreserved.

Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.30)(PORT=1522)))
STATUSof the LISTENER
------------------------
Alias                     list2
Version                   TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate                17-MAY-2015 17:02:56
Uptime                    0 days 2 hr. 33 min. 1 sec
TraceLevel               off
Security                  ON: Local OS Authentication
SNMP                      OFF
ListenerParameter File  /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
ListenerLog File        /u01/app/oracle/diag/tnslsnr/orcl/list2/alert/log.xml
ListeningEndpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.lineqi.com)(PORT=1522)))
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...
Thecommand completed successfully
[oracle@orcl admin]$ lsnrctl status list3

LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 17-MAY-2015 19:35:55

Copyright(c) 1991, 2013, Oracle.  All rightsreserved.

Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.30)(PORT=1523)))
STATUSof the LISTENER
------------------------
Alias                     list3
Version                   TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate                17-MAY-2015 19:16:16
Uptime                    0 days 0 hr. 19 min. 38 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
ListenerParameter File  /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
ListenerLog File        /u01/app/oracle/diag/tnslsnr/orcl/list3/alert/log.xml
ListeningEndpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.30)(PORT=1523)))
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...
Thecommand completed successfully
[oracle@orcl admin]$ lsnrctl status list4

LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 17-MAY-2015 19:35:59

Copyright(c) 1991, 2013, Oracle.  All rightsreserved.

Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.31)(PORT=1524)))
STATUSof the LISTENER
------------------------
Alias                     list4
Version                   TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate                17-MAY-2015 19:16:14
Uptime                    0 days 0 hr. 19 min. 45 sec
TraceLevel               off
Security                  ON: Local OS Authentication
SNMP                      OFF
ListenerParameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
ListenerLog File        /u01/app/oracle/diag/tnslsnr/orcl/list4/alert/log.xml
ListeningEndpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.31)(PORT=1524)))
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...
Thecommand completed successfully

4、通过客户端测试C:\Users\Administrator>sqlpluslineqi/lineqi@192.168.1.30:1521/orcl

SQL*Plus:Release 11.2.0.1.0 Production on 星期日 5月 17 19:38:38 2015

Copyright(c) 1982, 2010, Oracle.  All rightsreserved.


连接到:
OracleDatabase 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl

C:\Users\Administrator>sqlpluslineqi/lineqi@192.168.1.30:1522/orcl

SQL*Plus:Release 11.2.0.1.0 Production on 星期日 5月 17 19:38:55 2015

Copyright(c) 1982, 2010, Oracle.  All rightsreserved.


连接到:
OracleDatabase 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl

C:\Users\Administrator>sqlpluslineqi/lineqi@192.168.1.30:1523/orcl

SQL*Plus:Release 11.2.0.1.0 Production on 星期日 5月 17 19:39:08 2015

Copyright(c) 1982, 2010, Oracle.  All rightsreserved.

连接到:
OracleDatabase 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl
C:\Users\Administrator>sqlpluslineqi/lineqi@192.168.1.31:1524/orcl

SQL*Plus:Release 11.2.0.1.0 Production on 星期日 5月 17 19:41:11 2015

Copyright(c) 1982, 2010, Oracle.  All rightsreserved.


连接到:
OracleDatabase 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl
上面是通过EZCONNECT方式来测试的,也可以在客户端配置来测试,在tnsname.ora添加如下内容。
orcl=
  (DESCRIPTION =
   (ADDRESS_LIST =
         (LOAD_BALANCE=ON)
         (FAILOVER=ON)
       (ADDRESS= (PROTOCOL = TCP)(HOST = 192.168.1.30)(PORT = 1521))
       (ADDRESS= (PROTOCOL = TCP)(HOST = 192.168.1.30)(PORT = 1522))
       (ADDRESS= (PROTOCOL = TCP)(HOST = 192.168.1.30)(PORT = 1523))
       (ADDRESS= (PROTOCOL = TCP)(HOST = 192.168.1.31)(PORT = 1524))
    )
   (CONNECT_DATA =
     (SERVICE_NAME = orcl)
    )
  )
二、在一个网接口的不同端口监听多个实例说明:192.168.1.30:1521监听orcl实例
           192.168.1.30:1522监听test实例
目前是1521这个端口监听着两个实例[oracle@orcl admin]$ lsnrctl status list1

LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 17-MAY-2015 17:00:27

Copyright(c) 1991, 2013, Oracle.  All rightsreserved.

Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl.lineqi.com)(PORT=1521)))
STATUSof the LISTENER
------------------------
Alias                     list1
Version                   TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate                17-MAY-2015 15:45:52
Uptime                    0 days 1 hr. 14 min. 35 sec
TraceLevel               off
Security                  ON: Local OS Authentication
SNMP                      OFF
ListenerParameter File  /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
ListenerLog File        /u01/app/oracle/diag/tnslsnr/orcl/list1/alert/log.xml
ListeningEndpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.lineqi.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
ServicesSummary...
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...
Service "test" has 1 instance(s).
  Instance"test", status READY, has 1 handler(s) for this service...
Service "testXDB" has 1 instance(s).
  Instance"test", status READY, has 1 handler(s) for this service...
Thecommand completed successfully

1、配置listener这里配置list2监听即可,可以通过netca工具,也可直接编辑listener.ora文件
[oracle@orcl 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.

LIST2 =
(DESCRIPTION_LIST =
    (DESCRIPTION=
      (ADDRESS =(PROTOCOL = TCP)(HOST = orcl.lineqi.com)(PORT = 1522))
    )
  )

LIST1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST =orcl.lineqi.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY =EXTPROC1521))
    )
  )

ADR_BASE_LIST2 = /u01/app/oracle

ADR_BASE_LIST1= /u01/app/oracle

[oracle@orcl admin]$ lsnrctl start list2

LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 17-MAY-2015 17:02:56

Copyright(c) 1991, 2013, Oracle.  All rightsreserved.

Starting/u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNRfor Linux: Version 11.2.0.4.0 - Production
Systemparameter file is/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Logmessages written to /u01/app/oracle/diag/tnslsnr/orcl/list2/alert/log.xml
Listeningon: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.lineqi.com)(PORT=1522)))

Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl.lineqi.com)(PORT=1522)))
STATUSof the LISTENER
------------------------
Alias                     list2
Version                   TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate                17-MAY-2015 17:02:56
Uptime                    0 days 0 hr. 0 min. 0 sec
TraceLevel               off
Security                  ON: Local OS Authentication
SNMP                      OFF
ListenerParameter File  /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
ListenerLog File         /u01/app/oracle/diag/tnslsnr/orcl/list2/alert/log.xml
ListeningEndpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.lineqi.com)(PORT=1522)))
Thelistener supports no services
Thecommand completed successfully
此时没有监听任何服务或实例
2、接着配置tnsname.ora[oracle@orcl admin]$ cat tnsnames.ora
ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.30)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
test =
  (DESCRIPTION =
   (ADDRESS_LIST =
      (ADDRESS =(PROTOCOL = TCP)(HOST = 192.168.1.30)(PORT = 1522))
    )
   (CONNECT_DATA =
     (SERVICE_NAME = test)
    )
  )
执行下面操作
SQL> alter system set local_listener='test';
SQL> alter system register;
接着查看list2状态发现实例已经注册成功了

[oracle@orcladmin]$ lsnrctl status list2

LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 17-MAY-2015 17:06:04

Copyright(c) 1991, 2013, Oracle.  All rightsreserved.

Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl.lineqi.com)(PORT=1522)))
STATUSof the LISTENER
------------------------
Alias                     list2
Version                   TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate                17-MAY-2015 17:02:56
Uptime                    0 days 0 hr. 3 min. 7 sec
TraceLevel               off
Security                  ON: Local OS Authentication
SNMP                      OFF
ListenerParameter File  /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
ListenerLog File        /u01/app/oracle/diag/tnslsnr/orcl/list2/alert/log.xml
ListeningEndpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.lineqi.com)(PORT=1522)))
ServicesSummary...
Service"test" has 1 instance(s).
  Instance "test", status READY, has1 handler(s) for this service...
Service"testXDB" has 1 instance(s).
  Instance "test", status READY, has1 handler(s) for this service...
Thecommand completed successfully
现在查看list1发现1521这个商品只监听orcl实例
[oracle@orcladmin]$ lsnrctl status list1

LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 17-MAY-2015 17:06:47

Copyright(c) 1991, 2013, Oracle.  All rightsreserved.

Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl.lineqi.com)(PORT=1521)))
STATUSof the LISTENER
------------------------
Alias                     list1
Version                   TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate                17-MAY-2015 15:45:52
Uptime                    0 days 1 hr. 20 min. 54 sec
TraceLevel               off
Security                  ON: Local OS Authentication
SNMP                      OFF
ListenerParameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
ListenerLog File        /u01/app/oracle/diag/tnslsnr/orcl/list1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.lineqi.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
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
3、通过客户端测试C:\Users\Administrator>sqlplussystem/test@192.168.1.30:1522/test

SQL*Plus:Release 11.2.0.1.0 Production on 星期日 5月 17 17:09:52 2015

Copyright(c) 1982, 2010, Oracle.  All rightsreserved.


连接到:
OracleDatabase 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options

SQL>select instance_name from v$instance;

INSTANCE_NAME
----------------
Test

C:\Users\Administrator>sqlpluslineqi/lineqi@192.168.1.30:1521/orcl

SQL*Plus:Release 11.2.0.1.0 Production on 星期日 5月 17 17:09:34 2015

Copyright(c) 1982, 2010, Oracle.  All rightsreserved.


连接到:
OracleDatabase 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options

SQL>select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl

三、在两个网络接口上分别配置监听器监听两个实例说明:192.168.1.30:1521监听orcl实例
           192.168.1.31:1522监听test实例
实例orcl创建好list1监听后已经被监听了,这里直接配置list2监听即可。
[oracle@orcl admin]$ lsnrctl status list1

LSNRCTL for Linux: Version 11.2.0.4.0 -Production on 17-MAY-2015 16:41:25

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl.lineqi.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     list1
Version                   TNSLSNR for Linux: Version11.2.0.4.0 - Production
Start Date                17-MAY-2015 15:45:52
Uptime                    0 days 0 hr. 55 min. 32 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/app/oracle/diag/tnslsnr/orcl/list1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.lineqi.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service"orcl" has 1 instance(s).
  Instance "orcl", status READY, has1 handler(s) for this service...
Service"orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has1 handler(s) for this service...
Thecommand completed successfully
1、配置listener这里配置list2监听即可,可以通过netca工具,也可直接编辑listener.ora文件
[oracle@orcl 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.

LIST2 =
(DESCRIPTION_LIST =
    (DESCRIPTION=
      (ADDRESS =(PROTOCOL = TCP)(HOST = 192.168.1.31)(PORT = 1522))
    )
  )

LIST1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST =orcl.lineqi.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY =EXTPROC1521))
    )
  )

ADR_BASE_LIST2 = /u01/app/oracle

ADR_BASE_LIST1= /u01/app/oracle
2、接着配置tnsname.ora[oracle@orcl admin]$ cat tnsnames.ora
ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.30)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
test =
  (DESCRIPTION =
   (ADDRESS_LIST =
      (ADDRESS =(PROTOCOL = TCP)(HOST = 192.168.1.31)(PORT = 1522))
    )
   (CONNECT_DATA =
     (SERVICE_NAME = test)
    )
  )
3、启动list2并查看状态
[oracle@orcl admin]$ lsnrctl startlist2
[oracle@orcl admin]$ lsnrctl status list2

LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 17-MAY-2015 16:06:55

Copyright(c) 1991, 2013, Oracle.  All rightsreserved.

Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.31)(PORT=1522)))
STATUSof the LISTENER
------------------------
Alias                     LIST2
Version                   TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate                17-MAY-2015 15:57:56
Uptime                    0 days 0 hr. 8 min. 58 sec
TraceLevel               off
Security                  ON: Local OS Authentication
SNMP                      OFF
ListenerParameter File  /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
ListenerLog File        /u01/app/oracle/diag/tnslsnr/orcl/list2/alert/log.xml
ListeningEndpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.lineqi.com)(PORT=1522)))
Thelistener supports no services
Thecommand completed successfully
这里发现没任何服务或实例被监听
执行下面操作
SQL>alter system set local_listener='test';
SQL>alter system register;
接着查看list2状态发现实例已经注册成功了
[oracle@orcl admin]$ lsnrctl status list2

LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 17-MAY-2015 16:08:03

Copyright(c) 1991, 2013, Oracle.  All rightsreserved.

Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.31)(PORT=1522)))
STATUSof the LISTENER
------------------------
Alias                     LIST2
Version                   TNSLSNR for Linux: Version11.2.0.4.0 - Production
StartDate                17-MAY-2015 15:57:56
Uptime                    0 days 0 hr. 10 min. 7 sec
TraceLevel               off
Security                 ON: Local OSAuthentication
SNMP                      OFF
ListenerParameter File  /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
ListenerLog File        /u01/app/oracle/diag/tnslsnr/orcl/list2/alert/log.xml
ListeningEndpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.lineqi.com)(PORT=1522)))
ServicesSummary...
Service"test" has 1 instance(s).
  Instance "test", status READY, has1 handler(s) for this service...
Service"testXDB" has 1 instance(s).
  Instance "test", status READY, has1 handler(s) for this service...
Thecommand completed successfully
4、通过客户端测试C:\Users\Administrator>sqlplussystem/test@192.168.1.31:1522/test

SQL*Plus:Release 11.2.0.1.0 Production on 星期日 5月 17 16:21:09 2015

Copyright(c) 1982, 2010, Oracle.  All rightsreserved.


连接到:
OracleDatabase 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options

SQL>select instance_name from v$instance;

INSTANCE_NAME
----------------
test


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-67996-1-1.html 上篇帖子: Oracle 11gR2 RAC集群服务启动与关闭总结 下篇帖子: 重装系统后,oracle11g数据库恢复(原oracle安装目录还在) listener oracle 接口 网络
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表