Solved

Capturing the sql in Sybase

Posted on 2006-11-15
3
1,124 Views
Last Modified: 2011-10-03
We are running Sybase 12.5.2 version on Sun Solaris .
There are some processes that run against the a particular database that cause the CPU to
spike upto 100% form an hour every morning .
How would I capture the sql in the database  that causes that to happen in Sybase ,is there a
script I can use or a tool
Appreciate all your help ,
thanks,Gyans
0
Comment
Question by:gyans
3 Comments
 
LVL 19

Accepted Solution

by:
grant300 earned 500 total points
ID: 17949492
You should install the MDA (Monitoring Data Access) tables and configure the monitoring system to capture the SQL_TEXT, among other things.

Rob Verschoor has put together a pretty complete set of documentation and presentations about MDA at:
http://www.sypron.nl/mda.html

The long and short is that you can set things up to capture all of the SQL Text sent to the server though it does not work on RPC calls to stored procedures.  Because there are limited buffer sizes for the data, you will have to create a permanent table and set up a process to do a period INSERT/SELECT from the MDA table to the permanent table so you don't loose anything.

One other thing you could try is using RIBO.  It is a utility that sits between the clients and the servers and captures and decodes TDS protocol network traffic.  It works for smaller sites but if you have a big installation, I would go with the MDA tables.

Regards,
Bill
0
 
LVL 2

Expert Comment

by:RahamanM
ID: 17985909
you can do following

dbcc trace on 3604
go
dbcc sqltext(<spid no>)
go
0
 
LVL 3

Expert Comment

by:pg_vinod
ID: 18074213
if you are not interested in MDA table then
you can store snapshot of sysprocesses in mon_table for every 15 sec in loop.
this can be used for postmortem. you just need to query the mon_table by date and time window of CPU high.
of course this will not have SQL text but you will have an idea what its was doing like exec /insert/update/open cursor delete etc.

hope this will help you.

--Vinod Pottekkatt
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
installl replication server 15.7 x64 on Windows 8.1 with update 1 11 589
SQL Update query 9 361
SyBase Query Syntax Case When 7 131
SyBase Query Syntax Date Time conversion 4 38
Adding Computers to AD groups through an SCCM Task Sequence
In this increasingly digital world, security hacks are no longer just a threat, but a reality. As we've witnessed with Target's big identity hack 2013, Heartbleed in 2015, and now Cloudbleed, companies and their leaders need to prepare for the unthi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question