IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup...

41
IOUG Collaborate -- April 16, 200 IOUG Collaborate -- April 16, 200 8 1 Part 1 -- Part 1 -- RMAN in the Trenches: RMAN in the Trenches: To Go Forward, We Must Backup To Go Forward, We Must Backup Philip Rice Philip Rice Univ. of California Univ. of California Santa Cruz Santa Cruz Session #315 Session #315 UCSC mascot: Banana Slug

Transcript of IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup...

Page 1: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 11

Part 1 --Part 1 -- RMAN in the Trenches:RMAN in the Trenches:To Go Forward, We Must BackupTo Go Forward, We Must Backup

Philip RicePhilip Rice

Univ. of California Santa CruzUniv. of California Santa Cruz

Session #315Session #315

UCSC mascot: Banana Slug

Page 2: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches22

Background/OverviewBackground/Overview

Using RMAN since 8.1Using RMAN since 8.1 Parts 1 & 2 presented in 2007 (nocoug.org)Parts 1 & 2 presented in 2007 (nocoug.org)

[Reviewed for accuracy][Reviewed for accuracy] Q1 2008 SELECT Journal article (combo of 1&2)Q1 2008 SELECT Journal article (combo of 1&2) Part 1 focus: Beginner, some IntermediatePart 1 focus: Beginner, some Intermediate

Page 3: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches33

Backup Types: BasicsBackup Types: Basics

Cold backups simple, not worth doing w/ RMANCold backups simple, not worth doing w/ RMAN Two formats, both check for corruption and Two formats, both check for corruption and

capture completion info for recovery:capture completion info for recovery: Backupset: several types of compressionBackupset: several types of compression Image Copy: same as OS copy, no Image Copy: same as OS copy, no

compression, more suited to fast recoverycompression, more suited to fast recovery

Page 4: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches44

Incremental Level 0 & 1Incremental Level 0 & 1

Incrementals (vs. Full): space saverIncrementals (vs. Full): space saver Level 0: for RESTORE – datafile contentLevel 0: for RESTORE – datafile content Level 1: for RECOVER – block changesLevel 1: for RECOVER – block changes

If most blocks change daily, Incremental may If most blocks change daily, Incremental may not be best, unless used for rolling forward not be best, unless used for rolling forward Image Copy in 10gImage Copy in 10g

Page 5: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches55

Example: Incremental Level 0 & 1Example: Incremental Level 0 & 1Level 0 every 7 days (50 GB),Level 0 every 7 days (50 GB),

Level 1 other days (10 GB)Level 1 other days (10 GB)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

0

10

20

30

40

50

Page 6: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches66

Retention: RedundancyRetention: Redundancy Retention Policy based on either:Retention Policy based on either:

REDUNDANCYREDUNDANCY -- number of backup copies at any time -- number of backup copies at any time -OR- -OR-

a RECOVERY WINDOWa RECOVERY WINDOW – time span for PIT – time span for PIT

REDUNDANCY 1 is defaultREDUNDANCY 1 is default

Page 7: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches77

Retention: RedundancyRetention: Redundancy For REDUNDANCY 1: When new Level 0 is done, For REDUNDANCY 1: When new Level 0 is done,

previous incrementals are OBSOLETE,previous incrementals are OBSOLETE,i.e. not needed for retention requirementi.e. not needed for retention requirement

Maybe good for Dev DB, PIT of 0-6 in our example, Maybe good for Dev DB, PIT of 0-6 in our example, effectively no PIT guaranteed effectively no PIT guaranteed

Page 8: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches88

Cumulative sizing: Redundancy 1 exampleCumulative sizing: Redundancy 1 example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

0

20

40

60

80

100

120

140

160

Page 9: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches99

Retention: Window 7 DaysRetention: Window 7 Days

For For guaranteed PITguaranteed PIT, specify number of days in , specify number of days in RECOVERY WINDOWRECOVERY WINDOWWindow is PIT to any time in past <nn> days:Window is PIT to any time in past <nn> days:RMAN> CONFIGURE RETENTION POLICY TO RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 days;RECOVERY WINDOW OF 7 days;

NotNot sliding window with deletes after 7 days! sliding window with deletes after 7 days!After Level 0 on Day 8, prior Level 0 still needed.After Level 0 on Day 8, prior Level 0 still needed.Max of three Level 0s at one time, normally two.Max of three Level 0s at one time, normally two.In our example, max size is 270 GB.In our example, max size is 270 GB.

Page 10: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches1010

Cumulative sizing: Window 7 Days exampleCumulative sizing: Window 7 Days example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

0

50

100

150

200

250

300

Page 11: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches1111

Retention Window: Best Use of SpaceRetention Window: Best Use of Space

For any DB where Level 1 is moderate size, best For any DB where Level 1 is moderate size, best use of space is one day less than multiple of use of space is one day less than multiple of Level 0 frequency.Level 0 frequency.

With a Level 0 every 7 days:With a Level 0 every 7 days:6 or 13 or 20 day Recovery Window 6 or 13 or 20 day Recovery Window

Page 12: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches1212

Retention Window: Use of Space Example:Retention Window: Use of Space Example:6,7,13 day retention, Level 0 every week6,7,13 day retention, Level 0 every week

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

0

50

100

150

200

250

300

350

Daily size:Level 0 or 1

6 dayretention

7 dayretention

13 dayretention

Page 13: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches1313

DELETE placement in scriptDELETE placement in script

Now consider a half dozen DBs of the Now consider a half dozen DBs of the same size in one backup script ...same size in one backup script ...

Page 14: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches1414

DELETE placement in scriptDELETE placement in script

Pseudocode for backup script:Pseudocode for backup script:for ORACLE_SID in [DBs to be backed up]for ORACLE_SID in [DBs to be backed up]RMAN> BACKUP level = 0 CHECK LOGICAL tag RMAN> BACKUP level = 0 CHECK LOGICAL tag

LVL0 database;LVL0 database;RMAN> DELETE NOPROMPT OBSOLETE;RMAN> DELETE NOPROMPT OBSOLETE;[End loop][End loop]DELETE at end needs extra 50 GB temporarily DELETE at end needs extra 50 GB temporarily each time through loopeach time through loopDELETE in front is two Level 0s until next day: DELETE in front is two Level 0s until next day: (50X6) = 300GB extra required(50X6) = 300GB extra required

FRA clears automatically, when space exceeds FRA clears automatically, when space exceeds quotaquota

Page 15: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches1515

Naming Convention: setting FORMATNaming Convention: setting FORMAT

CONFIGURE persistently sets value once per CONFIGURE persistently sets value once per DB, can simplify scripting:DB, can simplify scripting:

RMAN> CONFIGURE CHANNEL DEVICE TYPE disk RMAN> CONFIGURE CHANNEL DEVICE TYPE disk FORMAT = '/orabackup/%d/%d_%s_%p_%t';FORMAT = '/orabackup/%d/%d_%s_%p_%t';

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;RMAN> CONFIGURE CONTROLFILE AUTOBACKUP RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE disk TO FORMAT FOR DEVICE TYPE disk TO '/orabackup/%d/%d_%F';'/orabackup/%d/%d_%F';RMAN> SHOW ALL;RMAN> SHOW ALL;

Page 16: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches1616

CompressionCompression

9i: NULL compression: blocks never used9i: NULL compression: blocks never used10g: binary compression10g: binary compression10.2.0.2: empty blocks, used or not10.2.0.2: empty blocks, used or not

Oracle recommends not mixing RMAN vs 3Oracle recommends not mixing RMAN vs 3rdrd party methodsparty methods

We have hardware tape compression -- OK (?)We have hardware tape compression -- OK (?)Benefit is disk savings (longer PIT Window), Benefit is disk savings (longer PIT Window), quicker to tapequicker to tape

Flash Recovery Area: ideas valid also –Flash Recovery Area: ideas valid also –less space allocation required with combo of less space allocation required with combo of Compression and DELETE placement in scriptCompression and DELETE placement in script

Page 17: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches1717

On the Space/Time Continuum: ExampleOn the Space/Time Continuum: Example

Old Sun box (CPU speeds circa 2001):Old Sun box (CPU speeds circa 2001): 9.2 Level 0 non-compressed:9.2 Level 0 non-compressed:

~29 minutes => 39.2 GB~29 minutes => 39.2 GB 10.2 Level 0 compressed parallel 1:10.2 Level 0 compressed parallel 1:

~4 hours~4 hours => 6.2 GB => 6.2 GB That's better than a 6:1 ratio for space,That's better than a 6:1 ratio for space,

but 8 times as long to run but 8 times as long to run Sun V490 (2006, faster CPU): Sun V490 (2006, faster CPU): w/ parallel 2, 41 w/ parallel 2, 41

minutesminutes

Page 18: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches1919

RestoreRestore optimization optimization

Restore optimization, 9i+: file not restored from Restore optimization, 9i+: file not restored from backup if already in correct location and backup if already in correct location and expected info is foundexpected info is found No action required, always “turned on”No action required, always “turned on” Helpful for interruption, e.g. power failureHelpful for interruption, e.g. power failure Especially helpful with tape (slow)Especially helpful with tape (slow)

Page 19: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches2020

BackupBackup Optimization Optimization

CONFIGURE BACKUP OPTIMIZATION ON;CONFIGURE BACKUP OPTIMIZATION ON;

RMAN job must use channel of only one RMAN job must use channel of only one device typedevice type

Page 20: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches2121

BackupBackup Optimization Optimization

Applies to:Applies to: BACKUP DATABASEBACKUP DATABASE BACKUP ARCHIVELOG with ALL or LIKE BACKUP ARCHIVELOG with ALL or LIKE

optionsoptions BACKUP BACKUPSET ALLBACKUP BACKUPSET ALL BACKUP RECOVERY AREABACKUP RECOVERY AREA BACKUP RECOVERY FILESBACKUP RECOVERY FILES BACKUP DATAFILECOPYBACKUP DATAFILECOPY

Page 21: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches2222

BackupBackup Optimization Optimization

When to use?When to use? Read-only tablespaceRead-only tablespace Off-line tablespaceOff-line tablespace Archives in original location multiple daysArchives in original location multiple days BACKUP BACKUPSET: If not turned ON, BACKUP BACKUPSET: If not turned ON,

you’ll have copy of Level 0 every day!you’ll have copy of Level 0 every day!

Page 22: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches2323

BackupBackup Optimization Optimization

Scenario: Multiplex archives to two locations, Scenario: Multiplex archives to two locations, backup each day, but keep archives on the backup each day, but keep archives on the original disk location for 3 days:original disk location for 3 days:

RMAN> BACKUP archivelog all;RMAN> BACKUP archivelog all;RMAN> DELETE archivelogRMAN> DELETE archivelog

until time 'sysdate-3‘; until time 'sysdate-3‘;

Page 23: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches2424

BackupBackup Optimization Optimization

Optimization OFF:Optimization OFF:rc_backup_redolog shows one backup copyrc_backup_redolog shows one backup copyfor each distinct redo log sequence number for each distinct redo log sequence number (multiplex ignored)(multiplex ignored), but one backup copy , but one backup copy for each for each day that archive remains on diskday that archive remains on diskTrue for True for BACKUP BACKUPSETBACKUP BACKUPSET too: too: multiple Level 0s multiple Level 0s go to tape, can make a huge differencego to tape, can make a huge difference

Optimization ON:Optimization ON:just one backup copyjust one backup copy

Page 24: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches2525

Have Ops write to tape, instead of RMAN?Have Ops write to tape, instead of RMAN?

Simplicity makes it appealingSimplicity makes it appealing Catalog only knows disk metadata, no Catalog only knows disk metadata, no

awareness of tape contentawareness of tape content Only one RMAN retention period per DB.Only one RMAN retention period per DB.

Simplest is if same PIT requirement for disk and Simplest is if same PIT requirement for disk and tape; can let tape system age out backups, tape; can let tape system age out backups, because tape is not used directly for recovery, because tape is not used directly for recovery, can be copied to disk, metadata for disk is used.can be copied to disk, metadata for disk is used.

10g can register backup piece in catalog, not 9i10g can register backup piece in catalog, not 9i

Page 25: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches2626

RMAN write to tape, not OpsRMAN write to tape, not Ops

SysAdmin install, symlink from Oracle Home SysAdmin install, symlink from Oracle Home Vendor MML msgs, diagnostic limitationVendor MML msgs, diagnostic limitation Licensing issues – central vs. each clientLicensing issues – central vs. each client Godot, or Agnostic Dial-A-PrayerGodot, or Agnostic Dial-A-Prayer

Page 26: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches2727

RMAN writes from disk to tapeRMAN writes from disk to tape

BACKUP BACKUPSETBACKUP BACKUPSET Avoids need to read from source againAvoids need to read from source again Metadata known for both destinations:Metadata known for both destinations:

If backup disk area dies, tape is automatically If backup disk area dies, tape is automatically used for recoveryused for recovery

Can go disk to disk, disk to tape, but not tape Can go disk to disk, disk to tape, but not tape to tape (VTL implication)to tape (VTL implication)

Page 27: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches2828

Clearing Out Old Entries in Tape Index:Clearing Out Old Entries in Tape Index: Do you have delete privileges? Do you have delete privileges?

Yes – RMAN is the driver:Yes – RMAN is the driver: Use KEEP clause, plus DELETE OBSOLETEUse KEEP clause, plus DELETE OBSOLETE KEEP is not in CONFIGURE, must be in scriptKEEP is not in CONFIGURE, must be in script Alternate: set tape retention policy, do delete Alternate: set tape retention policy, do delete

obsolete for tape, separately for disk w/ obsolete for tape, separately for disk w/ shorter span, e.g.shorter span, e.g.

RMAN> RMAN> DELETE OBSOLETE DELETE OBSOLETE DEVICE TYPE DISKDEVICE TYPE DISK RECOVERY WINDOW OF 7 DAYS;RECOVERY WINDOW OF 7 DAYS;

Page 28: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches2929

Clearing Out Old Entries in Tape Index:Clearing Out Old Entries in Tape Index: Do you have delete privileges? Do you have delete privileges?

No – tape system controls maintenance:No – tape system controls maintenance: Must do CROSSCHECK plus DELETE Must do CROSSCHECK plus DELETE

EXPIREDEXPIRED Variation: different tape profiles, different Variation: different tape profiles, different

periodsperiods

Page 29: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches3030

Specifying Device in ScriptsSpecifying Device in Scripts

Script 1: BACKUP to diskScript 1: BACKUP to disk Do not specify device in BACKUP command: Do not specify device in BACKUP command:

let it use disk defaultlet it use disk default DELETE OBSOLETE: catalog knows about DELETE OBSOLETE: catalog knows about

tape too – have delete privilege from tape?tape too – have delete privilege from tape?• NO: specify DEVICE DISK so RMAN does NO: specify DEVICE DISK so RMAN does

not try communicate with tapenot try communicate with tape• YES: you can leave out device type YES: you can leave out device type

referencereference

Page 30: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches3131

Specifying Device in ScriptsSpecifying Device in Scripts

Script 2: BACKUP BACKUPSET – disk to tapeScript 2: BACKUP BACKUPSET – disk to tape Must specify DEVICE TYPE SBT (acronym Must specify DEVICE TYPE SBT (acronym

for System Backup to Tape) so it does not try for System Backup to Tape) so it does not try use the default disk deviceuse the default disk device

Catalog Maintenance:Catalog Maintenance:Device Device alreadyalready specified above – specified above – have delete privilege from tape? have delete privilege from tape?• NO: use CROSSCHECKNO: use CROSSCHECK• YES: you can use DELETE OBSOLETEYES: you can use DELETE OBSOLETE

Page 31: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches3232

Specifying Device in ScriptsSpecifying Device in Scripts

Script 3: RESTORE/RECOVERScript 3: RESTORE/RECOVER With CONFIGURE to set up auto allocation, With CONFIGURE to set up auto allocation,

catalog knows everything to complete these catalog knows everything to complete these tasks, no need to specify a devicetasks, no need to specify a device

Inside retention period, everything comes Inside retention period, everything comes from disk, unless space pressure in FRA from disk, unless space pressure in FRA (insufficient allocation) requires transfer to (insufficient allocation) requires transfer to tape, with auto delete from disk tape, with auto delete from disk

Otherwise, one or more tape channels auto Otherwise, one or more tape channels auto allocated, depending on PARALLELISM allocated, depending on PARALLELISM specified in CONFIGURE command specified in CONFIGURE command

Page 32: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches3333

The Good, The Bad, The Ugly (a Sampling)The Good, The Bad, The Ugly (a Sampling)

Many features well thought out, e.g.Many features well thought out, e.g. Complex rules for OPTIMIZATION, different Complex rules for OPTIMIZATION, different

for disk and tapefor disk and tape Use of features outside of script allows more Use of features outside of script allows more

generic script, e.g. binary compression with generic script, e.g. binary compression with CONFIGURE, Block Change Tracking turned CONFIGURE, Block Change Tracking turned on from SQLon from SQL

Page 33: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches3434

The Good, The Bad, The Ugly (a Sampling)The Good, The Bad, The Ugly (a Sampling)

Significant space savings from incrementals plus Significant space savings from incrementals plus several types of compression; PIT is easier with several types of compression; PIT is easier with more days on diskmore days on disk

Bonus from doing incrementals: covers for when Bonus from doing incrementals: covers for when object is created with NOLOGGING optionobject is created with NOLOGGING option

Plenty of detail to learn (unavoidable Bad)Plenty of detail to learn (unavoidable Bad)

Page 34: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches3535

The Good, The Bad, The Ugly (a Sampling)The Good, The Bad, The Ugly (a Sampling)

For A Few Dollars More, can we fix the ugly?!?For A Few Dollars More, can we fix the ugly?!? LIST command is for basic reporting:LIST command is for basic reporting:

VERBOSE or SUMMARY, nothing in betweenVERBOSE or SUMMARY, nothing in between What if we want to see backupset file names? What if we want to see backupset file names?

Can’t use SUMMARY; VERBOSE shows a bit Can’t use SUMMARY; VERBOSE shows a bit of what we want in lots of outputof what we want in lots of output

Limiting based on device type not easyLimiting based on device type not easy RC* and V$* views offer more controlRC* and V$* views offer more control

Page 35: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches3636

Cover Your Sixes ...Cover Your Sixes ...

Page 36: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches3737

...so you don’t get caught by surprise!...so you don’t get caught by surprise!

Page 37: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches3838

Cover Your SixesCover Your Sixes

CHECK LOGICAL is not defaultCHECK LOGICAL is not default The ALL keyword has somewhat different The ALL keyword has somewhat different

meaning, depending on context:meaning, depending on context: BACKUP ARCHIVELOG ALL gives one copy BACKUP ARCHIVELOG ALL gives one copy

of distinct log sequence from multiplexed of distinct log sequence from multiplexed archive locations archive locations

DELETE ALL refers to every log, including DELETE ALL refers to every log, including multiplexedmultiplexed

Page 38: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches3939

Cover Your SixesCover Your Sixes

Similar commands below -- Be clear about what Similar commands below -- Be clear about what you are deleting, originals or backups:you are deleting, originals or backups:

RMAN>DELETE FORCE ARCHIVELOG ALL RMAN>DELETE FORCE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-30';COMPLETED BEFORE 'SYSDATE-30';

--------------------------------------------------------------------------------------------------------------RMAN>DELETE FORCE RMAN>DELETE FORCE BACKUP OFBACKUP OF ARCHIVELOG ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-30';ALL COMPLETED BEFORE 'SYSDATE-30';

Page 39: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches4040

Cover Your SixesCover Your Sixes

PARALLELISM:PARALLELISM: Number of automatic channels, e.g. tape Number of automatic channels, e.g. tape

allocated for RESTOREallocated for RESTORE NotNot number of server processes per channel number of server processes per channel

as I originally assumedas I originally assumed OTN tuning paper advises 1 channel per tape OTN tuning paper advises 1 channel per tape

drive or physical disk drive or physical disk But higher parallel gives more CPU, which But higher parallel gives more CPU, which

helps compression timehelps compression time

Page 40: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches4141

Conclusion -- ObjectivesConclusion -- Objectives Show how simple choices affect use of Show how simple choices affect use of

space/time:space/time: Multiple of Level 0, minus 1 dayMultiple of Level 0, minus 1 day Put “delete obsolete” at end of scriptPut “delete obsolete” at end of script

Choose good practices for features, e.g.:Choose good practices for features, e.g.: Compression – 3 types, allows longer retentionCompression – 3 types, allows longer retention Optimization – esp. Level 0 to tape!Optimization – esp. Level 0 to tape! Disk/tape use: Ops vs. MMLDisk/tape use: Ops vs. MML

Cover your sixes. Misunderstanding a feature Cover your sixes. Misunderstanding a feature could lead to a surprise.could lead to a surprise.

Page 41: IOUG Collaborate -- April 16, 2008 1 Part 1 -- RMAN in the Trenches: To Go Forward, We Must Backup Philip Rice Univ. of California Santa Cruz Session #315.

IOUG Collaborate -- April 16, 2008IOUG Collaborate -- April 16, 2008 RMAN in the TrenchesRMAN in the Trenches4242

A & QA & Q

Evaluations -- Evaluations -- Session 315Session 315: RMAN in the Trenches: RMAN in the Trenches Philip RicePhilip Rice price [at] ucsc.eduprice [at] ucsc.edu

Acknowledgements:Acknowledgements:Timothy Chien, Oracle Principal Product Mgr.Timothy Chien, Oracle Principal Product Mgr.Bill Wagman, UC DavisBill Wagman, UC Davis

A & Q A & Q AAnswers: Wisdom to share?nswers: Wisdom to share? QQuestions?uestions?