views:

439

answers:

2

Here's the scenario - a client uploads a Sybase dump file to (gzipped) to our local FTP server. We have an automated process which picks these up and then moves them to different server within the network where the database server resides. Unfortunately, this transfer is over a WAN, which for large files takes a long time, and sometimes our clients forget to FTP in binary mode, which results in 10GB of transfer over our WAN all for nothing as the dump file can't be loaded at the other end. What I'd like to do, is verify the integrity of the dump file on the local server before sending it out over the WAN, but I can't just try and "load" the dump file, as we don't have Sybase installed (and can't install it). Are there any tools or bits of code that I can use to do this?

A: 

There is no way to really verify the integrity of the dump file without loading it in some way by a backup server. The client should know whether the dump is successful or not via the backup log or output during the dump.

But to solve your problem you should use to SFTP or SCP, all transfers are done in binary, alleviating your problem.

Ensure that they are also using compression in the dump a value of 1-3 is more than enough, this should reduce your network traffic also.

Vincent
+2  A: 

There are a few things you can do from the command line. The first, on the sending side, is to generate md5sum's of the files.

$ md5sum *.dmp
2bddf3cd8b04010183dd3295ce7594ff  pubs_1.dmp
7510e0250c8d68bae3e0e794c211e60b  pubs_2.dmp
091fe54fa5fd81d8c109cc7835d37f4a  pubs_3.dmp

On the client side, they can run the same. Secondly, usually Sybase dumps are done with the compress option. If this option is used, you can also test the file integrity by uncompressing the files via the command line. This isn't as complete, but it will verify the 8 byte CRC-32 checksum which is part of the compress algorithm.

$ gunzip --test *.dmp
gunzip: pubs_3.dmp: unexpected end of file

Neither of these methods validate that Sybase will be able to load the file, but it does help ensure the file isn't corrupt.

brianegge