[Laskey99] Section 4.5. Practice Scenarios

来源:百度文库 编辑:神马文学网 时间:2024/06/03 05:14:03

4.5.

This section provides complete scenariosfor testing recovery using exports and hot and cold backups. It isimportant that you use these, or other scenarios you develop, to testyour backup strategy. Such scenarios not only fully exercise yourbackup media and hardware, but also give you practice performing therecovery. And don't worry if you fail the first time; mostpeople do.

4.5.1. Export/Import

The following scenarios are designedto allow you to gain experience and comfort with the Export andImport utilities. They are presented in order of increasingcomplexity.

  1. Take a full export of your database.

  2. Drop a table and then import it.

  3. Drop a user and then import the user.

  4. Perform a full import of the database.

  5. Drop a table and then use the data dictionary to determine whether to import using the full or incremental export.

  6. Perform a full import of the database using the full and incremental exports.

4.5.2. Hot or Cold Backups

The followingscenarios are designed to allow you togain experience and comfort recreating the database from backups.They are presented in order of increasing complexity.

  1. Recover the database from a full cold backup:

    1. Recover a single datafile.

    2. Recover the entire database.

  2. Put the database in archivelog mode and then perform a hot backup:

    1. Create a table in a tablespace with only one datafile. Then insert one or more rows.

    2. Perform enough ALTER SYSTEM SWITCH LOGFILE commands to cycle through all redo logs.

    3. Shut down the instance (optional).

    4. Delete the datafile containing the created table.

    5. Restore the datafile from the hot backup.

    6. Perform media recovery on the datafile. Then verify that the database requested at least one archive file.

    7. Verify that the table was recreated and has all the information required.

  3. If you have a backup tool that performs incremental hot backups (e.g., some third-party tools and Oracle8 Recovery Manager), do the following:

    1. Take a hot backup.

    2. Create a table; then insert one or more rows. Place the table in a tablespace with only one datafile.

    3. Perform an incremental backup. Then verify that portions of the datafile were backed up.

    4. Perform enough ALTER SYSTEM SWITCH LOGFILE commands to cycle through all redo logs.

    5. Stop the database (optional).

    6. Delete the datafile containing the created table.

    7. Use your restore utility to restore the table. Then verify not only that the original hot backup was restored, but also that the incremental backup was restored.

    8. Perform media recovery. Then verify that at least one archive file is required.

    9. Verify that the table was recreated and has all the information required.

  4. Test tablespace point-in-time recovery by doing the following:

    1. Take a hot backup.

    2. Create a table; then insert one or more rows. Place the table in a tablespace with only one datafile.

    3. Create an index on the table in another tablespace that will not be recovered.

    4. Take note of the time for tablespace point-in-time recovery.

    5. Create another table. Then insert more rows in the first table.

    6. Use the tablespace point-in-time recovery process to create a clone database as of the time noted in step d.

    7. Note that the second table is listed in the TS_PITR_OBJECTS_TO_BE DROPPED data dictionary view.

    8. Note that the index created in step c is listed in the TS_PITR_CHECK data dictionary view.

    9. Complete the tablespace point-in-time recovery.

    10. Verify that the second table and the rows added in step e are no longer in the database.

4.5.3. Other Techniques

There are many ways to verify that your table has been correctlyrestored. If the table is small enough, simple visual inspection maybe sufficient. Other techniques may include the following:

  • Compute the sum or average of a numeric column.

  • Generate a report before and after and use operating system tools to compare the results.

  • Create a copy of the table before the recovery test.

  • Compare the two tables using the MINUS operator.

  • Create Bookmark (Key: b)Create Bookmark
  • Create Note or Tag (Key: t)Create Note or Tag
  • Download (Key: d)Download
  • Email This Page (Key: e)Email This Page
  • PrintPrint
  • Html View (Key: h)Html View
  • Zoom Out (Key: -)Zoom Out
  • Zoom In (Key: +)Zoom In
  • Toggle to Full Screen (Key: f)
  • Previous (Key: p)Previous
  • Next (Key: n)Next

Related Content

Recovering from Failures
From: Oracle Essentials, 4th Edition

What Are the Recovery Options?
From: Oracle Security

Recovery Without Hurdles
From: Oracle® Database 10g Insider Solutions

What Are the Backup Options?
From: Oracle Security

Oracle Backup and Recovery Primer
From: Oracle Database 10g RMAN Backup & Recovery

Backup and Recovery Fundamentals
From: Oracle in a Nutshell

What's New for Oracle8?
From: Oracle Security

Backup and Recovery
From: Oracle Essentials, 4th Edition

User-Managed Backup and Recovery
From: Oracle in a Nutshell

Recovery Types
From: RMAN Recipes for Oracle Database 11g: A Problem-Solution Approach