This tutorial shows you how to:
Approximately 20 minutes
This tutorial covers the following topics:
Place
the cursor over this icon to load and view all
the screenshots for this tutorial. (Caution: This action loads all
screenshots simultaneously, so response time may be slow depending on your Internet
connection.)
Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot associated with that step. You can hide an individual screenshot by clicking it.
What Is a Snapshot Standby Database?
A snapshot standby database is a fully updateable standby database created by converting a physical standby database into a snapshot standby database.
A snapshot standby database receives and archives, but does
not apply, redo data from a primary database. The redo data received from the
primary database is applied once a snapshot standby database is converted back
into a physical standby database, after discarding all local updates to the
snapshot standby database.
A snapshot standby can be created from Enterprise Manager, the Data Guard Broker command-line interface (DGMGRL) or from SQL*Plus.
In this OBE, we will be using DGMGRL to create a Snapshot Standby database.
Before you perform this tutorial, you should:
| 1. | ||
To convert the physical standby database to a snapshot standby database, perform the following steps:
| 1. | Convert the physical standby database to a snapshot standby database using DGMGRL and the CONVERT DATABASE command. Redo data will continue to be received by the database while it is operating as a snapshot standby database, but it will not be applied until the snapshot standby is converted back into a physical standby database.
Note that the Flashback Database feature is required to create a snapshot standby database. If Flashback database is disabled, it is automatically enabled during conversion to a snapshot standby database. The broker automatically restarts the database to the mounted state if it had been opened with Flashback Database disabled. No user action is required.
|
| 2. | Verify that the database was successfully converted by issuing the SHOW CONFIGURATION command.
|
To update the databases, perform the following steps:
| 1. | To confirm that redo data is being received by the standby database, query V$MANAGED_STANDBY on the snapshot standby database and note the value in the BLOCK# column.
|
| 2. | Insert a row into the HR.REGIONS table on the snapshot standby database as follows:
|
| 3. | Insert a row into the HR.REGIONS table on the primary database as follows:
|
| 4. | On the snapshot standby database, verify that redo data is being shipped to the snapshot standby database by again querying V$MANAGED_STANDBY and comparing the returned BLOCK# value with the BLOCK# value from step 1. Verify that the HR.REGIONS table contains the record inserted in step 2.
|
To convert the snapshot standby database to a physical standby database, perform the following steps:
| 1. | Now that you have completed your work on the snapshot standby database, convert the snapshot standby database back to a physical standby database. You should be on the primary server to complete this step.
|
| 2. | Verify the status of the standby database by executing the SHOW CONFIGURATION command.
|
| 3. | Switch redo log files on the primary database.
|
| 4. | Stop the MRP process on the physical standby database.
|
| 5. | Open the physical standby database in read-only mode.
|
| 6. | Query the HR.REGIONS table. Note that the record you inserted into the snapshot standby database is not present because it was discarded when the database reverted back to physical standby mode. Note also that the record you inserted into the primary while the standby was in snapshot mode has now been propagated to the physical standby database.
|
| 7. | Shut down the physical standby database and restart it in MOUNT mode. This changes the physical standby state from read only to a state ready to receive redo.
|
| 8. | Invoke DGMGRL and restart the MRP process.
|
In this tutorial, you learned how to:
| Convert the Physical Standby Database to a Snapshot Standby Database | |
| Update the Databases and Verifying Redo Shipment | |
| Convert the Snapshot Standby Database to a Physical Standby Database |