Search code examples
oracle-databaseoracle11gdatabase-restore

Oracle restore database to a "newer" version


Is it possible to test the incremental backups ... well, incrementally? If so: How? -and not using the words "duplicate" and "standby".

Setup

  • Multi-TB Oracle 11g (11.2.0.2) database, about 70% of data is in a readonly tablespace.
  • Backup: weekly level 0 copy (except readonly), semi-daily level 1 incremental (differential data+archivelog).

After the level 0 backup, we ship all backup files to a test rig (offline for all intents and purposes) and perform a full restore and recovery. What i want, is to move the incremental backup (< 50G) to the test rig and test only those bits. A recovery test could (in my head) complete in minutes, alternatively in a few hours if the readonly data could somehow be preserved. Otherwise it takes ~9 hours for a full restore+recovery.

The ultimate goal is to reduce the disaster recovery testing time by the ~70% taken by the readonly tablespace on the 12 hour incremental cycles - a full restore/recovery once a week is required by policy.

If my - as yet incomplete - solution is way off suggestions are most welcome (still not using "duplicate" or "standby" :o).

EDIT Oct 4 2011: So i figured out how to avoid restoring the readonly tablespace on every test, so that's 70% time saved. What remains is to figure out whether it's possible to restore only the latest incremental backup onto the test-rig.

To be clear: Sunday I end up with at fresh restore+recover of everything, including readonly. Every 12 hours I perform a new restore-test, which skips the readonly bits but performs a level 0 restore of the remaining 30%, then applies the incrementals - in effect rolling back to Sunday and then catching up to the latest incremental.

What I'd like is to do a full restore sunday, and every 12 hours "apply" only the latest incremental backup to this restore and avoid the rollback to Sunday.


Solution

  • I feel this needs to answered, if only partially, so here you go:

    The recovery-part is still open, but avoiding the readonly-tablespace bit is solved using transferable tablespaces. Basically,

    • mark your readonly tablespace as transferable
    • generate a dump file using expdp
    • copy your datafiles to the test rig
    • do a restore, but skip the tablespace in question
    • drop tablespace from database
    • impdp to your database. (essentially re-create from import)

    We did this for a 3TB tablespace, took all of 30 seconds. (and 10 hours to copy :oP)

    A word of caution: marking as transferable and dropping a tablespace may not be the right thing to do, especially if you have dependencies between tablespaces.