Presentation is loading. Please wait.

Presentation is loading. Please wait.

Shell Canada Limited Session: 36487 Compelling Reasons to Use Oracle9i R2 RMAN Wayne Linton Oracle Database Administrator Shell Canada Limited Session.

Similar presentations


Presentation on theme: "Shell Canada Limited Session: 36487 Compelling Reasons to Use Oracle9i R2 RMAN Wayne Linton Oracle Database Administrator Shell Canada Limited Session."— Presentation transcript:

1 Shell Canada Limited Session: 36487 Compelling Reasons to Use Oracle9i R2 RMAN Wayne Linton Oracle Database Administrator Shell Canada Limited Session id 36487:

2 Shell Canada Limited Session: 36487 whoami  Wayne Linton, I.S.P.  30+ years Shell Canada Limited  30+ year industry, 10+ years Oracle  OCP certified from 7.3 through 9i  past president Calgary Oracle Users Group  published in Select, Oracle magazines  part time Oracle DBA instructor at Southern Alberta Institute of Technology

3 Shell Canada Limited Session: 36487 Been There, Done That  ‘traditional’ hot and cold backups scripted for OpenVMS with parallel output streams, NT, UNIX  8i and 9iR2 RMAN on NT and UNIX dialects  cobbling of OS scripting wrapped around various Oracle utility backup commands  have performed complete and PIT production recoveries using both RMAN and traditional procedures

4 Shell Canada Limited Session: 36487 Intended Audience  Oracle Database Administrators who: –have never used RMAN and currently perform backups in the old ‘tried-n-true’ method –currently use a 3rd party tool because they understand the value of server managed backup and recovery –attempted previously to use but gave up on the earlier releases of RMAN –are currently using 8i RMAN having worked through the frustrations and look forward to 9iR2

5 Shell Canada Limited Session: 36487 Agenda  brief introduction to server managed backup/recovery and compelling reasons to start using RMAN  for users of 3rd Party backup tools, THE compelling reason to switch to RMAN  for pre-9i R2 users of RMAN, compelling reasons to upgrade!  9iR2 RMAN backup demo  9iR2 RMAN block recovery demo

6 Shell Canada Limited Session: 36487 RMAN at Shell Canada Solaris 9203 rdbms RMAN Catalog 9203 Solaris 9203 (1) Solaris 9203 (2) Solaris 817 (5) NT4817 (1) AIX817 (1) 816 (2) AIX817 (3) AIX817 (1) 816 (2) sqlnet staggered backup schedules to prevent deadlocks

7 Shell Canada Limited Session: 36487 Backup and Recovery  only reason to backup is to be able to recover!  one day, you WILL have to recover –where are your backups? are they any good? –have you done a recovery test lately?  any database worth saving will be in archivelog mode so that you can perform...  online (‘hot’) backups for high availability  recover from media failure and significant user (yes, this includes the DBA!) errors

8 Shell Canada Limited Session: 36487 User Managed...  dynamic O/S & Oracle utility scripts –begin backup / copy datafile / end backup –can generate significant additional redo  backup complete datafiles (all blocks)  manual log switches and archivelog backup  manually scripted parallelism  manual copy of pfile, cfile binary and trace  manual management of backups, archive logs

9 Shell Canada Limited Session: 36487 User Managed contd....  backup scripts differ for each O/S  backup might contain corrupted data  do I have ALL the required archived redo to recover from this backup?  manual cloning tedious and preserves the internal dbid  restore / recovery is totally a manual process  Q: where are the backups? can I recover?

10 Shell Canada Limited Session: 36487 Oracle Knows ….  Everything about your database: –datafiles, tablespaces, variable blocksizes –data blocks used and not used –data blocks changed since last backup –blocks changed during backup (fractured) –controlfile, backup history (can get big!) –current and archived redo logs –SPFILE (persistent server parameter file) –standby & RAC databases (not discussed here)

11 Shell Canada Limited Session: 36487 Backup for Recovery  one day you WILL have to recover  do you know what backups are needed ?  do you know where they are located ?  are you certain that the backups are good ?  do you have all the required archive logs ?  are your recovery skills a little rusty?

12 Shell Canada Limited Session: 36487

13 Shell Canada Limited Session: 36487 A Matter of Trust ? You Trust the Management of your Data to Oracle... Why not Trust the Management of your Backup and Recovery to Oracle?

14 Shell Canada Limited Session: 36487 What Is RMAN?  Recovery Manager  Oracle utility to backup, restore, recover databases from Oracle 8+  invoked from command line or Enterprise Manager GUI  is aware of Oracle database internals  tracks location of all backup files needed for recovery (in controlfile or separate catalog)  “server managed” backup and recovery

15 Shell Canada Limited Session: 36487 Server Managed target DB RMAN Catalog -- Target version compatible repository media management layer target home RMAN binary server processes cf channels polling / monitor

16 Shell Canada Limited Session: 36487 RMAN Server Managed...  RMAN uses Oracle-aware server processes to perform backup and recovery operations  fully integrated with database, fully supported  can skip never-used blocks and unchanged blocks (incremental) to save space and time  detects and re-reads fractured blocks so...  hot backups do not generate additional redo  checks every block for corruption

17 Shell Canada Limited Session: 36487 RMAN Server Managed...  parallelism built in (Enterprise Edition)  interfaces to tape via media management layer (MML) API (vendor-supplied software)  knows what backups have been taken, and where they are located (cfile or catalog)  manages log switches and archive log backups and clearing of archivelog disk(s)  manages removal of obsolete backups

18 Shell Canada Limited Session: 36487 RMAN Server Managed...  O/S independent scripting language  scripts can be stored in catalog  can do backup / restore validation testing  lists backups and reports recoverability status  clone, standby database creation  knows where to find and what is needed to do recovery, and restores required backup files automatically

19 Shell Canada Limited Session: 36487 RMAN - Server Managed  RMAN uses Oracle-aware server processes to perform backup and recovery operations  fully integrated with database, fully supported  knows what backups to take, have been taken, and where they are located (cfile or catalog)  knows what backups are needed for recovery, and restores the required backup files to the right location automatically

20 Shell Canada Limited Session: 36487 RMAN Answers the Questions: Which backups do I need? Where are they? Can I recover?

21 Shell Canada Limited Session: 36487 #1Fully Integrated with Database Fully Supported by Oracle –aware of internals so can optimize for performance hot backup handling of fractured blocks skips backup of unused / unchanged blocks –standby backups fully interchangeable with primary (can offload backup load to standby machine!) –can create clone and standby databases (duplicate command) –knows about RAC

22 Shell Canada Limited Session: 36487 #2Supports Incremental Backups –smaller backups and reduced backup/recovery time –reads every block and checks for corruption –multi-level incremental and cumulative backup schemes possible –backups to disk (faster restore) or tape directly –can even do ‘cold’ (mounted) incremental backups!

23 Shell Canada Limited Session: 36487 Incremental Backups  Time/space depends upon amount of change backup time % db block change db block read / corruption checking archivelogs changed block backup writes space needed

24 Shell Canada Limited Session: 36487 #3Online Backups Simply & Efficiently –no need for begin-end backup commands –fractured (changed) blocks re-read by RMAN during online backups –no additional redo generated –multiple output streams (channels) in parallel –multi-file read, block interleaving to one backupset  current redo log switched, archived, and backed up as part of backupset automatically

25 Shell Canada Limited Session: 36487 Things to Note...  performance when using parallelism and interleaving depends on hardware configuration (cpu, disk, # tape drives)  no control over what files to multiplex together  RMAN backupset format is proprietary, so …  RMAN must be used for restore operation  also supports file image backups (to disk only) that can be used directly without restore

26 Shell Canada Limited Session: 36487 #4Capture and Reporting of Backup Metadata –controlfile contains relevant RMAN backup metadata (whether you use RMAN or not!) –controlfile size governed by parameter control_file_record_keep_time = #days –LIST datafile, archivelog backup information –REPORT unrecoverable, report obsolete, etc. –recommended (but optional) use RMAN Catalog to also store backup metadata for multiple databases  backup will use controlfile if catalog not reachable

27 Shell Canada Limited Session: 36487 3rd Party Users  3rd party tools differ little from RMAN  have nicer GUI than OEM ?  BUT cost increases with size or number of databases or servers where software used  why pay a lot of money for functionality you already have?

28 Shell Canada Limited Session: 36487 #5RMAN is FREE!! –included in database license –comes with Legato MML software to write to tape –can purchase MML software from preferred third-party media management vendor –see http://otn.oracle.com/deploy/availability for members of the Backup Solutions Programhttp://otn.oracle.com/deploy/availability

29 Shell Canada Limited Session: 36487 Pre-9i users of RMAN  early versions of RMAN were somewhat awkward to use  verbose scripting and messages  lacking in ‘basic’ functionality like deletion of obsolete O/S backup files  9i and 9iR2 have significantly improved usability and functionality

30 Shell Canada Limited Session: 36487 Pre-9i Users  9i can still use the verbose scripting language of the earlier versions, but why would you want to?  Note: you must use the RMAN executable version that comes in the ORACLE_HOME of the target database! –search metalink: RMAN compatibility matrix  RMAN enhancements are a small part of the many reasons to upgrade to 9iR2!

31 Shell Canada Limited Session: 36487 #6Persistent Configuration Parameters –RMAN remembers backup settings from one session to another (in controlfile, catalog), making routine backups as simple as … BACKUP DATABASE; –set once and forget about them –can configure many parameters...

32 Shell Canada Limited Session: 36487 run { allocate channel d1 type disk; allocate channel d2 type disk; allocate channel d3 type disk; sql "alter system switch logfile"; backup incremental level 0 format '$HOME/BACKUP/%d_%t_%s_%p.bus' filesperset 5 (database include current controlfile); sql "alter system archive log current"; backup format '$HOME/BACKUP/%d_%t_%s_%p.bus' (archivelog all delete input); backup format '$HOME/BACKUP/%d_%t_%s_%p.bus' (current controlfile); release channel d1; release channel d2; release channel d3; } backup database incremental level 0 plus archivelog delete all input; 8i vs 9i RMAN Backup Script

33 Shell Canada Limited Session: 36487 Persistent Config. Params show all; CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS; CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'd:\orabackup\rman\%d_cfile_%F.bus'; CONFIGURE DEVICE TYPE DISK PARALLELISM 2; CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'd:\orabackup\rman\%d_%T_%s_%p.bus'; CONFIGURE MAXSETSIZE TO UNLIMITED; CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘d:\oracle\ora92\database\SNCFWAIN9I.ORA'; # default

34 Shell Canada Limited Session: 36487 #6aConfigure Retention Policy –by backup redundancy count or number of days recovery window, will determine how many backups to keep for how long CONFIGURE RETENTION POLICY … –then the obsolete OS backup files are physically removed by the command: DELETE OBSOLETE;

35 Shell Canada Limited Session: 36487 #6bAuto Channel Allocation & Parallelism –channels are allocated automatically –no need to code each channel separately –number of channels allocated specified with parallelism parameter CONFIGURE DEVICE TYPE DISK PARALLELISM 2;

36 Shell Canada Limited Session: 36487 #6cControlfile, SPFILE Auto Backup –if set to ON, controlfile and spfile backed up together in separate backup piece with every backup CONFIGURE CONTROLFILE AUTOBACKUP ON; –controlfile and spfile always and automatically backed up with datafile #1 (system) if autobackup set to OFF –note that spfile automatically backed up, NOT pfile!

37 Shell Canada Limited Session: 36487 #6cControlfile, SPFILE Auto Backup cont’d... –if set to ON, controlfile and spfile backed up automatically whenever the database structure is changed –new, dropped, offlined, onlined tablespace, datafile, redo logs, renamed file, etc. –no need to invoke RMAN for this to happen –auto-backup event noted in the alert log

38 Shell Canada Limited Session: 36487 #6dOther Noteworthy Parameters –skip read-only tablespaces already backed-up with CONFIGURE BACKUP OPTIMIZATION ON; –exclude specific tablespaces with CONFIGURE EXCLUDE FOR TABLESPACE xxxxxx; –create up to 4 backup copies with CONFIGURE BACKUP COPIES TO n;

39 Shell Canada Limited Session: 36487 #7 Auto Archive and Backup Current Redo –no need to manually switch, backup current log –one copy of all archived logs backed up, current log switched, archived, and then also backed up –guaranteed to save all requisite redo for recovery BACKUP DATABASE PLUS ARCHIVELOG;

40 Shell Canada Limited Session: 36487 #8 Clearing Multiple Archivelog Destinations –pre-9i supported clearing only 1 archivelog destination –multiple archivelog destinations searched if necessary to obtain good log copy for backup –all archivelog destinations cleared after backup with command: BACKUP DATABASE PLUS ARCHIVELOG DELETE ALL INPUT;

41 Shell Canada Limited Session: 36487 #9Less Verbose Runtime Messages –every line of pre-9i RMAN output was prefixed with RMAN-xxxxx, plus additional less useful informational messages obscured the ‘good stuff’ –these can be optionally turned on, but are supressed by default –errors will still be prefixed with RMAN-xxxxx –scan the log for RMAN-00569

42 Shell Canada Limited Session: 36487 D E M O N S T R A T I O N RMAN Incremental Backup … in progress

43 Shell Canada Limited Session: 36487 Demonstration  show all; (persistent configuration parameters)  level 2 incremental backup: backup incremental level 2 database plus archivelog delete all input;  list backup of tablespace WAIN;  report unrecoverable;  delete obsolete;

44 Shell Canada Limited Session: 36487 #10 Block Media Recovery –no need to offline and restore large datafile when only a few blocks are corrupted –backup / validate places location of corrupted database blocks in view: v$database_block_corruption –alert log also lists corrupted file#, block# BLOCKRECOVER CORRUPTION LIST;

45 Shell Canada Limited Session: 36487 D E M O N S T R A T I O N RMAN blockrecover

46 Shell Canada Limited Session: 36487 Demonstration  report unrecoverable;  select * from v$database_block_corruption;  corrupt tablespace wain datafile  backup validate check logical tablespace wain;  select * from v$database_block _corruption;  blockrecover corruption list;  backup validate check logical tablespace wain;  select * from v$database_block _corruption;

47 Shell Canada Limited Session: 36487 #11 Restartable Backups and Restores BACKUP DATABASE NOT BACKED UP SINCE TIME … –Restore failures may leave good versions of some datafiles in the right place –restarted restore will NOT restore those files –can force them to be restored anyway with: RESTORE FORCE...

48 Shell Canada Limited Session: 36487 #12 Staging of Archivelogs During Recovery –sometimes you don’t have enough disk space to restore all the archived redo logs required for recovery (in this example, only 100M) –new feature automatically ‘stages’ restore of archived logs as per available disk, applies them, and deletes them to make room for next set of logs RECOVER DATABASE DELETE ARCHIVELOG MAXSIZE 100M … ;

49 Shell Canada Limited Session: 36487 #13 Backing Up Backupsets –backupsets can reside on disk for faster restore –older backupsets can be backed up to tape and deleted automatically from disk to make room for new backups on disk –backupset backups are also checked for corruption BACKUP BACKUPSET … CREATED BEFORE … DELETE INPUT;

50 Shell Canada Limited Session: 36487 #14 Other Important RMAN Functions –recover to previous ‘incarnations’ if using catalog –automatic ‘tagging’ of backups –DBNEWID to change id of ‘manually’ cloned DB –OEM GUI wizard improvements  ‘automated’ TSPITR for self-contained tablespaces  DUPLICATE command to build clone and standby databases  BACKUP and RESTORE VALIDATE

51 Shell Canada Limited Session: 36487 My Personal Favourites  Configure Retention Policy (Delete Obsolete!)  Configure Controlfile Autobackup  Other Persistent Configuration Parameters!!!!!  Block Media Recovery while still Online!  Backup Database Plus Archivelog Delete All Input  Recover Database Delete Archivelog Maxsize  Restartable Backups and Restores

52 Shell Canada Limited Session: 36487 Upon The Shoulders of...  Tammy Bednar, Oracle Corporation Database Backup & Recovery Strategies and Best Practices - paper 213, OOW 2001 Database Backup & Recovery Strategies and Best Practices  Tammy Bednar, Oracle Corporation Rich Bernat, Chevrontexaco Corporation Are You Using the Best Solution for Protecting Your Enterprise? - paper 32513, OOW 2002 Are You Using the Best Solution for Protecting Your Enterprise?

53 Shell Canada Limited Session: 36487 Upon The Shoulders of...  Dave Anderson, SkillBuilders, Inc. A Practical Introduction to Oracle9i RMAN Oratechs, 2003 A Practical Introduction to Oracle9i RMAN

54 Shell Canada Limited Session: 36487 Next Steps….  Recommended sessions –40104 RMAN 10g: Reloaded - Tammy Bednar Tues. 9 th, 3:30 PM Moscone Room 304 –36675 RMAN 10g & ATA Storage in Action - Bob Ng Weds. 10 th, 8:30 AM (not sure which room)  Recommended hands-on labs –Manage the Database Environment, Lesson 6 Performing Backups and Recovering Your Database  Demogrounds –10g RMAN (many!) New Features, new EM interface

55 Shell Canada Limited Session: 36487 Next Steps….  Relevant web sites to visit for more information –Metalink - many technical notes, articles, papers –OTN & Oracle Documentation Oracle9i Recovery Manager User’s Guide - A96566-01 Oracle9i Recovery Manager Reference - A96565-01 Oracle9i Recovery Manager Quick Reference - A96564-01 –Oracle9i RMAN Backup and Recovery, Freeman & Hart, ISBN 0-07-222662-5

56 Shell Canada Limited Session: 36487 Reminder – please complete the OracleWorld online session survey Thank you.

57 Shell Canada Limited Session: 36487 A Q & Q U E S T I O N S A N S W E R S

58 Shell Canada Limited Session: 36487 Compelling Reasons to Use Oracle9i R2 RMAN Wayne Linton Oracle Database Administrator Shell Canada Limited wayne.linton@shell.ca Session id 36487:


Download ppt "Shell Canada Limited Session: 36487 Compelling Reasons to Use Oracle9i R2 RMAN Wayne Linton Oracle Database Administrator Shell Canada Limited Session."

Similar presentations


Ads by Google