Page 529
To accomplish a cold backup, you must first shut down the database instance. There are three shutdown
% svrmgrl SVRMGR> connect internal Connected. SVRMGR> shutdown Database closed. Database dismounted. ORACLE instance shut down.
shutdown normal
When you issue a shutdown, also called a shutdown normal, from within Oracle Server*Manager, the Oracle RDBMS is very patient. In this mode, the database instance ignores further attempts to log into the database and waits for all the currently active sessions to disconnect from the database.
Using shutdown normal is not always the best option for a backup, even though it provides for the cleanest type of shutdown. If a
shutdown immediate
A shutdown in the immediate mode is almost identical to a shutdown in the normal mode, with one exception: Oracle has no patience. When you issue a shutdown immediate command, Oracle immediately terminates all the database connections and
For backup operations, shutdown immediate works best, because it deals with users who fail to log off their workstations. Because Oracle performs all the rollback and checkpointing, the database is in a consistent, stable state when the termination occurs.
shutdown abort
The shutdown abort command should be used only as a last resort, and then only when all the other shutdown options have failed. When you use the shutdown abort command, the DBA immediately terminates all the background processes that make up the Oracle database instance, but no rollback, checkpoint, or buffer flushing operations occur before the shutdown. In rare cases, this can lead to corruption of some of the data within the database.
A shutdown abort should not be used to stop the database before backup operations. If shutdown abort is required, the database should be restarted and shut down again in either immediate or normal mode to ensure a stable, consistent view of the database that is acceptable for backup operations.
Page 530
| TIP |
Two utilities that come with the Oracle RDBMS are dbshut and dbstart. They are |
A cold backup is the simplest of all backup operations. The steps required are
Whereas a cold backup takes a backup of a database in a shutdown state, a hot backup enables you to take a backup of a database that has not been shut down. Hot backups are also referred to as online backups. This is the most
Cold backups concentrate on copying all the physical files associated with a database instance. Hot backups, on the other hand, concentrate on the tablespace level. To do a hot backup, you must place every individual tablespace into a backup mode (by using the alter tablespace command), copy the physical database files that make up the tablespace, and take the tablespace out of backup mode (by using the alter tablespace command). You can issue these commands from Oracle Server*Manager or SQL*Plus. For example:
alter tablespace system begin backup; alter tablespace system end backup;
When you place a tablespace in backup mode, the Oracle instance notes that a backup is being performed and internally compensates for it. As you know, it is
Simplifying a hot backup in this way is tantamount to classifying the USS Nimitz as a boat. The complexity of the actions taken by the Oracle RDBMS under a hot backup could
Page 531
| CAUTION |
Don't place all the tablespaces in backup mode, perform the backup, and then take them all out of backup mode. Because of how Oracle handles hot backups, you could experience problems. Instead, you should back up each tablespace as a single unit. |
When you run a hot backup, you can restore the data files that compose a single tablespace and apply all the associated redo and archive logs to bring the tablespace back in sync with the database.
| NOTE |
You must be running the database in Archive Log mode to perform a hot backup. Archive Log mode assures data consistency when backing up only pieces of a database at a time. Remember that the redo logs (which are archived before being overwritten) maintain a record of all database transactions, providing the gap between separate backups of entities with the database. |
A hot backup is a complex operation, because each tablespace involves a complete backup operation. It makes sense to break the hot backup into its component
Oracle Enterprise Manager provides a more user-friendly interface for conducting backups than does Server*Manager. Using the backup manager utility, the DBA can easily initiate different types of backups, including cold and hot backups and direct backup files to either disk or tape. Review the chapters on Enterprise Manager for more detailed information.