Top Banner
4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager
21

4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

Dec 23, 2015

Download

Documents

Adelia Scott
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4Copyright © 2004, Oracle. All rights reserved.

Configuring Recovery Manager

Page 2: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-2 Copyright © 2004, 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

• Change RMAN default settings with CONFIGURE

Page 3: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-3 Copyright © 2004, Oracle. All rights reserved.

Recovery Manager Features

RMAN provides a flexible way to:

• Back up the database, tablespaces, 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

Page 4: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-5 Copyright © 2004, Oracle. All rights reserved.

Serversession

Channel

Serversession

Enterprise Manager

Recovery Manager Components

Targetdatabase

Recoverycatalog

database

RecoveryManager(RMAN)

Auxiliarydatabase

DiskFlash Recovery

Area

Channel Channel

MML

Page 5: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-7 Copyright © 2004, Oracle. All rights reserved.

Media Management

Recovery Manager

Media management

server software

Media Management

Library

Serversession

(channel)

Page 6: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-9 Copyright © 2004, Oracle. All rights reserved.

Using a Flash Recovery Area with RMAN

Database area

RMAN backupprocess

Flash Recovery Area

Page 7: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-10 Copyright © 2004, Oracle. All rights reserved.

Setting Parameters for RMAN

• Database initialization parameters:– CONTROL_FILE_RECORD_KEEP_TIME– DB_RECOVERY_FILE_DEST and

DB_RECOVERY_FILE_DEST_SIZE

• Environment variables:– NLS_DATE_FORMAT – NLS_LANG

Page 8: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-12 Copyright © 2004, 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

Page 9: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-13 Copyright © 2004, Oracle. All rights reserved.

Connection Types with RMAN

Targetdatabase

Recoverycatalog DB

Auxiliarydatabase

Recovery Manager

Page 10: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-14 Copyright © 2004, Oracle. All rights reserved.

Starting RMAN

• Starting RMAN locally

• Starting RMAN remotely

UNIX: $ ORACLE_SID=DB01; export ORACLE_SID$ rman target system/manager

rman target sys/password@DB01

Windows NT: C:\> set ORACLE_SID=DB01C:\> rman target /

Page 11: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-15 Copyright © 2004, Oracle. All rights reserved.

Additional RMAN CommandLine 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 AUXILIARY sys/aux_pwd@aux1

Page 12: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-16 Copyright © 2004, 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

Page 13: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-17 Copyright © 2004, Oracle. All rights reserved.

Configuring RMAN Settings Using EM

Page 14: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-18 Copyright © 2004, Oracle. All rights reserved.

Control File Autobackups

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

Page 15: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-20 Copyright © 2004, Oracle. All rights reserved.

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

– Redundancy: Establishes a fixed number of backups that must be kept (Backups that are in excess of this can be deleted.)

• These policies are mutually exclusive and can be set with the CONFIGURE command.

Page 16: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-21 Copyright © 2004, 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;

Page 17: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-22 Copyright © 2004, Oracle. All rights reserved.

Channel Allocation

Channel (DISK)

BACKUP RESTORERECOVER

ServerSession

ServerSession

Targetdatabase

Channel (SBT)

RMAN

Page 18: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-23 Copyright © 2004, Oracle. All rights reserved.

Automatic and Manual Channel Allocation

• Change the default device type for automatic channel allocation:

• Manually allocate a channel

RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt;

RMAN> RUN { 2> ALLOCATE CHANNEL c1 DEVICE TYPE disk; 3> BACKUP DATAFILE '/u01/oradata/user01.dbf'; 4> }

Page 19: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-24 Copyright © 2004, 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; }

Page 20: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-26 Copyright © 2004, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:

• Describe the RMAN repository and recovery catalog

• Change RMAN default settings with CONFIGURE• Implement automatic channel allocation

Page 21: 4 Copyright © 2004, Oracle. All rights reserved. Configuring Recovery Manager.

4-27 Copyright © 2004, Oracle. All rights reserved.

Practice 4 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