First page Back Continue Last page Graphics

SWITCH DATABASE Command


Notes:

A new 10g RMAN command – SWITCH DATABASE TO COPY – provides a convenient technique for quickly switching to the latest image copies (i.e. making the latest image copies the current datafiles). So, in the event of failure of the primary datafiles, you can very quickly switch to the image copies – without the overhead of manually changing the control file or restoring (i.e. copying) the image copies. You’ll notice that after switching the image copies to the current datafiles, you need to recover the new datafiles (i.e. apply all changes made to the database since the image copy was created). If you use the incrementally update image copy technique demonstrated earlier in this lesson, your image copies will be quite current and the RECOVER operation will hopefully be quick (how long it takes is directly related to the amount of updates occurring on your database).
The SWITCH DATABASE command updates the control file(s) to point to the new datafiles, just like the ALTER DATABASE RENAME FILE statement. The SWITCH DATABASE command also updates the RMAN repository to reflect the change (i.e. it deletes the entries for the image copies since they are now the primary datafiles).
This might be a somewhat temporary solution since your database will now be operating using image copies in a backup location as the primary datafiles. In the example shown above, the SWITCH DATABASE command switched the database to use the image copies located in the Flash Recovery Area. However, you can easily take another image copy while the database is online – into the correct location for your datafiles – and then later, when the database can be brought down, use another SWITCH DATABASE TO COPY command to reset the database to use the datafiles in the proper production location. Refer to the supplied demonstration file switch_database_to_copy_demo.txt for an example of using this command.

Notes for this slide continue on the next page…