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. ============================================================PLEASE NOTE: The provider of this email service, http://www.jislaaik.com, does NOT tolerate Spam and Fraud! If you receive an unsolicited email or one begging for your help in transferring millions of dollars from an African country, IT IS A SCAM! Please forward it to us and we will suspend the offending account.
Tauya Mhangami 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. > > >Why don't you try it and see? I don't think it'll work reliably. As you are running Oracle, I will assume that is because it is a busy system, that means it does the whole thang with transaction logs as well as the database files. That means at any one point in time, the database files don't contain an up-to-date and consistent image of the actual database (as some records are sitting in transaction logs waiting to sync with the database). That means rsync cannot "just copy" the files about and expect to be usable. However, if the database is "quiet", and the databases are flushed so that the transaction logs are cleaned (making snapshots of databases has the same effect), then yes, you can copy them about. With MySQL servers, I just do plain old "mysqldump" and rsync the output file. Guaranteed consistent :-) Jason
On 10-11-2004 at 23:25, Jason Haar wrote: >With MySQL servers, I just do plain old "mysqldump" and rsync the >output file. Guaranteed consistent :-) Well, actually mysqlhotcopy provides more consistency and better performances. Raccomended to everybody. :-) - Alessandro
Hello, On Wed, Nov 10, 2004 at 12:00:37PM +0000, rsync-request@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@mysql.com)