Get the App
SLTechnology News&Howtos  ›  Database  › 

How to create non-1521 port snooping by Oracle

Shulou Source: shulou.com Published: 2022-05-31 15:14:35 10月03日 Update

Editor to share with you how to create Oracle non-1521 port monitoring, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!

Existing listening file configuration

Click (here) to collapse or open

[oracle@test-db 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 = test-db) (PORT = 1521))

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

)

)

ADR_BASE_LISTENER = / u01/app/oracle

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME=orcl)

(ORACLE_HOME = / u01/app/oracle/product/11.2.0/dbhome_1)

(SID_NAME = orcl)

)

)

Current monitoring status

Click (here) to collapse or open

[oracle@test-db admin] $lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0-Production on 04-APR-2018 00:09:29

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

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=test-db) (PORT=1521)

STATUS of the LISTENER

-

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.3.0-Production

Start Date 03-APR-2018 23:30:31

Uptime 0 days 0 hr. 38 min. 57 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/test-db/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=test-db) (PORT=1521))

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1521)

Services Summary...

Service "orcl" has 1 instance (s).

Instance "orcl", status UNKNOWN, 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 "primary_orcl" has 1 instance (s).

Instance "orcl", status READY, has 1 handler (s) for this service...

The command completed successfully

-- separation line--

Add the listening of port 1522 to the listener.ora file, and the contents of the added file are as follows

Click (here) to collapse or open

[oracle@test-db 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 = test-db) (PORT = 1521))

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

)

)

ADR_BASE_LISTENER = / u01/app/oracle

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME=orcl)

(ORACLE_HOME = / u01/app/oracle/product/11.2.0/dbhome_1)

(SID_NAME = orcl)

)

)

# 1522

MY_LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = test-db) (PORT = 1522))

(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1522))

)

)

# for registering services on port 1522

SID_LIST_MY_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME=orcl)

(ORACLE_HOME = / u01/app/oracle/product/11.2.0/dbhome_1)

(SID_NAME = orcl)

)

)

Start port 1522 snooping

Click (here) to collapse or open

[oracle@test-db admin] $lsnrctl start my_listener

LSNRCTL for Linux: Version 11.2.0.3.0-Production on 04-APR-2018 00:16:18

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

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

TNSLSNR for Linux: Version 11.2.0.3.0-Production

System parameter file is / u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Log messages written to / u01/app/oracle/diag/tnslsnr/test-db/my_listener/alert/log.xml

Listening on: (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=test-db) (PORT=1522)

Listening on: (DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1522)

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=test-db) (PORT=1522)

STATUS of the LISTENER

-

Alias my_listener

Version TNSLSNR for Linux: Version 11.2.0.3.0-Production

Start Date 04-APR-2018 00:16:18

Uptime 0 days 0 hr. 0 min. 0 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/test-db/my_listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=test-db) (PORT=1522))

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1522)

Services Summary...

Service "orcl" has 1 instance (s).

Instance "orcl", status UNKNOWN, has 1 handler (s) for this service...

The command completed successfully

Use the PLSQL Developer tool to test that you can connect properly.

-Segmentation line-

Another way to register a server on port 1522 is to use a tnsnames.ora file

After removing the code for SID_LIST_MY_LISTENER static registration in listener.ora, restarting my_listener snooping found that there was no service registration.

Click (here) to collapse or open

[oracle@test-db admin] $lsnrctl start my_listener

LSNRCTL for Linux: Version 11.2.0.3.0-Production on 04-APR-2018 00:18:08

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

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

TNSLSNR for Linux: Version 11.2.0.3.0-Production

System parameter file is / u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Log messages written to / u01/app/oracle/diag/tnslsnr/test-db/my_listener/alert/log.xml

Listening on: (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=test-db) (PORT=1522)

Listening on: (DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1522)

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=test-db) (PORT=1522)

STATUS of the LISTENER

-

Alias my_listener

Version TNSLSNR for Linux: Version 11.2.0.3.0-Production

Start Date 04-APR-2018 00:18:08

Uptime 0 days 0 hr. 0 min. 0 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/test-db/my_listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=test-db) (PORT=1522))

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1522)

The listener supports no services

The command completed successfully

Add the following code to the tnsnames.ora file

Click (here) to collapse or open

My_orcl =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = test-db) (PORT = 1522))

(ADDRESS = (PROTOCOL = TCP) (HOST = test-db) (PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

Note: if you do not add the paragraph (ADDRESS = (PROTOCOL = TCP) (HOST = test-db) (PORT = 1521)), there will be no service registration in the default 1521 port

Log in to the database to set local_listener parameters

Click (here) to collapse or open

Alter system set local_listener='my_orcl' scope=both

Use the command to check the monitoring status separately

Click (here) to collapse or open

[oracle@test-db admin] $lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0-Production on 04-APR-2018 00:32:38

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

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=test-db) (PORT=1521)

STATUS of the LISTENER

-

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.3.0-Production

Start Date 03-APR-2018 23:30:31

Uptime 0 days 1 hr. 2 min. 6 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/test-db/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=test-db) (PORT=1521))

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1521)

Services Summary...

Service "orcl" has 1 instance (s).

Instance "orcl", status UNKNOWN, 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 "primary_orcl" has 1 instance (s).

Instance "orcl", status READY, has 1 handler (s) for this service...

The command completed successfully

[oracle@test-db admin] $lsnrctl status my_listener

LSNRCTL for Linux: Version 11.2.0.3.0-Production on 04-APR-2018 00:32:45

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

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=test-db) (PORT=1522)

STATUS of the LISTENER

-

Alias my_listener

Version TNSLSNR for Linux: Version 11.2.0.3.0-Production

Start Date 04-APR-2018 00:18:08

Uptime 0 days 0 hr. 14 min. 37 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/test-db/my_listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=test-db) (PORT=1522))

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1522)

Services Summary...

Service "orclXDB" has 1 instance (s).

Instance "orcl", status READY, has 1 handler (s) for this service...

Service "primary_orcl" has 1 instance (s).

Instance "orcl", status READY, has 1 handler (s) for this service...

The command completed successfully

Use the PLSQL Developer tool to test that you can connect properly.

The above is all the content of the article "how Oracle creates non-1521 port snooping". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Monitoring ports files services content articles code tools status testing not much lieutenant general split lines parameters commands most that is data databases methods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Xiaomi Redmi Huawei NVidia