You are just 10 steps away from becoming a Oracle DBA. Materialize your dream by following the The 10 Simple Steps .


Learn Oracle - Online, Offline, RMAN and User Managed Backups

Learn Oracle - Highlights

Learn Oracle - Backups of Online Tablespaces and Datafiles

You can back up all or specified datafiles of an online tablespace while the database is open, but only when the database runs in ARCHIVELOG mode. In this case, Oracle can write changes to the online datafiles while the backup is occurring. A backup of online datafiles is called an online backup.

One danger in making online backups is the possibility of inconsistent data within a block. For example, assume that either RMAN or an operating system utility reads the entire block while database writer is in the middle of updating the block. In this case, RMAN or the copy utility may read the old data in the top half of the block and the new data in the bottom top half of the block. In this case, the block is a fractured block, meaning that the data contained in this block is not consistent.

During an RMAN backup, an Oracle server session reads the datafiles, not an operating system utility. The server session reads whole Oracle blocks and determines whether the block is fractured by comparing the header and footer of each block. If the session detects a fractured block, then it rereads the block until it gets a consistent picture of the data.

When Oracle DBA back up an individual datafile or online tablespace with an operating system utility (rather than with RMAN), Oracle DBA must use a different method to handle fractured blocks. You must first place the online tablespace in backup mode with the ALTER TABLESPACE BEGIN BACKUP statement. As a result, Oracle stops recording checkpoints to the tablespace's datafiles. You must put a tablespace in backup mode to make user-managed backups of datafiles in an online, read/write tablespace. After an online backup is completed, Oracle advances the file header to the current database checkpoint, but only after Oracle DBA run the ALTER TABLESPACE ... END BACKUP or ALTER DATABASE END BACKUP statement to take the tablespace out of backup mode.

When Oracle DBA restore a datafile from an operating system backup, the datafile header has a record of the most recent datafile checkpoint that occurred before the online tablespace backup, not any that occurred during it. As a result, Oracle asks for the appropriate set of redo log files to apply should recovery be needed.

Back to Top

Backups of Offline Tablespaces and Datafiles

An offline backup is performed while the tablespace or datafile is offline. You can take tablespaces offline with the ALTER TABLESPACE OFFLINE statement by using any of three different options: NORMAL, TEMPORARY, or IMMEDIATE. Taking an offline backup with the NORMAL option ensures that after the backup is complete, you do not have to perform recovery to bring the tablespace or datafile back online. In this way, Oracle DBA can perform necessary backups on datafiles and tablespaces without ever having to shut down the database or perform recovery.

Back to Top

Learn Oracle - RMAN Backups

RMAN backups are stored in a different format from user-managed backups. Oracle DBA generate an RMAN backup by running the BACKUP command from within the RMAN interface, as in the following example:


The BACKUP command generates either a backup set or a proxy copy and writes it to the operating system or a third-party media manager (if used). A backup set is a logical construction composed of one or more backup pieces. A backup piece is a file in a proprietary format composed of the blocks from one or more input datafiles, control files, or archived redo logs. For example, you can back up 5 datafiles into 1 backup set containing 1 backup piece, which causes RMAN to intermingle the blocks from the different datafiles into a single file.

The format of a backup piece is "proprietary" in the sense that only RMAN can generate backup sets, and only RMAN can restore them. A proxy copy is a special type of RMAN backup whose data transfer is managed by a third-party media vendor. Oracle DBA must use the RMAN interface to create and restore proxy copies.

In contrast to the BACKUP command, the RMAN COPY command generates a datafile, control file, or archived log image copy that can be restored by an operating system utility. An image copy is an exact duplicate of the input file. For example, this command copies datafile 1 to df1.copy on the operating system:

RMAN> COPY DATAFILE 1 TO 'df1.copy';

The COPY command only copies to disk. However, Oracle DBA can use the BACKUP command to back up image copies to tape.

Whenever Oracle DBA use RMAN to make a backup or copy, it records the action in the target database control file. If Oracle DBA use a recovery catalog, then RMAN pulls the metadata from the control file into the catalog. When you want to restore the backups or copies, run the RESTORE command. RMAN queries the metadata and then chooses among the available backups and copies and restores them.

Back to Top

Learn Oracle - User-Managed Backups

You must use operating system utilities to make user-managed backups. The available commands are operating system specific. For example, on a UNIX system you can back up a datafile using dd as follows:

% dd if=/oracle/dbs/df1.f of=/backup/df1.bak bs=1024k

On Windows NT, Oracle DBA can back up a datafile by pressing CTRL+C and then CTRL+V, by dragging and dropping, or by running a COPY command at the Command Prompt as in the following example:

C:\> COPY df1.dbf F:\BACKUP\df1.dbf

One major difference between user-managed backups and RMAN backups is that in the former there is no automatic metadata record of the backup. In other words, you must manually keep records of what you back up and where you back it up.
Back to Top


More Tutorials on Oracle dba ...

Liked it ? Want to share it ? Social Bookmarking

Add to: Mr. Wong Add to: BoniTrust Add to: Newsider Add to: Digg Add to: Del.icio.us Add to: Reddit Add to: Jumptags Add to: StumbleUpon Add to: Slashdot Add to: Netscape Add to: Furl Add to: Yahoo Add to: Spurl Add to: Google Add to: Blinklist Add to: Technorati Add to: Newsvine Information

Source : Oracle Documentation | Oracle DBA

Want to share or request Oracle Tutorial articles to become a Oracle DBA. Direct your requests to webmaster@oracleonline.info