Monitor configuration file path: $ ORACLE_HOME / NETWORK / ADMIN / listener.ora
Static listening : If you know the information in the database, you can configure in good listener file inside the instance name of the database to monitor and configure the server name, which is still listening, because this listener server is initiated by the listener, so the state has been It is UNKNOWN , and shut down the database listener will continue to exist;
=== static configuration file listener.ora
[oracle@microserver02 admin]$ vi listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.5.4.69)(PORT = 1527))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME =XIAMEN01)
(ORACLE_HOME =/u01/app/oracle/product/12.2.0/dbhome_1)
(SID_NAME =testdb)
)
(SID_DESC =
(GLOBAL_DBNAME =XIAMEN)
(ORACLE_HOME =/u01/app/oracle/product/12.2.0/dbhome_1)
(SID_NAME =testdb)
)
)
Dynamic monitor : monitor information file does not monitor database configuration, but when the database is started, it will automatically instance_name, service_names two parameters instance and service to dynamically register listener, this monitor is a dynamic listening, because this listener from database launched, this time listening certainly by the corresponding database, so the status display is READY , turn off the monitor when the database will disappear. pmon database startup to mount or open, dynamic read service_names values from the parameter file. service_names may be a multi-value (there may be 64, including two of the system). service_names default for the establishment of a global database name when the database, the default port 1521 to register.
=== 1, the configuration file listener.ora
[oracle@microserver02 admin]$ vi listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.5.4.69)(PORT = 1527))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
=== 2, to create a non-default and non-default port service name:
SQL> = WMH the ALTER System SERVICE_NAMES the SET, hcc;
--- non-default service name, but it will have the default name of a data service
SQL> alter system set LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=10.5.4.69)(PORT=1527))';
--- monitor the dynamic registration, a non-default port 1521
SQL> !lsnrctl reload
--- listening to reload configuration
SQL> alter system register;
--- dynamic registration of new services, should not have to wait pmon process automatically register the new service after 1 minute.
=== view the database monitor the situation
[oracle @ microserver02 admin] $ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 22-AUG-2019 21:54:09
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.5.4.69)(PORT=1527)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 22-AUG-2019 20:09:18
Uptime 0 days 1 hr. 44 min. 50 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/microserver02/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.5.4.69)(PORT=1527)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "HCC" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "WMH" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "XIAMEN" has 1 instance(s).
Instance "testdb", status UNKNOWN, has 1 handler(s) for this service...
Service "XIAMEN01" has 1 instance(s).
Instance "testdb", status UNKNOWN, has 1 handler(s) for this service...
Service "testdb" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testdbXDB" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
The command completed successfully
=== test the following services are connected to the OK
[@ microserver02 the Oracle ~] $ sqlplus scott/[email protected]: 1527 / xiamen01
[microserver02 the Oracle @ ~] $ sqlplus scott/[email protected]: 1527 / xiamen
[ ~ @ microserver02 Oracle] $ sqlplus scott/[email protected]: 1527 / HCC
[Oracle @ microserver02 ~] $ sqlplus scott/[email protected]: 1527 / WMH
[Oracle @ microserver02 ~] $ sqlplus scott/[email protected] .4.69: 1527 / testdb
Focus On Technology,Thanks To My Family And Friends !
--- Elegent_Shu ---