Unix Technical Forum

Subject: determining if tables are being used

This is a discussion on Subject: determining if tables are being used within the MySQL General forum forums, part of the MySQL category; --> Keith, The definitive way is to turn on the query log and watch it for a few days or ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 06:36 AM
Sean Kelly
 
Posts: n/a
Default Subject: determining if tables are being used

Keith,

The definitive way is to turn on the query log and watch it for a few days
or weeks.

In your my.cnf under [mysqld] add the line:

log=mysql-query

Then restart your server.

In your server's data directory (e.g. /usr/local/mysql/data/), there will
now be a log file called mysql-query.log. After some time there may be one
for each day, week or size interval.

This file, 'mysql-query.log' shows all queries and can be opened, cat'd,
tailed, etc.

Using the query log impacts performance, comment out the line and restart
mysql when you're done.

Link to the mysql doc:

http://dev.mysql.com/doc/refman/5.0/en/query-log.html

-sean

On 6/11/07, Keith Murphy <kmurphy@icontact.com> wrote:
>
> I have inherited database servers from a group whose main job was not
> working on mysql. I am not certain if all the tables on the databases are
> being used. Is there some efficient way of determining if a table is being
> accessed or when the last time it was accessed?
>
> Thanks,
>
> Keith
>
> --
> Keith Murphy
> Database Administrator
> iContact
> 2635 Meridian Parkway, 2nd Floor
> Durham, North Carolina 27713
> (o) 919-433-0786
> (c) 850-637-3877
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:25 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com