快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

oracle配置多网络接口多端口listener

环境:oracle 11.2.0.4

天峨网站制作公司哪家好,找创新互联!从网页设计、网站建设、微信开发、APP开发、响应式网站设计等网站项目制作,到程序开发,运营维护。创新互联从2013年成立到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联。

两个数据库实例: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)

 

eth2      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

 


网站栏目:oracle配置多网络接口多端口listener
当前路径:http://6mz.cn/article/isgjoe.html

其他资讯