PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: gavin dot mcnay at nomura dot co dot uk
Subject: Re[2]: Sybase Query Analysis
Date: Apr 8 1999 2:49PM

Darren,
Thanks for the help.... but... (oh there always is a but)
the only problem with this is it ASSUMES you KNOW the queries taking place.

The question I was asking is How do i get an idea of the queries which are
 executing on the sybase server....


Anbody got any ideas

Gavin
> Two main options are available to you.
> Firstly, in isql use "set showplan on" followed by "set noexec on" and then
> your query.  See on-line sybooks for description of these set commands in
> the Performance and Tuning Section.  In Nomura you would have to "up"
> sybooks in your unix session first and then simply type sybooks to bring up
> the on-line documentation.
> 
> Secondly a more elaborate details of how an index has been chosen for your
> query use the following command from an isql batch followed by the query or
> stored procedure in question.
> 
> dbcc traceon (3604, 302)
> 
> Notes: 3604 - Directs trace output to the client rather than to the error
> log.
> 302 - Prints trace information on index selection.
> 
> your query...
> 
> To turn off the output, use: dbcc traceoff (3604, 302).
> 
> Darren Sany
> Ex. Nomura personnel.
> 
> -----Original Message-----
> From: gavin.mcnay@nomura.co.uk 
> To: SybPerl Discussion List 
> Date: 07 April 1999 09:31
> Subject: Sybase Query Analysis
> 
> 
> >Guys,
> >
> >Is there a utility to get the current sybase sessions and the SQL queries
> that
> > are being run at the current time.
> >
> >I've used informix before and liked the ability to tune queries that were
> > running on an instance (probably behind a blackbox application, where i
> can't
> > read the source.... and hence can't change the set explain on line...)
> >
> >what I'd like to do is get the queries which take ages to run and tune
> these by
> > running them with the output of the optimiser being dumped...create
> > indexes...and the query runs faster....
> >
> >
> >Have any of you any ideas on how i can acomplish this???
> >
> >
> >Many thanks in advance,
> >
> >Gavin McNay
> >
> >