Devam Ediyor

MySQL 5.1 Partitioning with Events

I need someone to help me create the following:

1. An auto-partitioning routine to drop old data after X days.

2. An event to set up a separate ARCHIVE engine containing the old data.

I have a partial event for deleting old data, but it doesn't work:

mysql>show create event logs_del_partition\G

*************************** 1. row ***************************

Event: logs_del_partition

sql_mode:

time_zone: SYSTEM

Create Event: CREATE EVENT `logs_del_partition` ON SCHEDULE EVERY 1 DAY STARTS '2010-05-27 00:00:02' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN

DECLARE old_partitions CHAR(64) DEFAULT '';

SELECT CONCAT( 'ALTER TABLE logs DROP PARTITION ',

GROUP_CONCAT( PARTITION_NAME ))

INTO @s

FROM [url removed, login to view]

WHERE TABLE_SCHEMA='syslog' AND

TABLE_NAME='logs' AND

CREATE_TIME < DATE_SUB( CURDATE(), INTERVAL 30 DAY )

GROUP BY TABLE_NAME;

PREPARE stmt FROM @s;

EXECUTE stmt;

DEALLOCATE PREPARE stmt;

END

character_set_client: latin1

collation_connection: latin1_swedish_ci

Database Collation: latin1_swedish_ci

1 row in set (0.09 sec)

This is generating messages like:

[url removed, login to view] system daemonerr mysqld None 2010-05-25 00:00:02 2010-05-25 00:00:02 1100525 0:00:02 [Warning] Event

Scheduler:

[root@localhost][syslog2.logs_del_partition]

No data - zero rows fetched, selected,

or processed

[url removed, login to view] system daemonerr mysqld None 2010-05-25 00:00:02 2010-05-25 00:00:02 1100525 0:00:02 [ERROR] Event Scheduler:

[root@localhost][syslog2.logs_del_partition]

You have an error in your SQL syntax;

check the manual that corresponds to

your MySQL server version for the right

syntax to use near NULL' at line 1

[url removed, login to view] system daemonerr mysqld None 2010-05-25 00:00:02 2010-05-25 00:00:02 1100525 0:00:02 [Note] Event Scheduler:

[root@localhost].[syslog2.logs_del_

Beceriler: MySQL

Daha fazlasını görün: event scheduler data zero rows fetched selected processed, row 44, create event mysql, mysql auto partitioning days, mysql partition event scheduler, event partition mysql, mysql partitioning, mysql schedule, t-sql with, old messages, mysql 5.1, zero day, null, mysql error, end in 1 day, mysql create database engine, partitions, sql server routine, mysql create table data, mysql help table, mysql completion, enable root, sql syntax error, mysql containing, line messages

İşveren Hakkında:
( 21 değerlendirme ) Morrisville, United States

Proje NO: #702783

Seçilen:

freelancerbuzzo

Ready to do this work for you.

2 gün içinde 30$ USD
(10 Değerlendirme)
4.3

2 freelancers are bidding on average $33 for this job

sysadmin247

CCNA (Issued by CISCO) MCP (Issued by Microsoft Corporation) RHCE (Issued by Red Hat Corporation) We can start this project [url removed, login to view] PM

in 2 gün içinde35$ USD
(0 Değerlendirme)
0.0