Backup problem - disaster waiting to happen

2003-07-28 Thread H M Kunzmann

I use mysqldump to dump my databases to file.
I then write these files to tape.

I was doing a test restore to a test server this weekend and found that
for my largest database, I cannot restore from this file.

I use mysql  backup.script.

It runs for a long time and creates most of the tables, but eventually
comes up with a syntax error and stops processing the file.

I have two questions:
How do I get around this ? The error message is:

 .ERROR 1064 at line 78631: You have an error in your SQL syn
s:v=\urn:schemas-microsoft-com:vml\\r\nxmlns:o=\u

This data is xml data stored in one of the fields. If mysqldump created
the syntax surely it should process back in correctly ? There's no way I
can edit 2GB of incorrect entries in order to correct them.

Secondly, how can I make the restore more fault tolerant ? If one call
fails to continue with the next one ?

Thank
Ciao
Herbert



signature.asc
Description: This is a digitally signed message part


Re: Backup problem - disaster waiting to happen

2003-07-28 Thread Nils Valentin
Hi Herbert,

the -f/--force  option lets you continue with the next command

Thats my $0.0.2.

Best regards

Nils Valentin
Tokyo/Japan


2003 7 28  17:57H M Kunzmann :
 I use mysqldump to dump my databases to file.
 I then write these files to tape.

 I was doing a test restore to a test server this weekend and found that
 for my largest database, I cannot restore from this file.

 I use mysql  backup.script.

 It runs for a long time and creates most of the tables, but eventually
 comes up with a syntax error and stops processing the file.

 I have two questions:
 How do I get around this ? The error message is:

  .ERROR 1064 at line 78631: You have an error in your SQL syn
 s:v=\urn:schemas-microsoft-com:vml\\r\nxmlns:o=\u

 This data is xml data stored in one of the fields. If mysqldump created
 the syntax surely it should process back in correctly ? There's no way I
 can edit 2GB of incorrect entries in order to correct them.

 Secondly, how can I make the restore more fault tolerant ? If one call
 fails to continue with the next one ?

 Thank
 Ciao
 Herbert

-- 
---
Valentin Nils
Internet Technology

 E-Mail: [EMAIL PROTECTED]
 URL: http://www.knowd.co.jp
 Personal URL: http://www.knowd.co.jp/staff/nils


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



Backup problem - disaster waiting to happen

2003-07-28 Thread H M Kunzmann
I use mysqldump to dump my databases to file.
I then write these files to tape.

I was doing a test restore to a test server this weekend and found that
for my largest database, I cannot restore from this file.

I use mysql  backup.script

It runs for a long time and creates most of the tables, but eventually
comes up with a syntax error and stops processing the file.

I have two questions:
How do I get around this ? The error message is:

ERROR 1064 at line 78631: You have an error in your SQL syntax.  Check the manual that 
c
om:vml\\r\nxmlns:o=\u

This data is xml data stored in one of the fields. If mysqldump created
the syntax surely it should process back in correctly ? There's no way I
can edit 2GB of incorrect entries in order to correct them.

Secondly, how can I make the restore more fault tolerant ? If one call
fails to continue with the next one ?

Thank
Ciao
Herbert
-- 
Herbert Michael Kunzmann
Binary Chaos Magician


signature.asc
Description: This is a digitally signed message part


Re: Backup problem - disaster waiting to happen

2003-07-28 Thread walt
H M Kunzmann wrote:
 
 I use mysqldump to dump my databases to file.
 I then write these files to tape.
 
 I was doing a test restore to a test server this weekend and found that
 for my largest database, I cannot restore from this file.
 
 I use mysql  backup.script
 
 It runs for a long time and creates most of the tables, but eventually
 comes up with a syntax error and stops processing the file.
 
 I have two questions:
 How do I get around this ? The error message is:
 
 ERROR 1064 at line 78631: You have an error in your SQL syntax.  Check the manual 
 that c
 om:vml\\r\nxmlns:o=\u
 
 This data is xml data stored in one of the fields. If mysqldump created
 the syntax surely it should process back in correctly ? There's no way I
 can edit 2GB of incorrect entries in order to correct them.
 
 Secondly, how can I make the restore more fault tolerant ? If one call
 fails to continue with the next one ?
 
 Thank
 Ciao
 Herbert
 --
 Herbert Michael Kunzmann
 Binary Chaos Magician

Herbert,
It might be better if you do a per table export instead of whole
database export. If you still have files that are too large to easily
edit, use a utility like split to break them up.  Below is the script we
use to backup all of our tables except for 100_PATS and 400_PATS as
those tables are dropped and reloaded everynight anyway.

Hope this helps!
walt

#!/bin/bash
cd /var/lib/mysql/NEA/
FILES=`ls *.frm`
for file in $FILES; do
LEN=${#file}
STRIP=$((LEN -4))
table=`expr substr $file 1 $STRIP`
if [ $table != 100_PATS ]  [ $table != 400_PATS ]; then
   /usr/bin/mysqldump -qt -u nea NEA $table -r /opt/db_dump/$table
fi
done
exit 0

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