Home » RDBMS Server » Server Administration » how to setup an application trace
how to setup an application trace [message #56541] Mon, 07 April 2003 14:18 Go to next message
Eugene
Messages: 44
Registered: August 2001
Member
Hi all,
I have a custom invoice print app (VB). For some unknown reason, it will not print certain invoices. I need to know wny? Is there a way for me to setup a trace to catch the statement that is running?
How can I do it? Can someone, please, give me steps to set it up?
Thanks,
Re: how to setup an application trace [message #56550 is a reply to message #56541] Tue, 08 April 2003 05:11 Go to previous messageGo to next message
Uwe
Messages: 260
Registered: February 2003
Location: Zürich, Switzerland
Senior Member
If this app connect via ODBC you can set up the Client Traces. This is an extract from metalink.oracle.com technote 16658.1

7.2 Client Tracing ~~~~~~~~~~~~~~ For client TOOLS edit or create the file $HOME/.sqlnet.ora and add the lines: trace_level_client=16 trace_file_client=cli trace_directory_client=/tmp # Or a known directory trace_unique_client=true # Add '_pid' to trace filename trace_timestamp_client=ON # Only in Oracle8i onwards This will turn on FULL tracing for your user account only producing output in a file called /tmp/cli_<PID>.trc . (For some SQL*Net versions the file will be just /tmp/cli.trc) For client 'ORACLE' process (as in the case of database links) put this same information into $TNS_ADMIN/sqlnet.ora file. On versions up to and including Oracle 7.0.16 client trace may not add a process ID to the name of the trace file. This means two processes may end up writing to the same trace file unless you take care to control which processes write trace output to each file. 7.3 Listener Tracing ~~~~~~~~~~~~~~~~ Listener tracing can ONLY be configured in the listener.ora file. Add the lines below to the listener.ora file: trace_level_listener=16 trace_file_listener=listener trace_directory_listener=/tmp # Or a known directory This will define FULL listener tracing to the file /tmp/listener.trc. You can enable this tracing by either: lsnrctl reload OR lsnrctl stop; lsnrctl start; TCP/IP ~~~~~~ It is often useful to confirm that a listener is listening on a specified address. Most Unix machines include a command called 'netstat' (Often in /etc or in /usr/etc). The command netstat -a should list all TCP/IP end points on which a listener is listening. Eg: For a listener listening on HOST=... PORT=1580 there should be a netstat entry of the form: RecvQ SendQ Local Address Foreign Address TCP state 0 0 *.1580 *.* LISTEN Note: Some versions of netstat will only list established connections and not listen end points. See the man page on your machine. 7.4 Server Tracing ~~~~~~~~~~~~~~ Server side trace is not required as often as the other two traces mainly because most problems are related to establishing a connection. Once a connection has been established the client and server processes are communicating. It is sometimes useful to see exactly what SQL commands have been received by the server, and what data it has sent back out. The file $TNS_ADMIN/sqlnet.ora controls the server side tracing. Add the lines below to this file: trace_level_server=16 trace_file_server=server trace_directory_server=/tmp # Or a known directory trace_timestamp_server=ON # Only in Oracle8i onwards Output should be sent to the file /tmp/server_<PID>.trc Note: Server side tracing acts on the SQL*Net server side. For dedicated connections this is the Oracle process on the server machine. For MTS connections this is the DISPATCHER and NOT the shared server. Data is passed between the dispatcher and the shared servers via the SGA and this does NOT involve SQL*Net. It is also important to note that as a dispatcher handles several client processes the dispatcher trace output can be a mix of trace from many client processes making it VERY difficult to follow. The general advice for such problems is: a) See if the problem reproduces WITHOUT using MTS - if so the trace is much cleaner b) If a problem ONLY reproduces under MTS ensure the machine is in a controlled environment so you can be sure that only YOUR process is using the dispatcher.

regards

Uwe
Re: how to setup an application trace [message #56553 is a reply to message #56541] Tue, 08 April 2003 10:28 Go to previous message
Eugene
Messages: 44
Registered: August 2001
Member
Thanks Uwe,
I will try to do that.

Eugene
Previous Topic: asymmetrical redo log groups
Next Topic: Help in Oracle Server Manager
Goto Forum:
  


Current Time: Fri Sep 20 05:01:31 CDT 2024