Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying.

Similar presentations


Presentation on theme: "Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying."— Presentation transcript:

1 Chapter 7 Making Backups with RMAN

2 Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying backup options Channels Output Device types Backup format Tags

3 Objectives (cont.) Control file and server parameter file (spfile) Choosing what to back up Flash recovery files Incremental backups Making copies Encryping backups Specifying backup windows Retaining backups Other backup features

4 Backup Command Use ‘backup’ command to back up: – Datafiles – Archived redo logs – Control files Also used to: – Make copies of datafiles – Make backups of backup sets

5 Backup Command Basic steps: – Connect to target database – Ensure target database is in proper state Mount or open for archivelog database Mount for noarchivelog database – Type ‘backup database’ at the RMAN prompt

6 Backup Sets & Image Copies The two types of backups created Backup Set – Default backup method – Contains one or more backup pieces – One backup piece per backup set by default – Limit piece size with ‘maxpiecesize’ parameter – Limit set size with: ‘maxsetsize’ parameter ‘filesperset’ parameter – Allows multiplexing (many files in backup set) – Skips backing up unused blocks

7 Backup Sets & Image Copies (cont.) Image Copy – Byte for byte image of original file – Can be files not created with RMAN Incorporated into RMAN via ‘catalog’ command – Preferred restore method used by RMAN Less overhead than recovery using backup set Can use ‘switch’ command to point database to replacement file (no actual recovery needed)

8 RMAN Backup Modes Full vs. Incremental – Full Means all allocated blocks in a given file Is the default backup type – Incremental has two types Level 0 – same as full Level 1 – Includes only changed blocks since Level 0

9 RMAN Backup Modes Consistent vs. Inconsistent – Consistent – Occurred in mount state after graceful shutdown No recovery needed Mandatory for noarchivelog databases – Inconsistent – occurred when database is open or after database crash Recovery always needed For archivelogmode databases

10 Types of Files RMAN Backs up Datafiles Control Files Archived Redo logs Image copies of datafiles and control files Backup pieces that contain RMAN backups Server parameter file (spfile) Online redo logs NOT backed up

11 RMAN Backup Destinations Disk directory Media management library (tape device) Flash recovery area

12 Specifying Backup Options If overriding configured defaults for: – Channels – Output Device Type – Image Copy or Backup Set Output – Backup Format – Tags for Backup Output

13 Channels One disk channel preconfigured For tape – configure automatic channel, or – Manually allocate tape channel at backup time

14 Output Device Type Done using ‘device type’ clause of backup command Tape devices must be preconfigured to use

15 Image Copy or Backup Set Backup set is default For image copy, done using ‘as copy’ clause of backup command For backupset, done using ‘as backupset’ clause of backup command

16 Backup Format Refers to naming of the RMAN backup files Names specified in the following ways: – Using ‘format’ clause of backup command – Configure format setting for channel – Configure format setting for device type If not specified, default names/locations based on O/S specific rules

17 Tags for Backup Output Assigns unique name to each backup Done using ‘tag’ parameter of backup command If not specified, RMAN assigns default tag

18 Backing Up the Control file Recommended to use automatic backups of control file – Can restore without control file or recovery catalog – Backed up as standalone backup piece Placed in default location or flash recovery area Spfile also backed up Can be done manually – Included in backup for datafile 1

19 Backing Up the Spfile Done using backup spfile command Database must be started with spfile Only backs up current spfile Also backed up with control file backup

20 Backing Up Datafiles Done via ‘backup datafile’ command Can back up files by name or number Can back up individual datafiles – Including incremental backups Use either backup or image copy

21 Backing Up Tablespaces Done via ‘backup tablespace’ command Can back up individual tablespaces – Including incremental backups Use either backup or image copy Transportable tablespaces have backup limitations depending on Oracle version

22 Backing up Whole Database Done via ‘backup database’ command Backs up all datafiles If autobackup on, will back up control file and spfile Does not back up archived redo logs Backup can be consistent or inconsistent – Consistent must be taken in mount state after normal shutdown (i.e. – not aborted) – Inconsistent means backup taken after abnormal shutdown or if database is open

23 Backing up Archived Redo Logs Done via ‘backup archivelog’ command Backs up single copy of each log Can delete O/S file after backup Can backup by location, time, sequence number

24 Backing up Archived Redo (cont.) Can be backed up during full database backup When using ‘backup database plus archivelog’ command, the following things occur: 1. Alter system archive log current 2. Backup archivelog all 3. The database datafiles are backed up 4. Alter system archive log current (again) 5. Backs up new archive logs generated since backup started

25 Backing up Everything Everything means – control file – Datafiles – Archived redo logs – Spfile Commands to be run: Verify backups via ‘list backup by file’ command

26 Backing up Flash Recovery Files Done via clauses of backup command: – ‘recovery area’ – Db_recovery_file_dest ‘Backup recovery area’ backs up files in flash recovery area ‘backup recovery files’ backs up all disk recovery files, regardless of location Must specify tape device for flash recovery area files

27 Flash Recovery Files (cont.) Includes: – Full and incremental backup sets – control file autobackups – Archived redo logs – Datafile copies Does not include: – Flashback logs – Current control file – Online redo logs

28 Performing Incremental Backups Backs up only changed data – Complete backups within provided windows – Saves storage space – Uses SCN as basis Two kinds of incremental backups – Differential (default) – Cumulative

29 Differential Incremental Backups Is the default for incremental backups Backs up changed blocks since either – Level 0 backup, or Can be image copies or backup sets – Level 1 backup Can only be backup sets Faster than level 0 since only changed blocks backed up

30 Cumulative Incremental Backups Backs up changed blocks since most recent level-0 backup

31 Differential vs. Cumulative Differential incremental backups – Takes less space – Takes longer to recover Cumulative incremental backups – Takes more space – Takes less time to recover

32 Incrementals: Things to Remember You can back up: – Datafile – Datafile Copy – Tablespace – Database You cannot back up: – control files – Archived redo logs – Backup set Tips – Use block change tracking to reduce backup time

33 RMAN-ski – Making Copies! Creating Multiple Backup Sets – Done via ‘copies’ or ‘set backup copies’ Making Copies of Backup Sets – Done via ‘backup … backupset’ Making Copies of Image Copies – Done via ‘backup as copy/backupset’ Making Tape Copies of Disk Image Copies – Done via ‘backup datafilecopy’ or backup … copy’

34 Encrypting RMAN Backups Two types – Transparent encryption (default encryption mode) – Password encryption Encryption is turned off by default Steps to use transparent encryption: – Configuration of Oracle Encryption Wallet – Open the wallet – Use configure command to create encrypted backups Password encryption done via ‘set encryption’ command Both encryption types can be used at the same time Encryption for database or tablespace backups

35 Specifying Backup Windows Done via ‘duration’ parameter of ‘backup’ command Helps backups to run within specified window Can force long backup to stop Helps manage system resources during backup

36 Retaining Backups Done via ‘keep’ option of ‘backup’ command Means keeping backups beyond retention policies Also known as ‘archival backups’

37 Other Backup Features Exclude tablespaces from a backup Skip read-only, offline, or inaccessible files Can compress backups to save storage Can parallelize backups to save time Can parallel backups of large files Reuse backup files Can backup only files not backed up Can restart backups after a crash Can update image copy backups


Download ppt "Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying."

Similar presentations


Ads by Google