1、Backup and Recovery OverviewBackup and Recovery OverviewThis chapter provides a general overview of backup and recovery concepts, the files in an Oracle database related to backup and recovery, and the tools available for making backups of your database, recovering from data loss or other error, and
2、 maintaining records of your backups.This chapter includes the following topics: What is Backup and Recovery? Backup and Recovery: Basic Concepts The Database Recovery Process: Basic Concepts Forms of Data Recovery Backup and Recovery with RMAN Matching Failures to Backup and Recovery Techniques Aut
3、omatic Disk-Based Backup and Recovery: The Flash Recovery Area System Requirements for Backup and Recovery Methods Feature Comparison of Backup MethodsWhat is Backup and Recovery?In general, backup and recovery refers to the various strategies and procedures involved in protecting your database agai
4、nst data loss and reconstructing the database after any kind of data loss.Physical Backups and Logical BackupsA backup is a copy of data from your database that can be used to reconstruct that data. Backups can be divided into physical backups and logical backups.Physical backups are backups of the
5、physical files used in storing and recovering your database, such as datafiles, control files, and archived redo logs. Ultimately, every physical backup is a copy of files storing database information to some other location, whether on disk or some offline storage such as tape.Logical backups contai
6、n logical data (for example, tables or stored procedures) exported from a database with an Oracle export utility and stored in a binary file, for later re-importing into a database using the corresponding Oracle import utility.See also: Oracle Database Utilities for more details about importing and
7、exporting data using Oracle export and import utilities.Physical backups are the foundation of any sound backup and recovery strategy. Logical backups are a useful supplement to physical backups in many circumstances but are not sufficient protection against data loss without physical backups.Unless
8、 otherwise specified, the term backup as used in the backup and recovery documentation refers to physical backups, and to backup part or all of your database is to take some kind of physcial backup. The focus in the backup and recovery documentation set will be almost exclusively on physical backups
9、.Errors and Failures Requiring Recovery from BackupWhile there are several types of problem that can halt the normal operation of an Oracle database or affect database I/O operations, only two typically require DBA intervention and media recovery: media failure, and user errors.Other failures may re
10、quire DBA intervention to restart the database (after an instance failure) or allocate more disk space (after statement failure due to, for instance, a full datafile) but these situations will not generally cause data loss or require recovery from backup.User ErrorUser errors occur when, either due
11、to an error in application logic or a manual mis-step, data in your database is changed or deleted incorrectly. Data loss due to user error includes such missteps as dropping important tables or deleting or changing the contents of a table. While user training a nd careful management of privileges c
12、an prevent most user errors, your backup strategy determines how gracefully you recover the lost data when user error does cause data loss.Media FailureA media failure is the failure of a read or write of a disk file required to run the database, due to a physical problem with the disk such as a hea
13、d crash. Any database file can be vulnerable to a media failure.The appropriate recovery from a media failure depends on the files affected and the types of backup available.Oracle Backup and Recovery Solutions: RMAN and User-Managed BackupFor performing backup and recovery based on physical backups
14、, you have two solutions available: Recovery Manager (RMAN), a tool (with command-line client and Enterprise Manager GUI interfaces) that integrates with sessions running on the Oracle server to perform a range of backup and recovery activities, as well as maintaining a repository of historical data
15、 about your backups The traditional user-managed backup and recovery, where you directly manage the files that make up your database with a mixture of host operating system commands and SQL*Plus backup and recovery-related capabilitiesBoth methods are supported by Oracle Corporation and are fully do
16、cumented. Recovery Manager is, however, the preferred solution for database backup and recovery. It can perform the same types of backup and recovery available through user-managed methods more easily, provides a common interface for backup tasks across different host operating systems, and offers a
17、 number of backup techniques not available through user-managed methods.Most of the backup and recovery documentation set will focus on RMAN-based backup and recovery. User-managed backup and recovery techniques are covered in the later chapters of Oracle Database Backup and Recovery Advanced Users
18、Guide.Whether you use RMAN or user-managed methods, you can supplement your physical backups with logical backups of schema objects made using data export utilities. Data thus saved can later be imported to re-create this data after restore and recovery. However, logical backups are for the most par
19、t beyond the scope of the backup and recovery documentation.Backup and Recovery: Basic ConceptsThe physical structures of the database and the role each plays in the database recovery process are what determine the forms of backup and recovery available through user-managed techniques and through RM
20、AN.Physical Database Structures Used in Recovering DataThe files and other structures that make up an Oracle database store data and safeguard it against possible failures. This section introduces each of the physical structures that make up an Oracle database and their role in the reconstruction of
21、 a database from backup. This section contains these topics: Datafiles and Data Blocks Redo Logs Undo Segments Control FilesDatafiles and Data BlocksAn Oracle database consists of one or more logical storage units called tablespaces. Each tablespace in an Oracle database consists of one or more file
22、s called datafiles, physical files under the host operating system in which the database is running.A databases data is collectively stored in the datafiles that constitute each tablespace of the database. The simplest Oracle database would have one tablespace, stored in one datafile. The datbase ma
23、nages the storage space in the datafiles of a database in units called data blocks. A data block is the smallest unit of data used by a database. Data blocks are the smallest units of storage that the database can use or allocate.Modified or new data is not written to datafiles immediately. Updates
24、are buffered in memory and written to datafiles at intervals. If a database has not gone through a normal shutdown (that is, if it is open, or exited abnormally, as in an instance failure or a SHUTDOWN ABORT) then there are typically changes in memory that have not been written to the datafiles. Dat
25、afiles that were restored from backup, or were not closed during a consistent shutdown, are typically not completely up to date.Copies of the datafiles of a database are a critical part of any backup.See also: Oracle Database Concepts for more detail about the structure and contents of datafiles and
26、 data blocks.Redo LogsRedo logs record all changes made to a databases data files. With a complete set of redo logs and an older copy of a datafile, the database can reapply the changes recorded in the redo logs to re-create the database at any point between the backup time and the end of the last r
27、edo log. Each time data is changed in the database, that change is recorded in the online redo log first, before it is applied to the datafiles. An Oracle database requires at least two online redo log groups, and in each group there is at least one online redo log member, an individual redo log fil
28、e where the changes are recorded.At intervals, the database rotates through the online redo log groups, storing changes in the current online redo log while the groups not in use can be copied to an archive location, where they are called archived redo logs (or, collectively, the archived redo log).
29、 You can run your database in ARCHIVELOG mode (in which this archiving of redo log files is enabled) or NOARCHIVELOG mode (in which redo log files are simply overwritten).Preserving the archived redo log is a major part of most backup strategies, as they contain a record of all updates to datafiles.
30、 Backup strategies often involve copying the archived redo logs to disk or tape for longer-term storage. Running in NOARCHIVELOG mode limits your data recovery options.See also: Oracle Database Administrators Guide for more details about the online redo logs, Oracle Database Administrators Guide for
31、 more details about archived redo logs, and Deciding Between ARCHIVELOG and NOARCHIVELOG Mode for a discussion of the implications of archiving or discarding your redo log files.Control FilesThe control file contains a crucial record of the physical structures of the database and their status. Sever
32、al types of information stored in the control file are related to backup and recovery: Database information (RESETLOGS SCN and time stamp) Tablespace and datafile records (filenames, datafile checkpoints, read/write status, offline ranges) Information about redo threads (current online redo log) Log records (log sequence numbers, SCN range in each log) A record of past RMAN backups Information about corrupt datafile blocksThe recovery process for datafiles is in part guided by status information in the cont
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1