K-safety is one way to ensure the durability of the database by protecting the cluster against individual node failures. Another important feature for ensuring the viability of the cluster is the use of snapshots to save and restore the data from disk.
If you have automatic snapshotting turned on, the Enterprise Manager helps you manage your snapshots by optionally collecting the created snapshots and copying them to the management server. These features are available from thebutton on the Snapshot Settings panel of the dashboard.
The following sections explain how to use the Enterprise Manager to restore a database and manage your database snapshots.
When you create the database, you get to choose whether to create automated snapshots, and whether those snapshots are copied to the management server. Once the database exists, you can revisit these settings by clicking on thebutton in the Snapshot Settings panel of the dashboard.
The Edit Snapshots dialog box lets you change the settings for automated snapshots. You can modify the frequency of automated snapshots, how many snapshots are retained, and whether automated snapshots are copied to the management server. Once you make the desired changes, clickto have the changes take effect or click to discard the changes and close the dialog box.
The Edit Snapshots dialog also lets you take a manual snapshot. Whether automated snapshots are enabled or not or whether copy to management server is enabled or not, a manual snapshot is always copied to the management server and made available to you. When you click on the button, the manual snapshot is initiated. After the snapshot is complete, the Enterprise Manager will copy the snapshot to the management server and display it in the list of available snapshots.
Collecting the snapshot files provides assurance against failure. If the database fails for any reason, you can use the snapshots to restore the database's contents to a known state. You can also use the snapshots to save and restore the database in cases where you know you must take the cluster down for maintenance.
If you know that the database cluster must shutdown, you can use the following procedure to capture a known state of the database.
Pause the database, putting it in admin mode and stopping further client activity, by clicking on the database name in the global list of databases and selectingfrom the popup menu.
If automated snapshots are not currently being copied to the management server, click onin the Snapshot Settings panel to bring up the Edit Snapshots dialog box. Check the box for copying snapshots, then click . Or, if automated snapshots are disabled, use the Edit Snapshot Settings dialog to take a manual snapshot.
Wait for the snapshot to complete and be copied to the management server. At this point all client activity should have stopped and you can be assured that this last snapshot is complete.
Shutdown the database by clicking thebutton.
At this point the cluster can be shutdown, repaired, replaced, or other maintenance completed. Once the servers are ready to start again, use the following procedure to restore the last valid snapshot of the database.
In the Enterprise Manager dashboard, click on thebutton.
In the Start Database dialog box that appears, select the option for "Start and restore from a snapshot".
Next, select the snapshot you want to restore. (The snapshots are listed with the most recent first.)
When you follow these steps, the Enterprise Manager will start the database and restore the selected snapshot to return the database contents to their previous state. Note that the snapshots must be copied to the management server before they become available for use in restoring the database on start.
Over time, the number of snapshots that the Enterprise Manager collects can grow. You should periodically clean up the list be removing old and outdated snapshots.
For snapshots you no longer need, you can prune the list by selecting one or more snapshots from the list and clicking thebutton. The selected snapshots are deleted from the management server and removed from the list.
For snapshots you want to save but not necessarily reuse in the Enterprise Manager, you can select those snapshots and click on. The selected snapshots are zipped into a single compressed file each and downloaded to your current system. (That is, the computer whose web browser you are using to access the management server.)
While cleaning up, be sure to keep any snapshots you may want to use later to restore the database. The Enterprise Manager can only restore snapshots that are on the management server.