| ||||||||
|
|
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.
RMAN> BACKUP DATABASE;
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.
% 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.
More Tutorials on Oracle dba ...
Want to share or request Oracle Tutorial articles to become a Oracle DBA. Direct your requests
to
webmaster@oracleonline.info |
|||||||
|---|---|---|---|---|---|---|---|---|