Copying Oracle data files

Guilhem Bichot guilhem at mysql.com
Wed Nov 10 18:24:09 GMT 2004


Hello,

On Wed, Nov 10, 2004 at 12:00:37PM +0000, rsync-request at lists.samba.org wrote:
> Can I copy an Oracle database by just copying that Oracle Database
>  datafiles and moving them to another server with oracle? If
> possible can one back up a database using this same method.

If I try to continue Jason's fine answer:

Now why not rsync the datafiles AND the logs? It wouldn't work either
(unless the database is quiet). Indeed, as the logs and datafiles
would be copied at different times, you could get new datafiles and
old logs ("new" means 10 seconds or 10 minutes newer than "old",
depending on the time rsync takes). You could even get a log file
which would look like a patchwork of different moments of
itself (assuming there is so much activity that Oracle had the time to
write all its log files and cycle back to the first during the rsync
run). So Oracle will find garbage info in this patchwork log when it
reads it at restart: transaction ids may be crazy (imagine an id is 2
bytes and the patchwork makes 1 old byte sit near one new byte: that
makes a crazy id which will confuse Oracle). So in general this does
not produce a trustable backup.

What MySQL or Oracle can bear is if your copy is instant. On Linux
there is LVM for that: you create the LVM snapshot, rsync files,
discard the snapshot. It does work. Here's an intro to LVM:
http://arstechnica.com/columns/linux/linux-20041013.ars

Guilhem (guilhem at mysql.com)


More information about the rsync mailing list