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

Example Analysis of listener Control Program lsnrctl tracking trace file

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

Share

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

The listener control program lsnrctl tracks the sample analysis of trace file. Aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Oracle listener is an independent database component, which plays a very important role in the whole system. Even on the windows platform, the listener listener is implemented as a separate process program.

In some network-related failures, listener-related failures account for a large part. To understand the working process of the listener and analyze the probability of problems in each link is what we often need to do when the listener fails. In this process, we need to use the listener trace function.

This article mainly describes how to use the lsnrctl tool to get the listener trace file (trace file) and the trace level obtained.

1. Environmental introduction

This time we choose 10g listeners to carry out the experiment.

Microsoft Windows XP [version 5.1.2600]

(C) copyright 1985-2001 Microsoft Corp.

C:\ Documents and Settings\ Administrator > lsnrctl

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0-Production on 19-December-2011 20:31:59

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

Welcome to LSNRCTL. Type "help" for information.

Note that lsnrctl is not a listener program itself, but a gadget controlled by the listener. With this tool, we can manipulate listener behavior and set listener parameters. The commands used by the Lsnrctl command line are simple.

LSNRCTL > help

The following actions are available

An asterisk (*) indicates a modifier or extension command:

Start stop status

Services version reload

Save_config trace change_password

Quit exit set*

Show*

At this point, the database has not been started. The listener is running.

LSNRCTL > status

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521)

STATUS of LISTENER

-

Alias LISTENER

Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0-Production

Launch date 19-December-2011 20:28:53

Uptime 0 days 0 hours 3 minutes 32 seconds

Trace level off

Security ON: Local OS Authentication

SNMP OFF

Listener parameter file D:\ oracle\ network\ admin\ listener.ora

Listener log file D:\ oracle\ network\ log\ listener.log

(for reasons of space, there are omissions. )

LSNRCTL >

At this point, there is no trace file output.

2. Simple trace file generation

Let's first introduce how to use the general monitoring and tracking method. This configuration is set from lsnrctl. In the lsnrctl configuration, there is something related to trace.

LSNRCTL > show

After show, the following operations are provided

An asterisk (*) indicates a modifier or extension command:

Rawmode displaymode

Rules trc_file

Trc_directory trc_level

Log_file log_directory

(for reasons of space, there are omissions. )

Among them, several parameters that begin with trc are obviously related to the generation of trace file operations. We can use the show command to display it.

-- tracking file name

LSNRCTL > show trc_file

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521)

LISTENER parameter "trc_file" is set to listener.trc

Command executed successfully

-- track the file directory

LSNRCTL > show trc_directory

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

LISTENER parameter "trc_directory" is set to D:\ oracle\ network\ trace

Command executed successfully

-- tracking degree

LSNRCTL > show trc_level

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

LISTENER parameter "trc_level" is set to off

Command executed successfully

With the above parameters, we can configure the location, name, and trace level of the trace file.

To turn on tracing, we can use the trace command. The specific format is as follows:

LSNRCTL > help trace

Trace OFF | USER | ADMIN | SUPPORT []: set tracing to the specif

Ied level

Note that we enable tracing at three levels, user, admin, and support. The specific meaning is as follows:

ü Off or a value of 0: does not enable tracing for the current listener

ü User or numeric 4:user trace information

ü Admin or numeric 10:administration trace information

ü Support or numeric 16:Oracle support Services trace information

Typically, we use the support level as a trace.

LSNRCTL > trace 12

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

Open trace file: d:\ oracle\ network\ trace\ listener.trc

LSNRCTL > show trc_level

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

LISTENER parameter "trc_level" is set to admin

Command executed successfully

From the returned information and status information, you can see that the listener is in a listening state at this time.

LSNRCTL > status

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521)

STATUS of LISTENER

-

Alias LISTENER

Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0-Production

Launch date 19-December-2011 20:28:53

Normal running time 0 days, 0 hours, 15 minutes, 5 seconds

Trace level admin

Security ON: Local OS Authentication

SNMP OFF

Listener parameter file D:\ oracle\ network\ admin\ listener.ora

Listener log file D:\ oracle\ network\ log\ listener.log

Listener trace file D:\ oracle\ network\ trace\ listener.trc

Listening Endpoint Summary.

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=www-0e6111dff74) (PORT=1521))

(for reasons of space, there are omissions. )

LSNRCTL >

In the process, we can try operations such as dynamic registration or new connection. Finally, turn off the listening.

LSNRCTL > trace off

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521)

Command executed successfully

LSNRCTL > status

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

STATUS of LISTENER

-

Alias LISTENER

Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0-Production

Launch date 19-December-2011 20:28:53

Uptime 0 days, 0 hours, 17 minutes, 16 seconds.

Trace level off

Security ON: Local OS Authentication

SNMP OFF

Listener parameter file D:\ oracle\ network\ admin\ listener.ora

Listener log file D:\ oracle\ network\ log\ listener.log

Listening Endpoint Summary.

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=www-0e6111dff74) (PORT=1521))

At this point, we go to the listening directory and find the listening file. Here is a snippet:

Nsglrespond: entry

Nsdo: cid=3, pcode=67, * bl=97, * what=1, uflgs=0x0, cflgs=0x3

Nsdo: rank=64, nsctxrnk=0

Nsdo: nsctx: state=8, flg=0x100400c, mvd=0

Nsdo: gtn=206, gtc=206, ptn=10, ptc=2011

Nsdo: 97 bytes to NS buffer

Nsdo: nsctxrnk=0

Nsglrespond: exit

Nsgldissolve: entry

Nstimarmed: no timer allocated

Nsdo: cid=3, pcode=66, * bl=0, * what=0, uflgs=0x0, cflgs=0x2

Nsdo: rank=64, nsctxrnk=0

Nsdo: nsctx: state=8, flg=0x1004008, mvd=0

Nsevunreg: cid=3, sgt=0, rdm=2

Each of the above records corresponds to the action information of the listener program. Of course, intuitively, it is not easy to read. We'll talk about how to read the contents of the surveillance tracking file later.

3. Monitoring and tracking files with time information

In the above section, we have obtained a simple trace file. But when we diagnose a problem, we usually want to get the execution time of each phase of the operation, so as to find the bottleneck of the problem.

For example, we find that the connection through the listener is slow, but the direct connection around the listener is very fast. It indicates that there are performance problems in one or more links in the connection operation. Which one exactly? Further interval judgment is still needed.

To get the time information, we need to configure two parameters in the listener.ora file.

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = www-0e6111dff74) (PORT = 1521))

)

)

TRACE_TIMESTAMP_LISTENER=true

TRACE_LEVEL_LISTENER=16

First, you need to add two parameter values to the parameter file listener.ora. Where trace_timestamp_ indicates whether the tracking time function is enabled. If set to true/on, it means that when the trace event is recorded, the specific time will be recorded.

The other parameter, trace_level_, indicates the trace level when the listener is started. For these two parameters to take effect, you need to reload or restart the listener.

LSNRCTL > start

Start tnslsnr: please wait a moment.

TNSLSNR for 32-bit Windows: Version 10.2.0.1.0-Production

The system parameter file is D:\ oracle\ network\ admin\ listener.ora

Write log information to D:\ oracle\ network\ log\ listener.log

Write trace information to D:\ oracle\ network\ trace\ listener.trc

Monitoring: (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=www-0e6111dff74) (PORT=1521)

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

STATUS of LISTENER

-

Alias LISTENER

Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0-Produ

Ction

Launch date 19-December-2011 21:47:12

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

Trace level support

Security ON: Local OS Authentication

SNMP OFF

Listener parameter file D:\ oracle\ network\ admin\ listener.ora

Listener log file D:\ oracle\ network\ log\ listener.log

Listener trace file D:\ oracle\ network\ trace\ listener.trc

(the reason for the length of the space, omit the part. )

LSNRCTL > trace 0

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

Command executed successfully

LSNRCTL > trace 16

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

Open trace file: d:\ oracle\ network\ trace\ listener.trc

Command executed successfully

The trace file generated at this time contains the following:

[19-12-2011 21-53 40-28] nsglrespond: entry

[19-12-2011 21-53 40-28] nsdo: entry

Nsdo: cid=5, pcode=67, * bl=97, * what=1, uflgs=0x0, cflgs=0x3

[19-12-2011 21 nsctxrnk=0 53 40 14] nsdo: rank=64, 281

Nsdo: nsctx: state=8, flg=0x100400c, mvd=0

[19-12-2011 21 / 53 / 40] nsdo: gtn=206, gtc=206, ptn=10, ptc=2011

[19-12-2011 21-53 40-28] nsdo: 97 bytes to NS buffer

[19-12-2011 21-53 40-28] nsdo: nsctxrnk=0

[19-12-2011 21-53 40-28] nsiooverflow: entry

[19-12-2011 21-53 40-28] nsdo: normal exit

[19-12-2011 21-53 40-28] nsglrespond: exit

[19-12-2011 21-53 40-28] nsgldissolve: entry

[19-12-2011 21-53 40-28] nsdisc: entry

[19-12-2011 21-53 40-28] nsclose: entry

Trace information recorded at the millisecond level.

The listener is a complex component involving networks, Oracle instances, connections, clients, and Oracle Net. Many of the problems we encounter have more or less to do with listeners. Mastering trace files is very important for listener diagnosis.

This is the answer to the sample analysis question about the listener control program lsnrctl tracking trace file. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

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

Servers

Wechat

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

12
Report