Presentation is loading. Please wait.

Presentation is loading. Please wait.

2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.

Similar presentations


Presentation on theme: "2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager."— Presentation transcript:

1 2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager

2 2-2 Copyright © 2006, Oracle. All rights reserved. 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

3 2-3 Copyright © 2006, Oracle. All rights reserved. Backup and Recovery: Review The major backup and recovery–related 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

4 2-4 Copyright © 2006, Oracle. All rights reserved. Features of Recovery Manager 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

5 2-5 Copyright © 2006, Oracle. All rights reserved. Recovery Manager Features (notes only slide)

6 2-6 Copyright © 2006, Oracle. All rights reserved. Server session Channel Server session Enterprise Manager Recovery Manager Components Target database Recovery catalog database Auxiliary database Disk Flash recovery area Channel MML Options Recovery Manager (RMAN)

7 2-7 Copyright © 2006, Oracle. All rights reserved. Recovery Manager Components (notes only slide)

8 2-8 Copyright © 2006, Oracle. All rights reserved. Steps for Configuring RMAN 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.

9 2-9 Copyright © 2006, Oracle. All rights reserved. RMAN Repository Data Storage: Comparison of Options Control file: –Simpler administration –Default Recovery catalog: –Replicates control file data –Has room for more data –Can service many targets –Can store RMAN scripts Metadata Backup set list Image copy list.

10 2-10 Copyright © 2006, Oracle. All rights reserved. RMAN Repository Data Storage: Comparison of Options (notes only slide)

11 2-11 Copyright © 2006, Oracle. All rights reserved. Backup Destinations Backups can be written to: Disk directory Media Management Library (tape device) –Typically used for disaster recovery, when disk backups are lost Flash recovery area –This is a disk area set aside for backup and recovery and flashback database purposes. –You define the location and the size. –Files are automatically named by using Oracle Managed Files. –Files are automatically retained and deleted as necessary.

12 2-12 Copyright © 2006, Oracle. All rights reserved. Media Management Recovery Manager Media management server software Media management library Server session (channel) Oracle Secure Backup with built-in MML Or

13 2-13 Copyright © 2006, Oracle. All rights reserved.

14 2-14 Copyright © 2006, Oracle. All rights reserved. Using a Flash Recovery Area with RMAN You can configure RMAN to use the flash recovery area. Database area RMAN backup process Flash recovery area DB_RECOVERY_FILE_DEST = '/u01/oracle/fra' DB_RECOVERY_FILE_DEST_SIZE = 2G

15 2-15 Copyright © 2006, Oracle. All rights reserved. Using a Flash Recovery Area with RMAN (notes only slide)

16 2-16 Copyright © 2006, Oracle. All rights reserved. Monitoring the Flash Recovery Area with EM

17 2-17 Copyright © 2006, Oracle. All rights reserved. Flash Recovery Area Space Usage 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.

18 2-18 Copyright © 2006, Oracle. All rights reserved. V$FLASH_RECOVERY_AREA_USAGE You can query V$FLASH_RECOVERY_AREA_USAGE to view the flash recovery area disk space usage. SQL> SELECT file_type, 2 percent_space_used AS used, 3 percent_space_reclaimable AS reclaimable, 4 number_of_files AS number 5 FROM v$flash_recovery_area_usage ; FILE_TYPE USED RECLAIMABLE FILES ----------------- --------- ----------- ------

19 2-19 Copyright © 2006, Oracle. All rights reserved. V$FLASH_RECOVERY_AREA_USAGE Output from the V$FLASH_RECOVERY_AREA_USAGE query FILE_TYPE USED RECLAIMABLE FILES ------------ ---------- ----------- ---------- CONTROLFILE 0 0 0 ONLINELOG 0 0 0 ARCHIVELOG 69.13 0 593 BACKUPPIECE 0 0 0 IMAGECOPY 0 0 0 FLASHBACKLOG 1.77 0 37

20 2-20 Copyright © 2006, Oracle. All rights reserved. Backing Up the Flash Recovery Area RMAN> BACKUP RECOVERY FILES;

21 2-21 Copyright © 2006, Oracle. All rights reserved. Benefits of Using a Flash Recovery Area 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

22 2-22 Copyright © 2006, Oracle. All rights reserved. Setting Parameters That Affect RMAN Database initialization parameters – CONTROL_FILE_RECORD_KEEP_TIME – DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE, if using the flash recovery area Environment variables – NLS_DATE_FORMAT – NLS_LANG

23 2-23 Copyright © 2006, Oracle. All rights reserved. Setting Parameters that Affect RMAN (notes only slide)

24 2-24 Copyright © 2006, Oracle. All rights reserved. RMAN Usage Considerations Resources: Shared memory, more processes Privileges given to users: –Database: SYSDBA –Operating system: Access to devices Remote operations: –Set up the password file –Ensure that the password file is backed up

25 2-25 Copyright © 2006, Oracle. All rights reserved. Connection Types with RMAN Target database Recovery catalog DB Auxiliary database Recovery Manager

26 2-26 Copyright © 2006, Oracle. All rights reserved. Starting RMAN Starting RMAN locally Starting RMAN remotely UNIX:$ ORACLE_SID=DB01; export ORACLE_SID $ rman target / rman target sys/password@DB01 Windows NT:C:\> set ORACLE_SID=DB01 C:\> rman target /

27 2-27 Copyright © 2006, Oracle. All rights reserved. Additional RMAN Command-Line Arguments Writing RMAN output to a log file Executing a command file when RMAN is invoked Establishing database connections on RMAN startup $ rman TARGET sys/oracle CMDFILE=$HOME/scripts/my_rman_script.rcv $ rman TARGET sys/oracle LOG=$HOME/oradata/u03/rman.log APPEND $ rman TARGET SYS/sys_pwd@orcl CATALOG rman/rman@rcat

28 2-28 Copyright © 2006, Oracle. All rights reserved. Configuring Persistent Settings for RMAN 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

29 2-29 Copyright © 2006, Oracle. All rights reserved. Configuring RMAN Settings by Using EM

30 2-30 Copyright © 2006, Oracle. All rights reserved. Control File Autobackups RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON; Best practice: Oracle recommends that you enable control file autobackup.

31 2-31 Copyright © 2006, Oracle. All rights reserved. Control File Autobackups (notes only page)

32 2-32 Copyright © 2006, Oracle. All rights reserved. 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 –Redundancy: Establishes a fixed number of backups that must be kept These policies are mutually exclusive and can be set with the CONFIGURE command. Retention Policies Now Seven-day retention File1File2 File2 needs to be backed up:

33 2-33 Copyright © 2006, Oracle. All rights reserved. Retention Policies (notes only page)

34 2-34 Copyright © 2006, Oracle. All rights reserved. Managing Persistent Settings Use the SHOW command to list current settings: Use the CLEAR command to reset any persistent setting to its default value: RMAN> SHOW CONTROLFILE AUTOBACKUP FORMAT; RMAN> SHOW EXCLUDE; RMAN> SHOW ALL; RMAN> CONFIGURE BACKUP OPTIMIZATION CLEAR; RMAN> CONFIGURE MAXSETSIZE CLEAR; RMAN> CONFIGURE DEFAULT DEVICE TYPE CLEAR;

35 2-35 Copyright © 2006, Oracle. All rights reserved. Channel Allocation Channel (DISK) BACKUP RESTORE RECOVER Server session Server session Target database Channel (SBT) RMAN

36 2-36 Copyright © 2006, Oracle. All rights reserved. Automatic and Manual Channel Allocation An automatic channel is one that is preconfigured and used for subsequent commands. To change the default device type for automatic channel allocation, use: A manually allocated channel is one that overrides the automatic channel setting. This channel overrides the automatic channel for this run block: RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt; RMAN> RUN { 2> ALLOCATE CHANNEL c1 DEVICE TYPE disk; 3> BACKUP DATAFILE '/u01/oradata/user01.dbf'; 4> }

37 2-37 Copyright © 2006, Oracle. All rights reserved. Channel Control Options Configure parallelism: Specify the maximum backup piece size: Format the name of generated backup files: RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3; RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK 2> MAXPIECESIZE 2G; RMAN> RUN { 2> ALLOCATE CHANNEL d1 DEVICE TYPE DISK 3> FORMAT '/disk1/backups/%U'; 4> BACKUP DATABASE PLUS ARCHIVELOG; }

38 2-38 Copyright © 2006, Oracle. All rights reserved.

39 2-39 Copyright © 2006, Oracle. All rights reserved. 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

40 2-40 Copyright © 2006, Oracle. All rights reserved. Practice Overview: Configuring RMAN 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


Download ppt "2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager."

Similar presentations


Ads by Google