Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[LISTENER] one database configures two listening port numbers

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Test environment: windows2008R2 Oracle11.2.0.1-oracle11.2.0.4

If a listening port finds that the pressure is too high, or if you want to test the effectiveness of the next two listening ports, you can use the following method.

The first way:

The listener.ora configuration is as follows:

Click (here) to collapse or open

Listener.ora

# listener.ora Network Configuration File: C:\ app\ Administrator\ product\ 11.2.0\ dbhome_1\ NETWORK\ ADMIN\ listener.ora

# Generated by Oracle configuration tools.

LISTENER1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.8.16) (PORT = 1522))

)

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = CLRExtProc)

(ORACLE_HOME = C:\ app\ Administrator\ product\ 11.2.0\ dbhome_1)

(PROGRAM = extproc)

(ENVS = "EXTPROC_DLLS=ONLY:C:\ app\ Administrator\ product\ 11.2.0\ dbhome_1\ bin\ oraclr11.dll")

)

)

ADR_BASE_LISTENER1 = C:\ app\ Administrator\ product\ 11.2.0\ dbhome_1\ log

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.8.16) (PORT = 1521))

)

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521))

)

)

ADR_BASE_LISTENER = C:\ app\ Administrator

Two listeners, so the problem is, they are both dynamic registrations, how can they both take effect?

At this point, we need to configure the database server-side tnsnames.ora configuration file, as follows

Click (here) to collapse or open

ALL_LISTENER =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.8.16) (PORT = 1521))

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.8.16) (PORT = 1522))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

Do the following in the database:

Click (here) to collapse or open

SQL > alter system set local_listener=all_listener

The system has changed.

SQL > alter system register

The system has changed.

SQL >

Two listeners successfully test the connection to the database, as shown below:

Click (here) to collapse or open

SQL > conn test/test@orcl

Connected.

SQL > conn test/test@orcl1

Connected.

SQL >

Microsoft Windows [version 6.1.7600]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\ Users\ Administrator > lsnrctl stat

LSNRCTL for 64-bit Windows: Version 11.2.0.4.0-Production on 19-July-2017 12:

7:53

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

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=192.168.8.16) (PORT=1521)

STATUS of LISTENER

-

Alias LISTENER

Version TNSLSNR for 64-bit Windows: Version 11.2.0.4.0-Prod

Ction

Launch date 19-July-2017 12:04:02

Uptime 0 days, 0 hours, 13 minutes, 52 seconds.

Trace level off

Security ON: Local OS Authentication

SNMP OFF

Listener parameter file C:\ app\ Administrator\ product\ 11.2.0\ dbhome_1\ network\

Dmin\ listener.ora

Listener log file C:\ app\ Administrator\ diag\ tnslsnr\ wintest\ listener\ al

Rt\ log.xml

Listening Endpoint Summary.

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=192.168.8.16) (PORT=1521))

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (PIPENAME=\\.\ pipe\ EXTPROC1521ipc))

Service summary..

The service "CLRExtProc" contains 1 instance.

Instance "CLRExtProc", status UNKNOWN, contains 1 handler for this service.

The service "orcl" contains 1 instance.

Instance "orcl", status READY, contains 1 handler for this service.

The service "orclXDB" contains 1 instance.

Instance "orcl", status READY, contains 1 handler for this service.

Command executed successfully

C:\ Users\ Administrator > lsnrctl stat listener1

LSNRCTL for 64-bit Windows: Version 11.2.0.4.0-Production on 19-July-2017 12:

7:57

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

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=192.168.8.16) (PORT=1522)

STATUS of LISTENER

-

Alias listener1

Version TNSLSNR for 64-bit Windows: Version 11.2.0.4.0-Prod

Ction

Launch date 19-July-2017 12:11:58

Normal running time 0 days, 0 hours, 6 minutes, 1 second

Trace level off

Security ON: Local OS Authentication

SNMP OFF

Listener parameter file C:\ app\ Administrator\ product\ 11.2.0\ dbhome_1\ network\

Dmin\ listener.ora

Listener log file C:\ app\ Administrator\ product\ 11.2.0\ dbhome_1\ log\ diag

Tnslsnr\ wintest\ listener1\ alert\ log.xml

Listening Endpoint Summary.

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=192.168.8.16) (PORT=1522))

Service summary..

The service "orcl" contains 1 instance.

Instance "orcl", status READY, contains 1 handler for this service.

The service "orclXDB" contains 1 instance.

Instance "orcl", status READY, contains 1 handler for this service.

Command executed successfully

C:\ Users\ Administrator >

There is another way: as follows

Click (here) to collapse or open

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = WIN-J351NF8VN9D) (PORT = 1521))

(ADDRESS = (PROTOCOL = TCP) (HOST = WIN-J351NF8VN9D) (PORT = 1522))

(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521))

)

Note that in the first method, the original monitoring does not need to be operated, while in the above method, you need to restart the listening.

The effect after reboot:

Click (here) to collapse or open

C:\ Users\ Administrator > lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.1.0-Production on 20-July-2017 22:5

3:38

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

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=WIN-J351NF8VN9D) (PORT=1521))

))

STATUS of LISTENER

-

Alias LISTENER

Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0-Produ

Ction

Launch date 20-July-2017 22:53:17

Uptime 0 days, 0 hours, 0 minutes, 22 seconds.

Trace level off

Security ON: Local OS Authentication

SNMP OFF

Listener parameter file C:\ app\ Administrator\ product\ 11.2.0\ dbhome_1\ network\ a

Dmin\ listener.ora

Listener log file c:\ app\ administrator\ diag\ tnslsnr\ WIN-J351NF8VN9D\ list

Ener\ alert\ log.xml

Listening Endpoint Summary.

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=WIN-J351NF8VN9D) (PORT=1521))

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=WIN-J351NF8VN9D) (PORT=1522))

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (PIPENAME=\\.\ pipe\ EXTPROC1521ipc))

Service summary..

The service "CLRExtProc" contains 1 instance.

Instance "CLRExtProc", status UNKNOWN, contains 1 handler for this service.

The service "orcl" contains 1 instance.

Instance "orcl", status READY, contains 1 handler for this service.

The service "orclXDB" contains 1 instance.

Instance "orcl", status READY, contains 1 handler for this service.

Command executed successfully

Under one listener, two port numbers.

So the question is, what's the difference between the two ways? One is two listeners, and the other is a listener with two port numbers.

Welcome to discuss!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report