Managing File Copies   «Prev  Next»

Lesson 8Operating System Image Copies
ObjectiveUse the Operating System to create Image Copies

Operating System Image Copies

In earlier lessons, we mentioned that an image copy is very much like an operating system copy of a file. In fact, you can use operating system copy commands to make image copies of data files, archive logs, and control files.

Creating image copies from the operating system

Because you will be making an image copy from outside the Oracle environment, you have to make sure that the database copy you are making is consistent.
One way of ensuring this consistency is to make the copy while the database is offline. The other way of insuring consistency is to use ALTER TABLESPACE tablespace_name BEGIN BACKUP before you start the operating system copy and ALTER TABLESPACE tablespace_name END BACKUP after you have completed the operating system copy.
Once you have taken one of these steps, you simply use the appropriate copy command for your operating system. For a UNIX system, the command is cp; for an NT system, the command is copy.

Image Copies and Backup Sets

Database backups created by Oracle Recovery Manager (RMAN) are stored as image copies or backup sets. Image copies are exact byte-for-byte copies of files. You can create an image copy by copying a file at the operating system level. Unlike copying files at the operating system level, however, image copies created through RMAN are recorded in the RMAN repository so that RMAN can use these copies during database restore operations and recovery. RMAN can restore files only if they are recorded in the RMAN repository. RMAN can create image copies only on disk. Backup sets are logical entities produced by the RMAN BACKUP command. This command can produce one or more backup sets on disk or tape devices. Although image copies cannot use all RMAN features, their advantages are that you can apply incremental backups to them (synthetic full backups) and you can use them directly in place without first copying them, for very fast restores. Each backup set contains one or more physical files called backup pieces. A backup piece stores the backup of one or more database files in a compact RMAN-specific format. One advantage of backup sets is that RMAN uses unused block compression to save space in backing up data files. Only those blocks in the data files that have been used to store data are included in the backup set. Backup sets can also be compressed, encrypted, sent to tape, and use advanced unused-space compression that is not available with datafile copies.

Cataloging OS image copies

When you make an image copy using RMAN, the image copy is automatically included in the recovery catalog. Because an operating system (OS) image copy is made outside of RMAN, you should explicitly catalog any operating system image copies you make.
The syntax for cataloging an OS image copy is:

catalog datafilecopy 'filespec';

where filespec is the pathname of the copied file.
The next lesson is the module wrap-up.