nocoug: august 16, 2007 1 part 2 -- rman in the trenches: to go forward, we must backup philip rice...

38
NoCOUG: August 16, NoCOUG: August 16, 2007 2007 1 Part 2 -- RMAN in the Part 2 -- RMAN in the Trenches: 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

Upload: neil-brown

Post on 25-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

NoCOUG: August 16, 2007NoCOUG: August 16, 2007 11

Part 2 -- RMAN in the Trenches:Part 2 -- 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

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 22

OverviewOverview

Motivation: Few RMAN sessions, & Giving BackMotivation: Few RMAN sessions, & Giving Back Experience Level: Intermediate & BeginnerExperience Level: Intermediate & Beginner Corruption DetectionCorruption Detection Metadata Management and ReportingMetadata Management and Reporting The Good, The Bad, The Ugly (a sampling)The Good, The Bad, The Ugly (a sampling) FlashbackFlashback Performance/Tuning (safety first!)Performance/Tuning (safety first!) Plenty of material today; please ask if for clarity, Plenty of material today; please ask if for clarity,

otherwise best to save questions to endotherwise best to save questions to end

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 33

Corruption DetectionCorruption Detection

Default is to stop the backup as soon as Default is to stop the backup as soon as corruption is detectedcorruption is detected

SET MAXCORRUPT for each datafile would SET MAXCORRUPT for each datafile would override thatoverride that

But MAXCORRUPT should only be used when But MAXCORRUPT should only be used when priority is finishing rest of backup vs. repairing priority is finishing rest of backup vs. repairing corruption (seldom)corruption (seldom)

BACKUP VALIDATE will expose other BACKUP VALIDATE will expose other corruptions, and repair can be done corruptions, and repair can be done

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 44

Corruption DetectionCorruption Detection

Can use RESTORE...VALIDATE to check on Can use RESTORE...VALIDATE to check on backups; this is not checking datafiles (.dbf)backups; this is not checking datafiles (.dbf)

From Oracle Press book: “...validation is not a From Oracle Press book: “...validation is not a comprehensive test.“comprehensive test.“ RESTORE DATABASE looks at headers in RESTORE DATABASE looks at headers in

the level 0 backup, which is used to get the level 0 backup, which is used to get datafilesdatafiles

Level 1 has changes applied on top of those Level 1 has changes applied on top of those datafiles, so level 1 would not come into play datafiles, so level 1 would not come into play until doing until doing RECOVERRECOVER rather than rather than RESTORERESTORE

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 55

Corruption DetectionCorruption Detection

RECOVER...VALIDATE n/a, but can use RECOVER...VALIDATE n/a, but can use VALIDATE instead of RESTORE...VALIDATEVALIDATE instead of RESTORE...VALIDATE Use KEY column values from LIST BACKUP Use KEY column values from LIST BACKUP

SUMMARYSUMMARY Testing shows we can examine any or all Testing shows we can examine any or all

backups, including level 1 and archivelog backups, including level 1 and archivelog backupsbackups

Alternate: RECOVER DATABASE TEST, but Alternate: RECOVER DATABASE TEST, but docs say that the TEST clause can be used docs say that the TEST clause can be used "only if you have restored a backup taken since "only if you have restored a backup taken since the last RESETLOGS operation.“the last RESETLOGS operation.“I tried it: said system datafile in useI tried it: said system datafile in use

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 66

Corruption DetectionCorruption Detection

The init parameters db_block_The init parameters db_block_checkingchecking and and db_block_db_block_checksumchecksum will detect datafile corruptions, as will detect datafile corruptions, as reads and writes are occurringreads and writes are occurring

Similar, but not interdependent:Similar, but not interdependent: When block When block checkingchecking is on, blocks are examined for is on, blocks are examined for

internal consistency --always enabled for the system internal consistency --always enabled for the system tablespace, but off by default for other tablespaces.tablespace, but off by default for other tablespaces.

When When checksumchecksum is on, corruption caused by is on, corruption caused by underlying I/O systems can be detected. If set to underlying I/O systems can be detected. If set to FULL, it also catches in-memory corruptions and FULL, it also catches in-memory corruptions and stops them from making it to the disk. Default is stops them from making it to the disk. Default is TYPICAL, same as TRUE: 9i backward compatibilityTYPICAL, same as TRUE: 9i backward compatibility

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 77

Corruption DetectionCorruption Detection

For strongest possible corruption protection with For strongest possible corruption protection with RMAN backups, a White Paper RMAN backups, a White Paper ((

http://www.oracle.com/technology/deploy/availability/pdf/corruption_wp.pdfhttp://www.oracle.com/technology/deploy/availability/pdf/corruption_wp.pdf)) recommends:recommends: In the initialization parameter file, set In the initialization parameter file, set

DB_BLOCK_DB_BLOCK_CHECKSUMCHECKSUM=TRUE=TRUE ( (defaultdefault setting; setting; default is default is TYPICALTYPICAL for 10g, TRUE for for 10g, TRUE for backward compatibility) backward compatibility)

In BACKUP and RESTORE commands, do In BACKUP and RESTORE commands, do not specify the MAXCORRUPT option, do not not specify the MAXCORRUPT option, do not specify the NOCHECKSUM option, but do specify the NOCHECKSUM option, but do specify the CHECK LOGICAL option specify the CHECK LOGICAL option

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 88

Corruption DetectionCorruption Detection

Turn on db_block_Turn on db_block_checkingchecking (for non-system (for non-system tablespaces) with LOW, MEDIUM, FULL in 10g, tablespaces) with LOW, MEDIUM, FULL in 10g, with 1-10% overheadwith 1-10% overhead

TRUE (backward compatible from 9i) is the TRUE (backward compatible from 9i) is the same as FULLsame as FULL

In docs for this parameter: "You should set In docs for this parameter: "You should set DB_BLOCK_DB_BLOCK_CHECKINGCHECKING to FULL if the to FULL if the performance overhead is acceptable."performance overhead is acceptable."

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 99

Corruption DetectionCorruption Detection

FULL option for db_block_FULL option for db_block_checksumchecksum (10g): (10g): Extra 4-5% overheadExtra 4-5% overhead 10.2 docs: “catches in-memory corruptions 10.2 docs: “catches in-memory corruptions

and stops them from making it to the disk. [...]. and stops them from making it to the disk. [...]. Oracle recommends that you set Oracle recommends that you set DB_BLOCK_DB_BLOCK_CHECKSUMCHECKSUM to TYPICAL.” to TYPICAL.”

Steve Adams says I/O intensive queries with Steve Adams says I/O intensive queries with moderate to high CPU use can be worse than moderate to high CPU use can be worse than the estimate indicated in the docs the estimate indicated in the docs

Testing is advisableTesting is advisable

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 1010

Corruption DetectionCorruption Detection

DB_BLOCK_DB_BLOCK_CHECKSUMCHECKSUM FULLFULL setting or not: setting or not: Prior job: CPU glitch discovered after months Prior job: CPU glitch discovered after months

in production, introduced corruption due to in production, introduced corruption due to heavy batch job use. Financial repercussion heavy batch job use. Financial repercussion $1M+ (1999 $$), vendor essentially gave a $1M+ (1999 $$), vendor essentially gave a top end machine to compensatetop end machine to compensate

Cost for Cost for notnot capturing in-memory corruption capturing in-memory corruption could be high.could be high.

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 1111

Metadata BasicsMetadata Basics

Data Dictionary for backup workData Dictionary for backup work Always in controlfile in virtual tables (V$ views)Always in controlfile in virtual tables (V$ views) Optionally in separate catalog DB, comparable Optionally in separate catalog DB, comparable

info in real tables (& RC* views)info in real tables (& RC* views) Catalog: Open ended time span, multiple DBsCatalog: Open ended time span, multiple DBs

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 1212

Metadata: Create New ControlfileMetadata: Create New Controlfile

All previous metadata lost; asking for fresh startAll previous metadata lost; asking for fresh start How does RESYNC affect catalog?How does RESYNC affect catalog? Testing shows resync is 1-way street, controlfile Testing shows resync is 1-way street, controlfile

to catalogto catalog Nice surprise: Testing shows resync does not Nice surprise: Testing shows resync does not

wipe out catalog entries in wipe out catalog entries in control_file_record_keep_timecontrol_file_record_keep_time period; metadata not lost in catalog DBperiod; metadata not lost in catalog DB

Catalog recommended by Oracle; less critical Catalog recommended by Oracle; less critical with newer featureswith newer features

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 1313

Metadata ManagementMetadata Management

Safety: With CONFIGURE command, turn on Safety: With CONFIGURE command, turn on autobackup of the controlfileautobackup of the controlfile

Controlfile plus catalog: extra layer for safetyControlfile plus catalog: extra layer for safety "High Availability Best Practices" section 2.5.3.2: "High Availability Best Practices" section 2.5.3.2:

Run source backups in nocatalog mode to Run source backups in nocatalog mode to reduce dependency on the catalog database reduce dependency on the catalog database being available. At a later point, do a resyncbeing available. At a later point, do a resync

Feature idea: be able to connect to two catalogs; Feature idea: be able to connect to two catalogs; like mirrored disks;like mirrored disks;alternatively, do standby of catalog DBalternatively, do standby of catalog DB

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 1414

Metadata Reporting: Metadata Reporting: Runtime trends for disk/tapeRuntime trends for disk/tape Do crosstab from RC_BACKUP_PIECE view.Do crosstab from RC_BACKUP_PIECE view.Make anything before 4PM part of previous overnight run: Make anything before 4PM part of previous overnight run:

CREATE OR REPLACE VIEW ucsc_bkup_trend_insert_vw (...column aliases...) AS SELECT CASE WHEN to_char(p.START_TIME,'HH24') < 16 THEN trunc(p.START_TIME - 1) ELSE trunc(p.START_TIME) END AS bkup_date, sdl.SERVER_NAME, d.name, p.device_type, nvl(max(CASE WHEN backup_type = 'D‘ THEN p.ELAPSED_SECONDS END),0) AS LVL0_secs,

nvl(max(CASE WHEN backup_type = 'I' THEN p.ELAPSED_SECONDS END),0) AS LVL1_secs,nvl(max(CASE WHEN backup_type = 'L' THEN p.ELAPSED_SECONDS END),0) AS ARCH_secs,nvl(max(CASE WHEN backup_type = 'D' THEN p.BYTES END),0) AS LVL0_bytes,nvl(max(CASE WHEN backup_type = 'I' THEN p.BYTES END),0) AS LVL1_bytes,nvl(max(CASE WHEN backup_type = 'L' THEN p.BYTES END),0) AS ARCH_bytes,

p.START_TIME, p.COMPLETION_TIMEFROM rc_backup_piece p, rc_database d, ucsc_server_db_list sdl

[...]

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 1515

Metadata Reporting: Metadata Reporting: Runtime trends for disk/tapeRuntime trends for disk/tape

[crosstab from RC viewcrosstab from RC view...]WHERE p.DB_KEY = d.DB_KEY AND d.NAME = sdl.DB_NAME AND p.backup_type in ('D','I','L')GROUP BY (CASE WHEN to_char(p.START_TIME,'HH24') < 16 THEN trunc(p.START_TIME - 1) ELSE trunc(p.START_TIME) END ) , d.NAME, sdl.SERVER_NAME, p.DEVICE_TYPE, p.START_TIME, p.COMPLETION_TIMEORDER BY (CASE WHEN to_char(p.START_TIME,'HH24') < 16 THEN trunc(p.START_TIME - 1) ELSE trunc(p.START_TIME) END ) , sdl.SERVER_NAME, d.name, p.device_type, p.START_TIME;

Make persistent table so we have trend info beyond retention period:create table ucsc_bkup_trend_details as select * from ucsc_bkup_trend_insert_vw;

Do scheduled inserts so trend info is available long term.

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 1616

Metadata Reporting: Metadata Reporting: Runtime trends for disk/tapeRuntime trends for disk/tape

In next 4 slides, we see In next 4 slides, we see OPTIMIZATION OPTIMIZATION ONON in in effect for last several days on graphs. For effect for last several days on graphs. For OPTIMIZATION OPTIMIZATION OFFOFF in earlier days, two factors:in earlier days, two factors:

1.1. Archives on disk for 3 days, used in transition Archives on disk for 3 days, used in transition at our site: results in 3 copies of archive at our site: results in 3 copies of archive backups. This was known/expected.backups. This was known/expected.

2.2. BACKUP BACKUPSETBACKUP BACKUPSET gives multiple tape copies, gives multiple tape copies, including Level 0 each day! The repository including Level 0 each day! The repository knows about Incremental Level, but behavior is knows about Incremental Level, but behavior is different from making original backupset. This different from making original backupset. This was not expected, and metadata reporting was not expected, and metadata reporting brought out this difference.brought out this difference.

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 1717

Metadata Reporting: Metadata Reporting: Schedule Planning –Schedule Planning – Disk TimeDisk TimeArchive backups greatly reduced in last few daysArchive backups greatly reduced in last few days

0

50

100

150

200

250

Min

ute

s

7/20 7/21 7/22 7/23 7/24 7/25 7/26 7/27 7/28 7/29 7/30 7/31 8/1 8/2 8/3 8/4 8/5 8/6

ARCH

LVL1

LVL0

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 1818

Metadata Reporting: Metadata Reporting: Tape to Disk Size RatioTape to Disk Size Ratio Size greatly reduced, no extra Lvl0 copies Size greatly reduced, no extra Lvl0 copies

Ratio reduced from Max of 16:1, down to 1:1Ratio reduced from Max of 16:1, down to 1:1

0

2

4

6

8

10

12

14

16

18

7/21 7/22 7/23 7/24 7/26 7/27 7/28 7/29 7/30 7/31 8/1 8/2 8/3 8/4 8/5 8/6

Tap

e t

o D

isk R

ati

o

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 1919

Metadata Reporting: Metadata Reporting: Tape RuntimeTape Runtime Multiple tape processes from MML Multiple tape processes from MML

Execution Time higher than Clock TimeExecution Time higher than Clock TimeNot cumulative (not stacked) line chartNot cumulative (not stacked) line chart

0

200

400

600

800

1000

1200

7/19 7/20 7/21 7/22 7/23 7/24 7/25 7/26 7/27 7/28 7/29 7/30 7/31 8/1 8/2 8/3 8/4 8/5 8/6

Min

ute

s

CLOCK EXEC

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 2020

Metadata Reporting: Metadata Reporting: Disk/TapeDisk/TapeCumulative Runtime – stacked line chartCumulative Runtime – stacked line chart

0.0

100.0

200.0

300.0

400.0

500.0

600.0

700.0

Min

ute

s

7/19 7/20 7/21 7/22 7/23 7/24 7/25 7/26 7/27 7/28 7/29 7/30 7/31 8/1 8/2 8/3 8/4 8/5 8/6

TAPE

DISK

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 2121

Metadata Reporting: Metadata Reporting: Compression RatioCompression Ratio COMPRESSION_RATIO column is in 10 COMPRESSION_RATIO column is in 10 _summary_summary and and _details_details views, but these are views, but these are “primarily intended to be “primarily intended to be used internally by used internally by Enterprise ManagerEnterprise Manager.”.”Before finding that caveat, I had found results to Before finding that caveat, I had found results to not trust not trust RC_BACKUP_SET_DETAILSRC_BACKUP_SET_DETAILS --- good to --- good to avoid. In following chart, (10.2.0.2 for testing),avoid. In following chart, (10.2.0.2 for testing), Input Bytes is same for Level 0 and 1, so calc is Input Bytes is same for Level 0 and 1, so calc is from total DB used space.from total DB used space.Level 1 ratio is distorted.Level 1 ratio is distorted.

The BDF table in RC_BACKUP_DATAFILE view The BDF table in RC_BACKUP_DATAFILE view knows about Block Change Tracking, and has knows about Block Change Tracking, and has count of blocks scanned, so a better ratio could count of blocks scanned, so a better ratio could be calculated.be calculated.

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 2222

Metadata Reporting: Metadata Reporting: Compression RatioCompression Ratiofrom RC_BACKUP_SET_DETAILS from RC_BACKUP_SET_DETAILS

For device_type = ‘*’,For device_type = ‘*’, MAX Ratio for Level 1 of MAX Ratio for Level 1 of 690 to 1 to 1

1

4

6

47

1

6

7

391

1

6

7

690

0 100 200 300 400 500 600 700 800

CTLFL

ARCH

LVL0

LVL1

Bkup T

ype

Ratio

MAX

AVG

MIN

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 2323

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

Gradual improvements in each release:Gradual improvements in each release: e.g. binary compression in 10ge.g. binary compression in 10g I requested a couple: separate retention I requested a couple: separate retention

periods for disk/tape, ability to display periods for disk/tape, ability to display connection information at the RMAN promptconnection information at the RMAN prompt

Corruption detection during block scanningCorruption detection during block scanning History in the RMAN catalog, e.g. disk and History in the RMAN catalog, e.g. disk and

tape/MML runtimes for planning purposes tape/MML runtimes for planning purposes

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 2424

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

Unavoidable: When testing, we can't modify Unavoidable: When testing, we can't modify metadata in the controlfile to alter behavior for metadata in the controlfile to alter behavior for our purposes, e.g. the shortest retention window our purposes, e.g. the shortest retention window is 1 day (use is 1 day (use ALTER SYSTEM SET FIXED_DATEALTER SYSTEM SET FIXED_DATE ) )

No command editing or buffer display in RMAN No command editing or buffer display in RMAN comparable to sqlplus; LIST command without comparable to sqlplus; LIST command without summary clause can be copious, can be off the summary clause can be copious, can be off the terminal buffer, so cmd not retrievableterminal buffer, so cmd not retrievable

NLS_DATE_FORMAT variable must be set NLS_DATE_FORMAT variable must be set before starting RMAN (no SET cmd)before starting RMAN (no SET cmd)

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 2525

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

RMAN is tied into SQL engine, but no SELECT; RMAN is tied into SQL engine, but no SELECT; For catalog query (sometimes better than LIST), For catalog query (sometimes better than LIST), need separate sqlplus sessionneed separate sqlplus session

RMAN will make a new backup file, but for RMAN will make a new backup file, but for backups in separate directories based on backups in separate directories based on database name (%d in the format), it won't make database name (%d in the format), it won't make a new directory for us; causes backup failurea new directory for us; causes backup failure

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 2626

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

Can't reconnect a different way after command Can't reconnect a different way after command requiring repository connection (e.g. BACKUP), requiring repository connection (e.g. BACKUP), must exit and start overmust exit and start over

GLOBAL stored script in 10g is a step forward:GLOBAL stored script in 10g is a step forward: But no variables and languageBut no variables and language PL/SQL is inherently in engine, e.g. could PL/SQL is inherently in engine, e.g. could

execute correct RMAN syntax based on query execute correct RMAN syntax based on query to determine DB version, allow generic scriptto determine DB version, allow generic script

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 2727

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

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 2828

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

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 2929

Cover Your SixesCover Your Sixes

In 10.2 docs for ALLOCATE CHANNEL: "You In 10.2 docs for ALLOCATE CHANNEL: "You must use a recovery catalog when backing up a must use a recovery catalog when backing up a standby database." -- another benefit of catalogstandby database." -- another benefit of catalog

"When using Flashback Database with a target "When using Flashback Database with a target time at which a NOLOGGING operation was in time at which a NOLOGGING operation was in progress, block corruption is likely in the progress, block corruption is likely in the database objects and datafiles affected by the database objects and datafiles affected by the NOLOGGING operation."NOLOGGING operation."

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 3030

Cover Your Sixes: SyntaxCover Your Sixes: Syntax

Syntax can be similar with different meanings:Syntax can be similar with different meanings:# We're doing a 'normal' backup here, not an image copy:# We're doing a 'normal' backup here, not an image copy:

RMAN> backup as backupset ...;RMAN> backup as backupset ...;# The backupset that was created before is copied to another destination:# The backupset that was created before is copied to another destination:

RMAN> backup backupset ...;RMAN> backup backupset ...;--------------------------------------------------------------------------------------------------# These two will deal with all types: controlfile, datafile, and archivelog# These two will deal with all types: controlfile, datafile, and archivelog

RMAN> CROSSCHECK BACKUP;RMAN> CROSSCHECK BACKUP;RMAN> LIST EXPIRED BACKUP;RMAN> LIST EXPIRED BACKUP;--------------------------------------------------------------------------------------------------# These two affect archivelogs, not backups of archivelogs# These two affect archivelogs, not backups of archivelogs

RMAN> CROSSCHECK ARCHIVELOG ALL;RMAN> CROSSCHECK ARCHIVELOG ALL;RMAN> LIST EXPIRED ARCHIVELOG; RMAN> LIST EXPIRED ARCHIVELOG;

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 3131

Cover Your Sixes: tapeCover Your Sixes: tape

The "BACKUP BACKUPSET" command did not The "BACKUP BACKUPSET" command did not pick up format from CONFIGURE, it used the pick up format from CONFIGURE, it used the default of “%U”, not what I specified for tape:default of “%U”, not what I specified for tape:CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT '%d_%T_%U' SEND [...]CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT '%d_%T_%U' SEND [...] But using the format in ALLOCATE CHANNEL in But using the format in ALLOCATE CHANNEL in the script was successful.the script was successful.

Docs say default of “%U” is unique, but it gave Docs say default of “%U” is unique, but it gave us occasional duplicate tape file names.us occasional duplicate tape file names.

Virtual Tape Library -- "BACKUP BACKUPSET" Virtual Tape Library -- "BACKUP BACKUPSET" command can not copy from tape to tape.command can not copy from tape to tape.We will still want VTL as secondary storage, not We will still want VTL as secondary storage, not as a replacement for our disk backup area. as a replacement for our disk backup area.

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 3232

FlashbackFlashback

9i was logical only, using Undo9i was logical only, using Undo 10g Flashback Database is physical, using 10g Flashback Database is physical, using

Flashback Logs; rewind DB faster than PIT Flashback Logs; rewind DB faster than PIT recoveryrecovery

When to use? Business can not lose When to use? Business can not lose transactions for a number of hours!!transactions for a number of hours!!

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 3333

FlashbackFlashback

Scenarios for Flashback Database:Scenarios for Flashback Database: ““...save the SCN to a spool file, for example, before ...save the SCN to a spool file, for example, before

running a high-risk batch job.“running a high-risk batch job.“ ““Easy conversion of a physical standby database to a Easy conversion of a physical standby database to a

reporting database and back to a standby. [...] reporting database and back to a standby. [...] reverse the activation of a standby database.”reverse the activation of a standby database.”

Test/Dev DB: known starting point for testsTest/Dev DB: known starting point for tests Standby can be reverted to an earlier time, which Standby can be reverted to an earlier time, which

could allow examination and manipulation in two could allow examination and manipulation in two different time periods. This would allow recovery of different time periods. This would allow recovery of corrupted objects.corrupted objects.

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 3434

FlashbackFlashback

Flashback Recovery Area, many file types Flashback Recovery Area, many file types recommended: redo, archive, ctlfile, backupsetsrecommended: redo, archive, ctlfile, backupsets

Potential for more disk contention when all in Potential for more disk contention when all in one areaone area

Example: RAID10 for DB plus redo, archive, Example: RAID10 for DB plus redo, archive, ctlfile now; RAID5 for backupsets (write penalty ctlfile now; RAID5 for backupsets (write penalty not significant enough for off hours batch job); not significant enough for off hours batch job); vendor app generated 25GB in a half hour for vendor app generated 25GB in a half hour for temp tables in reporting(!)temp tables in reporting(!)

Do FRA for a reason, not on a whimDo FRA for a reason, not on a whim

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 3535

Tuning/PerformanceTuning/Performance

Minimize what needs to be read and written:Minimize what needs to be read and written: 10.2.0.2 can skip empty blocks in addition to 10.2.0.2 can skip empty blocks in addition to

unused blocksunused blocks 10g can do binary compression to disk, much 10g can do binary compression to disk, much

less quantity that needs to be taken to tapeless quantity that needs to be taken to tape Concern about backups adversely affecting Concern about backups adversely affecting

online use?online use? RATE clause can limit disk I/ORATE clause can limit disk I/O Look at max bytes/sec of disk system, e.g. for Look at max bytes/sec of disk system, e.g. for

10M max possible, RATE of 5M would allow 10M max possible, RATE of 5M would allow 1/2 of disk capability for non-backup purposes 1/2 of disk capability for non-backup purposes

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 3636

Tuning/PerformanceTuning/Performance

For sites using a physical standby, docs say that For sites using a physical standby, docs say that turning off db_block_checking in a physical turning off db_block_checking in a physical standby "can provide as much as a twofold standby "can provide as much as a twofold increase in the apply rate" for redo logs, but increase in the apply rate" for redo logs, but db_block_checking should not be turned off at db_block_checking should not be turned off at the primary databasethe primary database

Metalink Note 311068.1 -- RMAN Performance Metalink Note 311068.1 -- RMAN Performance Tuning DiagnosticsTuning Diagnostics

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 3737

Tuning/PerformanceTuning/Performance

References:References:

http://www.oracle.com/technology/deploy/availability/pdf/rman_performance_wp.pdfhttp://www.oracle.com/technology/deploy/availability/pdf/rman_performance_wp.pdf

http://www.oracle.com/technology/deploy/availability/pdf/br_optimization.pdfhttp://www.oracle.com/technology/deploy/availability/pdf/br_optimization.pdf

Chapter in 10.2 RMAN Docs -- Advanced User's Guide:Chapter in 10.2 RMAN Docs -- Advanced User's Guide:http://download-west.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmtunin.hthttp://download-west.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmtunin.htm#sthref1057m#sthref1057

NoCOUG: August 16, NoCOUG: August 16, 20072007 RMAN in the Trenches, Part 2RMAN in the Trenches, Part 2 3838

A & QA & Q

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

Presenter: Philip RicePresenter: Philip Rice price [at] ucsc.eduprice [at] ucsc.edu A & Q A & Q AAnswers: Wisdom to share?nswers: Wisdom to share?

QQuestions?uestions?