Showing posts with label debugging. Show all posts
Showing posts with label debugging. Show all posts

Saturday, 24 September 2011

Debugging Oracle Forms Application server(9i and 10g)

There is a very good Oracle documentation on manually configuring  Oracle form trace and debugging available at Oracle site at Tips, Techniques and Debugging of Oracle forms Application server.

This link talks about the debugging and tracing options available in Oracle 9iAS but most of the things are applicable to Oracle 10gAS as well.

Documents available at this link mainly talk about Diagnostics methods

1)Enabling Form trace:-Topics like how to configure form trace,start  the trace and also how to convert trace file to readable XML files

2)Servlet logs:-

  • It provides a record of all Oracle9i Forms sessions, including session start and endtimes, and the user’s IP address and host name 
  •  Monitoring of Oracle9i Forms-related network traffic and performance 
  • It also gives Information for debugging site configuration problems (debug-level
    logging)
     
3)Debugging Client and Server crash  and also discussess about Common forms(FRM errors) and how to solve them.

 4)There is also a Sample Application which you can use to learn some functions in forms and as well as debug it.The code for the Sample Application is available at
http://sheikyerbouti.developpez.com/tutoforms10g/files/tutoforms10g.zip

In case you are not able to find the Debugging documentation or the link expires then do a google search for the following pdf files

1)tutoforms10g.pdf
2)trace9i-133379.pdf
3)forms9idiagnostics-129282.pdf

If you have any questions do mention in the Comments section

Happy Debugging

Sunday, 18 September 2011

Debugging Oracle Database(10g) and Application performance

Most often we find ourself in a position where we need to improve our application performance over a period of time when the Application has scaled due to large volume of data.

In a typical three tier Architecture(Application server,Webserver,Database server) or any Multi tier Architecture the poor performance may be due to any of the Components.

Each component needs to be debugged for performance issues.

The primary ways of identifying performance issues are

A) Instrumenting the Application:-  Instrumentation for example is logging information about important transactions of the Application.
Recording information such as time taken to perform a transaction and response transaction over a period of time,wait time for resources for a particular transaction etc.
It should be done during design of the application itself for later debugging.This Appproach saves a lot of time and resources which is required to identify performance bottle necks when the application has gone to production.

The important consideration to be made before instrumentation is

1)There should be always be an option to disable the logging of information since it would be additional overhead during normal operation of the Application

 2)There should be different levels of logging information.For example Warning level,debug level,information level.

3)It should be done for all the components of the Architecture

Although all the Components of the Application has to be instrumented we will cover only Oracle Instrumentation to be relevant with the topic.

Oracle DB:-Oracle Instrumentation which covers mainly the following categories

1. Debugging:-The characteristics of it are
  • Should be able to enable debugging for one or more “modules” in the code.
  • Should be able to activate debugging remotely for one or more “users”.
  • Debugging should be written to one or more “persistent” sources and preferably to a console for initial debugging and there needs to be enough debugging code to be useful.

2. Logging:-Although logging is dependent on the nature of the application here are some common requirements for application logging:
  •  Output to a persistent source
  •  Provide logging levels (i.e. informational or error)
  •  The ability to record errors and anomalies
  •  The ability to record runtime information
3. Runtime registration and Metric collection
The source code ,examples and other information of the oracle instrumentation are available at debugf,log4plsql,dbms_application_info,log4plsql example and user guide,Debug.f usage and other information
B) Profiling the Application:- the Application-It is nothing but gathering information about various component of the Application through external profilers which means not part of the Application environment and also integrated profilers part of the development environment.They defer from Instrumentation in the sense they are independent of the Application and are tools of the underlying technology.

Although all the Components of the Application has to be profiled we will cover only the database part

 
1)TKRPOF and TRCSESS:- These profilers are used for interpreting SQL TRACE which is used to provide information mainly about SQL statements and their processing .The details about how to enable and disable SQL trace,how to interpret trace files(TKPROF) and how to extract specific information from trace files (Trcsess)are available in SQL TRACE Details,Interpreting TKPROF,Oracle Documentation

 2)PLSQL Profiling:-To profile PL/SQL code, the database engine provides an API through the package dbms_profiler. With that package, the profiler integrated in the PL/SQL engine can be enabled and disabled at the session level. For more information kindly check DBMS_PROFILER

Friday, 16 September 2011

Oracle Database 10g Debugging Connection problems (contd)

This post is a continuation of the previous post in this topic .We have already mentioned about  how to enable trace and log options on the client.The below information is just for your recap if you have seen the prevoius post and also for those who are familiar about Net services in oracle and want to debug their connection issues

Note:-In this post we have discussed only about Windows Platform

The last option to find out connection issues is to enable log and trace files as below

I)The Common file where we can enable logging options in client is sqlnet.ora located in <ORACLE_HOME>/NETWORK/ADMIN

The logging parameters and Tracing parameters( TRACE_LEVEL_CLIENT being the most important)for client are

sqlnet.ora Parameter

LOG_DIRECTORY_CLIENT :-Establishes the destination directory for the client log file. By default, the client directory is the current working directory.

LOG_FILE_CLIENT :-Sets the name of the log file for the client. By default the log name is sqlnet.log.

TRACE_DIRECTORY_CLIENT :-Establishes the destination directory for the client log file. By default, the client directory is $ORACLE_HOME/network/trace on UNIX and ORACLE_HOME\network\trace on Windows.

TRACE_FILE_CLIENT :-Sets the name of the log file for the client. Sets the name of the trace file for the client. By default the trace file name is sqlnet.trc

TRACE_LEVEL_CLIENT :- This will decide the level of information provided values are
off (equivalent to 0) provides no tracing

user (equivalent to 4) traces to identify user-induced error conditions

admin (equivalent to 6) traces to identify installation-specific problems

support (equivalent to 16) provides trace information for troubleshooting information

In our case we need to troubleshoot hence set the level to SUPPORT unless problem requires the other options

Sample sqlnet.ora

NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, HOSTNAME)
NAMES.DEFAULT_DOMAIN = WORLD
LOG_DIRECTORY_CLIENT=D:\test
TRACE_LEVEL_CLIENT = SUPPORT
TRACE_DIRECTORY_CLIENT=D:\test
TRACE_FILE_CLIENT=trace_file_test

Go to II) If you want to just debug the trace file without much information required or else check the below examples of connection issues which were debugged

A)First and foremost you have enabled the log and trace files and the trace file is not generating in the path mentioned in TRACE_DIRECTORY_CLIENT in sqlnet.ora or in the default path then check the below

1)If there are multiple Oracle homes make sure that the oracle client which you are using to connect is the default Oracle_Home

2) Suppose you have two oracle homes one D:\orant\bin and D:\Oracle10g\bin.
Suppose you want to debug the application using oracle client D:\Oracle10g\bin
then put this entry as the first entry in Environment Variable "PATH".

MyComputer-->Properties-->Advanced-->Environment variable

for example if PATH= D:\orant\bin;D:\Oracle10g\bin;<OTHER PATHS>

change it to

PATH= D:\Oracle10g\bin;D:\orant\bin;<OTHER PATHS>

3) If still Trace file is not generating then mention the backgorund and details in the comment section.

B)You are getting the error "ORA-12154: TNS:could not resolve the connect identifier specified" one possible error may be that your TNS Entry may be wrong if you are using local naming (TNSNAMES.ORA file)

Hence the trace file may contain this

Success:-

nnftrne: Using tnsnames.ora address (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.170.8.77)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = FLEXCUBE.WORLD)
)
) for name CTEST.WORLD


Failure:-

nnftrne: Using tnsnames.ora address (DESCRIPTION = for name CTEST.WORLD


with out having the complete tns entry.

For a better understanding of this error ORA-12154 check the link ORA-12154:TNS:could not resolve the connect identifier specified

C)If you are getting the error "ORA-12545: Connect failed because target host or object does not exist"
the one possible reason may be the Host ip address has some special character in the TNS Entry if you are using local naming(TNSNAMES.ORA)
Hence the trace file may contain this

Failure:- 

snlinGetAddrInfo: Name resolution failed for 10.170.8.77,

for more information about this error check ORA-12545: Connect failed because target host or object does not exist

D)if you are getting the error ORA-12541: TNS:no listener

One possible reason might be the host name is mentioned wrongly.

Then the trace file will contain

Success:-

nttcni: trying to connect to socket 412.
snlinGetNameInfo: entry
snlinGetNameInfo: Using numeric form of host's address 10.170.8.77
snlinGetNameInfo: exit
nttcni: connected on ipaddr 10.170.8.77


Failure:-
nttcni: trying to connect to socket 420.
ntt2err: entry
ntt2err: soc 420 error - operation=1, ntresnt[0]=511, ntresnt[1]=61, ntresnt[2]=0
ntt2err: exit 


for more informnation on this error check ORA-12541: TNS:no listener

II)These are simple examples of what might contain in the trace file for Connection errors from Client machines

 For debugging all kinds of connection errors from client

1) Take the trace file from the client machine in which the Connection is successfull which have same configuration of oracle client and database as the client machine which has connection errors,if the oracle client is 10g or higher then remove the timestamp information  

2) Take the trace file from problematic Client machine ,if the oracle client is 10g or higher then remove the timestamp information 

3)Compare the two trace files to identify the connection problem and  google it for additional information .Also note the trace file for successfull connection might contain additional data which you can ignore.


We hope this information was useful

Wednesday, 14 September 2011

Why Debug Oracle Application

With respect to Oracle Apps ,products or any application whenever we are faced with a problem or issue in our work ,we mostly google and find out answers .Even though we get all the right answers what we dont know is the logic behind those answers.

What we intend to do with this blog is help people not to get solutions for their problems but in a small way provide direction in finding out the solutions themselves.

I mentioned the word we for the intention of this blog because i know little things but there are lot of experts and geeks who can provide the complete direction to site visitors

This being the first post ,i would request people to report in comments section what problem in oracle Apps and products they would like to debug and find out the solution.Myself or some Guest can show the way

Also in this blog we would cover mainly Oracle database and Application server



Happy Debugging folks :)