dbTalk Databases Forums  

Capturing SQL queries

comp.databases.sybase comp.databases.sybase


Discuss Capturing SQL queries in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Zia
 
Posts: n/a

Default Capturing SQL queries - 12-08-2003 , 08:47 AM






Hi all,

I have a requirement where I am suppose to capture all the
commands executed by a user. For this i used sysecurity feature by
enabling cmdtext auditing. This gave me sufficient information on the
commands being executed. But did not give me the value of the
parameters being executed with.

For E.g.

sp_fetchId @name

was present in the sysaudits_01 table. But my requirement is

sp_fetchId "abc".

The application is very complex and many procedures get executed
depending on the status at that moment of the application. Everything
is automatically triggered from scripts. When ever there is any
problem in the system, its becoming a nightmare for me for debugging.

I would like to know, is there any way to capture the values of the
variables being passed. Or is there any other feature for acheciveing
this. No third party tools please -

I was thinking of implementing simple software which after enabling
gives me some log, by which it should be possible to know what is
being executed in the system.

Thanks a lot for reading this message,

-Zia

Reply With Quote
  #2  
Old   
Neal
 
Posts: n/a

Default Re: Capturing SQL queries - 12-09-2003 , 10:09 AM






Hello,

Depending on what API your client application makes a difference.
Different API's have different ways of tracing.

1) Sybase has a generic tool called Ribo that is free.
It sits between your client application and your server
and records everything that goes between the two. It
has the ability to filter out all of the things you don't
need so you could see just the SQL commands and their
parameters.

The advantage to Ribo is that it is independent of Sybase
APIs. It can record ODBC clients, CT-Library, DB-Library, etc.
You should have it in your $SYBASE/jutils-2_0/ribo directory.

2) If your client uses the Open Client DB-Library API,
there is a call you can put in the code called dbrecftos():
http://sybooks.sybase.com/onlinebook...078;pt=29078#X

It will record the SQL and parameters. This is specific to
DB-Library only.


3) If your client is an ODBC client, you can go into the
ODBC Administrator and enable SQL Tracing from there. That
file gets quite large and is specific to ODBC.

moh_muj (AT) yahoo (DOT) com (Zia) wrote in message news:<f5db6e5c.0312080647.1686b0db (AT) posting (DOT) google.com>...
Quote:
Hi all,

I have a requirement where I am suppose to capture all the
commands executed by a user. For this i used sysecurity feature by
enabling cmdtext auditing. This gave me sufficient information on the
commands being executed. But did not give me the value of the
parameters being executed with.

For E.g.

sp_fetchId @name

was present in the sysaudits_01 table. But my requirement is

sp_fetchId "abc".

The application is very complex and many procedures get executed
depending on the status at that moment of the application. Everything
is automatically triggered from scripts. When ever there is any
problem in the system, its becoming a nightmare for me for debugging.

I would like to know, is there any way to capture the values of the
variables being passed. Or is there any other feature for acheciveing
this. No third party tools please -

I was thinking of implementing simple software which after enabling
gives me some log, by which it should be possible to know what is
being executed in the system.

Thanks a lot for reading this message,

-Zia

Reply With Quote
  #3  
Old   
Zia
 
Posts: n/a

Default Re: Capturing SQL queries - 12-11-2003 , 08:49 AM



Hi ,

Our application is all script based, where lot of sessions are
opened and closed. Can any one have any idea how it can be done?
I would be interested in capturing the timestamp, the database,
database object and if it is stored procedure it should be possible to
get the parameters value which is not possible with sybsecurity
auditing.

Thanks
-Zia

Reply With Quote
  #4  
Old   
Michael Heaney
 
Posts: n/a

Default Re: Capturing SQL queries - 12-12-2003 , 04:08 PM



moh_muj (AT) yahoo (DOT) com (Zia) wrote in message news:<f5db6e5c.0312110649.77e35214 (AT) posting (DOT) google.com>...
Quote:
Hi ,

Our application is all script based, where lot of sessions are
opened and closed. Can any one have any idea how it can be done?
I would be interested in capturing the timestamp, the database,
database object and if it is stored procedure it should be possible to
get the parameters value which is not possible with sybsecurity
auditing.


Check out sqlpower.com


Michael Heaney
TIGR


Reply With Quote
  #5  
Old   
yurick
 
Posts: n/a

Default Re: Capturing SQL queries - 12-24-2003 , 09:32 AM



moh_muj (AT) yahoo (DOT) com (Zia) wrote in message news:<f5db6e5c.0312110649.77e35214 (AT) posting (DOT) google.com>...
Quote:
Hi ,

Our application is all script based, where lot of sessions are
opened and closed. Can any one have any idea how it can be done?
I would be interested in capturing the timestamp, the database,
database object and if it is stored procedure it should be possible to
get the parameters value which is not possible with sybsecurity
auditing.

Thanks
-Zia
Hello,

why don't you use Sybase Monitor&History servers? It comes in ASE
installation and
you can configure it to store queries(with parameters) as well as hell
of performance
information. I can send you sample scripts, let me know if you need
them.

Regards,
yurick


Reply With Quote
  #6  
Old   
David L. Cherin
 
Posts: n/a

Default Re: Capturing SQL queries - 12-29-2003 , 12:22 AM



You can also try SQL Query Analyzer: www.proactivedba.com

mheaney (AT) tigr (DOT) org (Michael Heaney) wrote in message news:<175d4beb.0312121408.27f554d4 (AT) posting (DOT) google.com>...
Quote:
moh_muj (AT) yahoo (DOT) com (Zia) wrote in message news:<f5db6e5c.0312110649.77e35214 (AT) posting (DOT) google.com>...
Hi ,

Our application is all script based, where lot of sessions are
opened and closed. Can any one have any idea how it can be done?
I would be interested in capturing the timestamp, the database,
database object and if it is stored procedure it should be possible to
get the parameters value which is not possible with sybsecurity
auditing.



Check out sqlpower.com


Michael Heaney
TIGR

Reply With Quote
  #7  
Old   
Subhas
 
Posts: n/a

Default Re: Capturing SQL queries - 12-30-2003 , 09:48 AM



Hi Yurick,
I wanted to set up sybase monitor and history server. Can you please
tell me the steps to do it???? I am using 12.5.0.3. Also does anyone
know how to use ribo???


Thanks you.

REgards

dba_sybase2003
yurickk (AT) hotmail (DOT) com (yurick) wrote in message news:<d87c89a7.0312240732.450181b2 (AT) posting (DOT) google.com>...
Quote:
moh_muj (AT) yahoo (DOT) com (Zia) wrote in message news:<f5db6e5c.0312110649.77e35214 (AT) posting (DOT) google.com>...
Hi ,

Our application is all script based, where lot of sessions are
opened and closed. Can any one have any idea how it can be done?
I would be interested in capturing the timestamp, the database,
database object and if it is stored procedure it should be possible to
get the parameters value which is not possible with sybsecurity
auditing.

Thanks
-Zia

Hello,

why don't you use Sybase Monitor&History servers? It comes in ASE
installation and
you can configure it to store queries(with parameters) as well as hell
of performance
information. I can send you sample scripts, let me know if you need
them.

Regards,
yurick

Reply With Quote
  #8  
Old   
Zia
 
Posts: n/a

Default Re: Capturing SQL queries - 01-02-2004 , 11:16 AM



Hi Yurick,
I would be very thankful to u if u provide me with the scripts. Iam
at present using the auditing option and not satisfied by it. Please
send me across the scripts to my mail id moh_muj (AT) yahoo (DOT) com.

Thanks in advance
-Zia

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.