Академический Документы
Профессиональный Документы
Культура Документы
Objectives
After completing this lesson, you should be able to do the following: Describe the RMAN repository and recovery catalog Describe the Media Management Library interface Configure database parameters that affect RMAN operations Connect to the three different types of databases by using RMAN Configure two types of retention policies Change RMAN default settings with CONFIGURE
2-2
The major backup and recoveryrelated topics covered in the Database Administration I Course are: Types of failure that can happen
Statement, session, instance, media, and so on
How to configure ARCHIVELOG mode How to automate backups How to do incremental backups How to perform and tune instance recovery
2-3
RMAN provides a flexible way to: Back up the database including data files, control files, and archived redo logs Manage backup and recovery tasks Perform incremental block-level backup and block-level media recovery Detect corrupted blocks during backup Use binary compression when creating backups
2-4
Target database
Server session
Enterprise Manager
Channel
Channel
Disk
2-6
1. Determine the repository location: control file or recovery catalog. 2. Define database and environment variables. 3. Start RMAN and connect to the target and, optionally, the recovery catalog databases. 4. Configure persistent settings.
2-8
Recovery catalog:
Replicates control file data Has room for more data Can service many targets Can store RMAN scripts
2-9
Backup Destinations
Backups can be written to: Disk directory Media Management Library (tape device)
Typically used for disaster recovery, when disk backups are lost
2 - 11
Media Management
Recovery Manager Server session (channel)
Or
2 - 12
2 - 14
2 - 16
Configure the retention policy to the minimum value appropriate for your database. Back up the archive log files regularly and delete the files upon completion of the backup. Use the RMAN REPORT OBSOLETE and DELETE OBSOLETE commands to remove backups and file copies that are not required.
2 - 17
V$FLASH_RECOVERY_AREA_USAGE
You can query V$FLASH_RECOVERY_AREA_USAGE to view the flash recovery area disk space usage.
SQL> 2 3 4 5 SELECT file_type, percent_space_used AS used, percent_space_reclaimable AS reclaimable, number_of_files AS number FROM v$flash_recovery_area_usage ;
2 - 18
V$FLASH_RECOVERY_AREA_USAGE
2 - 19
2 - 20
Using the flash recovery area for recovery-related files: Simplifies the location of database backups Automatically manages the disk space allocated for recovery files Does not require changes to existing scripts Puts database backups, archive logs, and control file backups in the flash recovery area
2 - 21
Environment variables
NLS_DATE_FORMAT NLS_LANG
2 - 22
Remote operations:
Set up the password file Ensure that the password file is backed up
2 - 24
Target database
Recovery catalog DB
Auxiliary database
Recovery Manager
2 - 25
Starting RMAN
2 - 26
2 - 27
RMAN is preset with default configuration settings Use the CONFIGURE command to:
Configure automatic channels Specify the backup retention policy Specify the number of backup copies to be created Set the default backup type to BACKUPSET or COPY Limit the size of backup sets Exempt a tablespace from backup Enable and disable backup optimization Configure automatic backups of control files
2 - 28
2 - 29
Best practice: Oracle recommends that you enable control file autobackup.
2 - 30
Retention Policies
A retention policy describes which backups will be kept and for how long. There are two types of retention policies:
Recovery window: Establishes a period of time within which point-in-time recovery must be possible
File2 File2 needs to be backed up: Seven-day retention File1 Now
2 - 32
These policies are mutually exclusive and can be set with the CONFIGURE command.
Copyright 2008, Oracle. All rights reserved.
Use the CLEAR command to reset any persistent setting to its default value:
RMAN> CONFIGURE BACKUP OPTIMIZATION CLEAR; RMAN> CONFIGURE MAXSETSIZE CLEAR; RMAN> CONFIGURE DEFAULT DEVICE TYPE CLEAR;
2 - 34
Channel Allocation
Channel (DISK)
RMAN
2 - 35
An automatic channel is one that is preconfigured and used for subsequent commands. To change the default device type for automatic channel allocation, use:
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt;
A manually allocated channel is one that overrides the automatic channel setting. This channel overrides the automatic channel for this run block:
RMAN> RUN { 2> ALLOCATE CHANNEL c1 DEVICE TYPE disk; 3> BACKUP DATAFILE '/u01/oradata/user01.dbf'; 4> }
2 - 36
Configure parallelism:
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
2 - 37
Summary
In this lesson, you should have learned how to: Use either the control file or a recovery catalog for the RMAN repository Change RMAN default settings with CONFIGURE Use the flash recovery area for RMAN operations Monitor the flash recovery area by using v$ views and Enterprise Manager Implement recovery window and redundancy retention policies Implement manual and automatic channel allocation
2 - 39
This practice covers the following topics: Using Recovery Manager to connect to a target database in default NOCATALOG mode Displaying the default RMAN configuration settings Configuring control file autobackups Altering the backup retention policy for a database
2 - 40