Objectives
Types of RMAN Commands
Job Commands: Example
Channel allocation
Using a Media Manager
Configuring and Allocating Channels
RMAN backup command
RMAN backup command
Parallelization
Example
Creating Backup Sets
Creating Image Copies
Creating a Whole Database Backup
224.20K
Category: softwaresoftware

Configuring Backup Settings (3)

1.

Configuring Backup Settings
Eng :Jamal Mahmoud ‘Oracle Certified Professional

2. Objectives

RMAN usage :
RMAN commands
Channel allocation.
Backup command.
− Constraints.
− Parallelization.
− Backup types.
− Backup data files.
− Backup archived redolog files.
− Whole database backup.
− Using tags.
− Backup options.
Eng :Jamal Mahmoud ‘Oracle Certified Professional

3. Types of RMAN Commands

RMAN commands are of the following types:
• Stand-alone command:
– Is executed individually at the RMAN prompt
– Cannot appear as subcommands within RUN
• Job command:
– Must be within the braces of a RUN command
– Is executed as a group
Some commands can be executed as either a stand-alone or a
job command.
Eng :Jamal Mahmoud ‘Oracle Certified Professional

4. Job Commands: Example

Job commands appear inside a RUN command block:
RMAN> RUN
2> {
3>
ALLOCATE CHANNEL c1 DEVICE TYPE DISK
4>
FORMAT “e:\backup\%U";
5>
BACKUP AS BACKUPSET DATABASE;
6>
SQL 'alter system archive log current';
7> }
Execution of the entire block starts
when this line is entered.
Deallocated after the
RUN block completes
Eng :Jamal Mahmoud ‘Oracle Certified Professional

5. Channel allocation

Recovery
Manager
Server
session
(channel)
Eng :Jamal Mahmoud ‘Oracle Certified Professional

6. Using a Media Manager

Server
session
(channel)
Recovery
Manager
Oracle Secure
Backup with
built-in MML
Eng :Jamal Mahmoud ‘Oracle Certified Professional
Or
Media
Management
Library
Media
management
server software

7. Configuring and Allocating Channels

Configure automatic channels with the CONFIGURE
command:
RMAN>
RMAN>
RMAN>
RMAN>
CONFIGURE DEVICE TYPE sbt;
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
CONFIGURE CHANNEL DEVICE TYPE sbt ...
BACKUP DATABASE;
Allocate channels manually with the ALLOCATE
CHANNEL command within a RUN block:
RMAN> RUN
{
ALLOCATE CHANNEL ch1 DEVICE TYPE DISK;
BACKUP DATABASE PLUS ARCHIVELOG;
}
Eng :Jamal Mahmoud ‘Oracle Certified Professional

8. RMAN backup command

RMAN> BACKUP AS BACKUPSET FORMAT
'/BACKUP/df_%d_%s_%p.bus' TABLESPACE hr_data;
Eng :Jamal Mahmoud ‘Oracle Certified Professional

9. RMAN backup command

Type of backup
• FULL
• incremental
• automatically backs up the control file and the current server
parameter file
What to backup
• DATABASE
• DATAFILE
• TABLESPACE
• ARCHIVELOG
• CURRENT CONTROLFILE, or SPFILE.
Whether to backup
• image copy
• backup set
Eng :Jamal Mahmoud ‘Oracle Certified Professional

10.

Constraints
The database must be mounted or open.
Online redo log backups are not supported
Only “clean” backups are usable in NOARCHIVELOG mode
Only “current” data file backups are usable in
ARCHIVELOG mode
Eng :Jamal Mahmoud ‘Oracle Certified Professional

11. Parallelization

Eng :Jamal Mahmoud ‘Oracle Certified Professional

12. Example

RMAN>
RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE DISK
FORMAT 'e:\backup\df_%d';
ALLOCATE CHANNEL c2 DEVICE TYPE disk
FORMAT 'd:\ora2\df_%d';
BACKUP as backupset database
(DATAFILE 1,4,5 CHANNEL c1)
(DATAFILE 2,3,6 CHANNEL c2) ;
}
Eng :Jamal Mahmoud ‘Oracle Certified Professional

13. Creating Backup Sets

RMAN> BACKUP AS BACKUPSET
2> FORMAT '/BACKUP/df_%d_%s_%p.bus'
3> TABLESPACE hr_data;
Data file
1
Data file
1
Data file
2
Data file
2
Data file
3
Data file
3
Tablespace
HR_DATA
Backup
set
Eng :Jamal Mahmoud ‘Oracle Certified Professional

14. Creating Image Copies

RMAN> BACKUP AS COPY DATAFILE '/ORADATA/users_01_db01.dbf';
RMAN> BACKUP AS COPY ARCHIVELOG LIKE '/arch%';
Copy of data file 3
Data file 3
Data file 3
Copy of archived log
Archived
log file
Archived
log file
Eng :Jamal Mahmoud ‘Oracle Certified Professional

15.

Backup archived redolog files
RMAN> BACKUP FORMAT 'C: \disk1\backup\ar_%t_%s_%p'
ARCHIVELOG FROM SEQUENCE=234
DELETE INPUT;
Where:
%t is thread number
%s is the sequence number
%p is the piece number
RMAN> BACKUP ARCHIVELOG ALL;
RMAN> BACKUP ARCHIVELOG
FROM SEQUENCE 121
UNTIL SEQUENCE 125;
RMAN> BACKUP ARCHIVELOG
FROM TIME 'SYSDATE-30'
UNTIL TIME 'SYSDATE-7';
Eng :Jamal Mahmoud ‘Oracle Certified Professional

16. Creating a Whole Database Backup

RMAN> BACKUP DATABASE
PLUS ARCHIVELOG;
Archived log
file copies
Data file
copies
Eng :Jamal Mahmoud ‘Oracle Certified Professional
Control
file
SPFILE

17.

Backup options
Check for physical block corruptions
Scan for logical corruptions in addition to physical corruptions
Set a threshold on the number of detected corruptions allowed
before aborting
Validate the target input files before performing a backup
operation
Duplex the backup set
Overwrite an existing backup set or image copy
Eng :Jamal Mahmoud ‘Oracle Certified Professional
English     Русский Rules