Get the App
SLTechnology News&Howtos  ›  Database  › 

Lisenter cannot monitor the service after changing the hostname

Shulou Source: shulou.com Published: 2022-06-01 18:31:47 09月30日 Update

Lisenter cannot monitor the service after changing the hostname

Environment description, linux redhat5.4 + oracle 11.2.0.1

Hostname: zky.zhan

Host ip:192.168.214.10

Instance SID:zky

Problem presentation

If you change the listening address (HOST = zky.zhan) parameter in listenter.ora to the listening host network address (HOST = 192.168.214.10). The discovery service cannot listen to the server, displays no server all the time, and cannot log in to the database through the network service.

View tnsname.ora parameters

[oracle@zky /] $cat / u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora

# tnsnames.ora Network Configuration File: / u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

ZKY =

(DESCRIPTION =

(ADDRESS_LIST =

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

)

(CONNECT_DATA =

(SERVICE_NAME = zky)

)

)

View listener.ora parameters

We changed the default zky.zhan to the ip address

[oracle@zky /] $cat / u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

# listener.ora Network Configuration File: / u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora

# Generated by Oracle configuration tools.

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER1 = ON

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

# (ADDRESS = (PROTOCOL = TCP) (HOST = zky.zhan) (PORT = 1521)

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

)

)

ADR_BASE_LISTENER = / u01/app/oracle

Initiate monitoring

Found The listener supports no services, unable to listen to the service all the time

[oracle@zky /] $lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0-Production on 24-APR-2016 05:34:11

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

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

TNSLSNR for Linux: Version 11.2.0.1.0-Production

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

Log messages written to / u01/app/oracle/diag/tnslsnr/zky/listener/alert/log.xml

Listening on: (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=192.168.214.10) (PORT=1521)

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

STATUS of the LISTENER

-

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.1.0-Production

Start Date 24-APR-2016 05:34:11

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/grid/network/admin/listener.ora

Listener Log File / u01/app/oracle/diag/tnslsnr/zky/listener/alert/log.xml

Listening Endpoints Summary...

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

The listener supports no services

The command completed successfully

Database login also shows no monitoring

[oracle@zky /] $sqlplus system/oracle_4U@zky

SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 24 05:37:17 2016

Copyright (c) 1982, 2009, Oracle. All rights reserved.

ERROR:

ORA-12514: TNS:listener does not currently know of service requested in connect

Descriptor

Solution method

After days of entanglement, it was found that the default resolution was 127.0.0.1 when using the ping hostname zky.zhan. So after changing the local parsing 127.0.0.1 to 192.168.214.10 in the exploratory state, it is found that it can be used normally.

Change host

[root@zky /] # cat / etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

# 127.0.0.1 zky.zhan zky localhost.localdomain localhost

#:: 1 localhost6.localdomain6 localhost6

192.168.214.10 zky.zhan zky localhost.localdomain localhost

After restarting the monitoring, the service listens to itself.

[oracle@zky /] $lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0-Production on 24-APR-2016 05:43:40

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

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

STATUS of the LISTENER

-

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.1.0-Production

Start Date 24-APR-2016 05:34:11

Uptime 0 days 0 hr. 9 min. 29 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File / u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora

Listener Log File / u01/app/oracle/diag/tnslsnr/zky/listener/alert/log.xml

Listening Endpoints Summary...

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

Services Summary...

Service "+ ASM" has 1 instance (s).

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

Service "zky" has 1 instance (s).

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

Service "zkyXDB" has 1 instance (s).

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

The command completed successfully

Log in to database successfully

[oracle@zky /] $sqlplus system/oracle_4U@zky

SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 24 05:44:59 2016

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

And Real Application Testing options

SQL > show parameter name

NAME TYPE VALUE

-

Db_file_name_convert string

Db_name string zky

Db_unique_name string zky

Global_names boolean FALSE

Instance_name string zky

Lock_name_space string

Log_file_name_convert string

Service_names string zky

Tags: Monitoring service host parameter address data database login network success multi-day instance method server status environment network service problem Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MariaDB MySQL OPPO Reno Apple