Oracle Static and dynamic monitoring

Source: Internet
Author: User

When you run the status of the Lsnrctl command, you often see the following return values:

the Service "test" consists of 1 routines. Routine "MyData", State unkown, contains a handler for this service ... Service "A" consists of 1 routines. Routine "MyData", state ready, contains a handler for this service ...

Here, the status of Unkown is indicated as static registration (manually fill in the parameters);

records with the status of ready indicate dynamic registration (the Listener.ora parameter is automatically obtained from the parameter file by the Pmon process);  First, static registration

In the listener configuration, the global database name in the database service can write arbitrary content, regardless of the database, as long as the SID is correct to connect to the database.
Because of static registration, the parameters are manually statically added, regardless of the database. The database cannot confirm that the listener is configured correctly. Therefore, the status in Lsnrctl is displayed as Unkown. There is no guarantee that the database can be connected.
Note: Static registration monitoring, when the client configures the Tnsnames.ora service naming, the "(Oracle 8i or later) service name" is filled with the same name as the global database when the server registers the listener statically. Otherwise, connectivity is not possible.

Lsnrctl is shown in the following
the Service "test" consists of 1 routines. Routine "MyData", State unkown, contains a handler for this service ...
Test is the value that is read from the "Global database name" in the database service (that is, the value of Global_dbname in the configuration file) from the listening configuration process, and "MyData" is the value (that is, the value of Sid_name) that the SID in the database service reads from the listening configuration.
Sid_list_listener = (sid_list = ( sid_desc = ( global_dbname = Test ) (oracle_home =/orahome/oracle/product/10.2.0/db_1) (sid_name = mydata )     )   )
when the client configures Tnsname, the service name (service_name) is test. Otherwise, you cannot connect to the database.
ABC = (DESCRIPTION = (address_list = ( ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.23) (PORT = 152 1 )) ) (connect_data = (service_name =
Test )     )   )
Here's ABC, named for the service. Can be any value that, when the client connects to the server, fills in the host string, which is named ABC for this service.   Second, dynamic registration
1, the default dynamic registration

Pmon dynamically reads the Service_names value from the parameter file when the database is booted to mount or open. The service_names can be multiple values.
Service_names defaults to the global database name for DBCA when the database is established.
Set the parameter service_names to ' A,b,c ', the command is as follows:
Alter system set service_names= ' A,b,c ';
The

The lsnrctl status is as follows:
service "Test" consists of 1 routines.    routine "MyData", State unkown, contains a handler for this service ... service "A" consists of 1 routines.    routine "MyData", state ready, contains a handler for this service ... service "B" consists of 1 routines.    routine "MyData", state ready, contains a handler for this service ... service "C" consists of 1 routines.    routine "MyData", state ready, contains a handler for this service ... service "mydata.ccddt.cn" contains a routine.    routine "MyData", state ready, contains a handler for this service ...


The above service name A, B, C, mydata.ccddt.cn are ready, for dynamic registration.
Here is the last "mydata.ccddt.cn", is the Pmon default dynamically registered to the listener.
Note: Regardless of the value of the parameter service_names, Pmon automatically registers a listener with the global database name (mydata.ccddt.cn here) as the service name.
By default, the port number must be 1521 if dynamic registration monitoring is enabled. If you enable dynamic listener registration for other ports, you must configure the configuration.

By looking at V$session, a connection with a status of Sys$users is connected to the server through a static registration listener.

2, the custom port dynamic monitoring registration
To enable dynamic listener registration for non-default port 1521, the default state is that Oracle does not register dynamically. To enable dynamic registration, you must set the Local_listener parameter. and configure Tnsnames.ora on the server side to specify the listening parameters, or directly by modifying the Local_listener to specify the listening parameters. The steps are as follows:
1) Service side
Netmgr, configuring the listener, listening port is 1525 (not the default port)

Save Configuration

2), specify the listening parameters

(1) Act 1: Specify directly by modifying the Local_listener parameter

sql>alter system set local_listener='(address= (protocol=tcp) (host=192.168.1.23) ( port=1525)) ';
System altered

sql> alter system Register

  System Altered (2) Law 2: Establish $oracle_home/network/admin/tnsnames.ora on the ORACLE server side. Parse the file, location and fill in the following content
mytest = (DESCRIPTION =
(Address_list =
(Address= (protocol=tcp) (HOST = 192.168.1.23) (PORT = 1525))
)
)
The mytest here can also be modified to other strings, depending on their needs. such as a or B. sets the parameters, specifying the listening parameters through the information in the Tnsnames.ora sql> alter system set local_listener=mytest;
System Altered sql> alter system register;

3. View Listener Status

lsnrctl> status
Connecting to (Description= (address= (protocol=tcp) (host=192.168.1.23) (port=1525)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version Tnslsnr for Linux:version 10.2.0.1.0-production
Start Date 15-mar-2011 10:43:47
Uptime 0 days 0 hr. 0 min. $ sec
Trace level off
Security on:local OS Authentication
SNMP OFF
Listener Parameter File/orahome/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File/orahome/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary ...
(Description= (address= (protocol=tcp) (Host=oraserver) (port=1525)))
Services Summary ...
Service "A" has 1 instance (s).
Instance "MyData", status ready, have 1 handler (s) for the This service ...
Service "B" has 1 instance (s).
Instance "MyData", status ready, have 1 handler (s) for the This service ...
Service "C" has 1 instance (s).
Instance "MyData", status ready, have 1 handler (s) for the This service ...
Service "MyData" has 1 instance (s).
Instance "MyData", status ready, have 1 handler (s) for the This service ...
Service "Mydataxdb" has 1 instance (s).
Instance "MyData", status ready, have 1 handler (s) for the This service ...
Service "MYDATA_XPT" has 1 instance (s).
Instance "MyData", status ready, have 1 handler (s) for the This service ...
The command completed successfully

Oracle Static and dynamic monitoring

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.