Daniel Gaddis wrote:
does anyone know of a utility that will processes the query log to rerun the queries?
The program would need to...
...strip the leading non query info from the line ...handle queries that span multiple lines ...change databases when appropriate before queries ...add the ; to the end of the query
an option to only reprocess unique queries might also be nice.
has anyone already done this?
Yes. The mysql client is good for this. I used to restore from disasters this way, eg:
- full backup every night
- transaction log ( the text one, not the binary one ) gets reset each night by restarting mysql after the backup
Then when our disaster happened, we'd drop all databases, import from last night's backups, and then run the transaction log:
mysql < /path/to/transaction/log -p
Unfortunately this becomes a little more complicated if you use temporary tables ... especially if you're updating the DB from the contents of the temporary tables, as the recovery process will run as 1 user instead of all the original users that ran it to start with. I believe the binary transaction log is good in this case, but I haven't bothered to check up on how to use it yet.
But if you don't create temporary tables, then the above 1-liner should do.
Dan
-- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: [EMAIL PROTECTED] website: http://www.nusconsulting.com.au
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]