mysql maintainance

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

mysql maintainance

Postby Op3r » Sat May 30, 2009 5:30 am

Im thinking about rolling back the call_log tables as 1 of my database is now like 4 gb now :(

any way to optimize and roll back the logs created by vicidial? How do you do it?
Get paid for US outbound Toll Free calls. PM me. visit https://stopmanualdial.com for vicidial services.
Op3r
 
Posts: 1432
Joined: Wed Jun 07, 2006 7:53 pm
Location: Manila

Postby spaquet » Sat May 30, 2009 7:21 am

As far as I understand this is more a MySQL issue.

I would first go for a MySQL Dump. This is a way to backup your data (check MySQL documentation for more information on mysqldump command)

Once you have your backup done, you can try deleting part of the log.

It is always safe to perform a backup before deleting rows in a database, particularly when you do not know your future needs.

Regarding optimization, I'm using the tool provided by either phpMyAdmin or MySQL GUI tools.
There are tools in both to optimize,check, repair tables and databases.
spaquet
 
Posts: 105
Joined: Sat May 30, 2009 7:05 am
Location: Morocco

Postby mflorell » Sat May 30, 2009 9:43 am

We've discussed log rolling a few times on the forums. What we usually do is create an "archive" table for call_log, vicidial_log and vicidial_agent_log that we roll the existing logs into so them we can purge the active log tables.

First you create a new table(removing AUTO_INCREMENT if there is one), then you run something like the following:

SELECT count(*) from call_log;
SELECT count(*) from call_log_archive;
INSERT IGNORE INTO call_log_archive SELECT * from call_log;
DELETE FROM call_log WHERE start_time < '2009-05-01 01:00:00';
optimize table call_log;
optimize table call_log_archive;
mflorell
Site Admin
 
Posts: 18406
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: Bing [Bot] and 84 guests