segunda-feira, março 12, 2007

MySQL purge master logs

From the manual:

Deletes all the binary logs listed in the log index prior to the specified log or date. The logs also are removed from the list recorded in the log index file, so that the given log becomes the first.

Example:

PURGE MASTER LOGS TO 'mysql-bin.010';
PURGE MASTER LOGS BEFORE '2003-04-02 22:46:26';

The BEFORE variant's date argument can be in 'YYYY-MM-DD hh:mm:ss' format. MASTER and BINARY are synonyms.

This statement is safe to run while slaves are replicating. You do not need to stop them. If you have an active slave that currently is reading one of the logs you are trying to delete, this statement does nothing and fails with an error. However, if a slave is dormant and you happen to purge one of the logs it has yet to read, the slave will be unable to replicate after it comes up.

To safely purge logs, follow this procedure:

  1. On each slave server, use SHOW SLAVE STATUS to check which log it is reading.

  2. Obtain a listing of the binary logs on the master server with SHOW BINARY LOGS.

  3. Determine the earliest log among all the slaves. This is the target log. If all the slaves are up to date, this is the last log on the list.

  4. Make a backup of all the logs you are about to delete. (This step is optional, but always advisable.)

  5. Purge all logs up to but not including the target log.

You can also set the expire_logs_days system variable to expire binary log files automatically after a given number of days (see Section 5.2.3, “System Variables”). If you are using replication, you should set the variable no lower than the maximum number of days your slaves might lag behind the master.


source:
http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html

Um comentário:

rafaelgimenes.et disse...

Olá Amigo.
eu Comprei um notebook igual o que vc fez o review
de kra já parti pro Ubuntu FEsty beta ainda mas foi bem,
a unica coisa q não funcionou foi a Camera
e o leitor de cartao, eu coloquei um cartao da maquina digital e nao montou nada no lsusb nao apareceu nada
vc sabe com ofaço pra funcionar essa parada
por favor entre em contato comigo email falecom@rafaelgimenes.net ou por msn rafaelgimenes@yahoo.com.br

muito obrigado