0520-0522

Previous Table of Contents Next

Page 520

otherwise is to risk corrupting the data within the file. There are also various kinds of files, each of which serves a different purpose and must be backed up in a specific manner. It is important to ensure that all the right files are backed up when you implement a backup strategy. Make sure that you understand the reasons why each file is backed up.

Figure 22.5 shows the physical files that an Oracle instance uses. They are control files, database files, and redo log files. They must be included in the backup strategy.

Figure 22.5.
The physical files that
make up an Oracle
instance.



TIP
Always keep a current list of database files. These files should include regular database files, control files, and redo log files. Also keep a list of archive logs and their locations, whether on another machine or stored on a tape device. When changes are made to the database, such as the addition of data files, be sure to update your list of data files without procrastination. Organization contributes to successful backups .

Page 521

Control Files

Of all files used by the Oracle RDBMS, the control file most closely resembles the flat file of earlier databases and each Oracle instance must contain at least one. The control file is a treasure trove of information, a great deal of which is proprietary and quite illegible. The following information "officially" exists within the control file:

  • The name of the database name ”the ORACLE_SID
  • The name and location of all the database files
  • The name and location of all the redo log files
  • The system commit number (SCN), which matches the SCN in every Oracle file

Oracle users use the SCN to maintain the consistency and integrity of their databases.

The value of the control file is obvious. Without it, the database instance does not know what SCN to use, which makes it unable to tell whether all the information is in sync. The database cannot tell which database files and redo log files to mount and open as part of the database. It even suffers "database amnesia" because it does not know its own name. The control file is continuously updated while the database operates.

CAUTION
Always maintain at least two or three copies of database control files on separate disk drives . This is painless and provides additional insurance. You can specify the full path (location) of the database control files when the database is created, using the CONTROL_FILES parameter in the CREATE DATABASE statement. This is called mirroring control files.

Database Files

The database files are the heart and soul of the database instance. They are the physical files that make up tablespaces ”the logical constructs on which tables, indexes, and the like reside. Each tablespace can be made up of one or more separate physical database files. Every database instance must contain at least one database file ”for the SYSTEM tablespace.

Database files tend to be the hardest type of files to make copies of. This is because the data within a database object ”which lies within a tablespace and, ultimately, within a database file ”is constantly updated and changed. If a database has an active user community, many INSERT, UPDATE, or DELETE operations might be running that can change the data even as it is being copied . Despite the use of the SCN, the data changes and is inconsistent with the information that the database believes is stored within the database file. (Refer to Figure 22.2.)

Page 522

Redo Log Files

The redo log files hold transactions that have been applied against data within the database, including INSERT, DELETE, UPDATE, CREATE TABLE, DROP TABLE, CREATE INDEX, and DROP INDEX. Redo log files encompass online redo logs and offline redo logs, also known as archive logs. Because archive logs are simply copies of redo logs, the two are identical except for the data that they contain.

TIP
If an Oracle database instance's redo logs are lost and a backup is not available, you can trick the instance into believing that the archive logs are actually redo logs.

Every Oracle database instance must contain at least two online redo logs. The existence of archive logs depends on the mode in which the database is running ”Archive Log or NOARCHIVELOG. Even in Archive Log mode, archive logs do not have to exist for the database to function.

Types of Backups

Each type of file that makes up an Oracle database instance has a different requirement for its individual backup. Some files can be backed up simply by using a standard operating system utility, such as the UNIX cp or cpio command. Others require you to interface directly with the database to carry out the backup. Others require a sophisticated blend of database and operating system interface.

As important as knowing what to back up is knowing how to back up correctly. If a backup is not correctly made, a database recovery might not be possible.

Control File Backups

Control files resemble flat files, which means that compared to database files, they are easy to copy. Control files tend to be small, and effort needed to make copies is negligible. Control file backups are critical to being able to restore a database. Without a control file, a database cannot be brought online.

Operating System Copy

One option for making copies of database control files is to use operating system utilities. Making an operating system copy ”otherwise known as a full system backup ” works well, but it is not an adequate or reliable backup if the database has not first been shut down. Because an active database ” especially one with a high transaction volume ”constantly updates the control file, there is the risk that the copy might not reflect the true state of the database. Some people argue that this risk is small, but it still exists.

Previous Table of Contents Next


Oracle Unleashed
Oracle Development Unleashed (3rd Edition)
ISBN: 0672315750
EAN: 2147483647
Year: 1997
Pages: 391

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net