Asif,

----- Original Message ----- 
From: "Asif Iqbal" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.mysql
Sent: Sunday, August 24, 2003 8:44 AM
Subject: split database


> I am running mysql 4.0.13 with innodb. I have data since 2000. I don't
> necessarily need to work with any data older than one year. Therefore I
would
> like to split the database. Then I like to backup data older than one year
and
> keep anything newer than one year and put it back to the same tables.
>
> So basically
>                    ________. DB_OLD (2000-2001)
>                   |
> DB (2000-2003) ---|
>                    --------. DB (2002-2003)
>
> That way all my applications will still work with the database and no need
to
> change the table name or database name
>
> This is my game plan
>
> 1. Dump the database to database.sql
> 2. Remove all the entries older than one year and save it as
database_new.sql
> 3. Drop the database
> 4. Source database_new.sql
> 5. Not sure what I need to do with the innodb data/log

you do not need to do anything ibdata or ib_logfiles, because when you do
the DROP DATABASE ..., InnoDB will free all the space in the ibdata files.

Before you start this massive reorganization, I recommend

(1) shutting down mysqld and making a BACKUP of
(2) ibdata files and
(3) ib_logfiles, as well as
(4) all the .MYI, .MYD, and .frm files under the subdirectories of the
datadir of the MySQL.

Just in case something goes wrong with the steps 1 - 5 above. And, of
course, you should regularly take backups of your valuable database anyway.

> Please help/suggest
> -- 
> Asif Iqbal
> http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x8B686E08
> There's no place like 127.0.0.1

Best regards,

Heikki Tuuri
Innobase Oy
http://www.innodb.com
Transactions, foreign keys, and InnoDB Hot Backup: a non-free hot backup
tool for MySQL
Order MySQL technical support from https://order.mysql.com/



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to