rmanpres

Embed Size (px)

DESCRIPTION

presentation of RMAN recovery

Citation preview

  • AgendaRMAN ArchitectureWhy Use RMAN?Implementation DecisionsRMAN Oracle9i New Features

    PPOUG, 05-OCT-01

  • RMAN ArchitectureRecovery Manager (RMAN) is a tool that can be used for Backup, Restore, and Recovery operations on your target databaseStandard utility when installing Oracle binariesNo extra license requiredOnly works on 8.0 or higherSome features only implemented if using Enterprise Edition

    PPOUG, 05-OCT-01

  • RMAN Architecture (continued)

    TargetDatabasedatafilescontrolfilesArchived redo logsrmanServerProcessesRecoveryCatalogDatabase(optional)Backup fileson diskServerProcessesServerProcessesMediaManagement(optional)Backupmedia

    PPOUG, 05-OCT-01

  • RMAN Architecture (continued)Target DatabaseDatabase to be backed up, restored,or recoveredDatafiles, controlfies, archived redo files are backed uprman executableUtility you invoke for backup, restore, and recovery operationsProcesses and ChannelsRMAN uses processes to communicate with target and catalog databasesA process opened for I/O is called a channel

    PPOUG, 05-OCT-01

  • RMAN Architecture (continued)Backups, Backup Sets, Backup PiecesBackups are made up of Backup SetsBackup Sets are made up of Backup PiecesBackup pieces are the physical backup filesrman is only utility that can read/write from physical filesTarget database control filesContain information about RMAN backup operationsSQL> alter session set events immediate trace name controlf level 10;Backup sets, pieces, datafilesConfiguration settings (Oracle9i only)

    PPOUG, 05-OCT-01

  • RMAN Architecture (continued)Whats the Catalog Database?A separate database usually on a separate host from target databaseSchema that has objects that store data about backup, restore, and recovery activitiesCatalog Database (optional)Optional because much of same meta data in catalog is always stored in the target control fileCatalog does not contain backup files

    PPOUG, 05-OCT-01

  • RMAN Architecture (continued)Media Management Layer (MML)3rd party piece of softwareTracks what files have been written to what tapesMML required if backing up files to tapeOptional because you can take backup directly to diskCan be frustrating to setup

    PPOUG, 05-OCT-01

  • So Why Use RMAN?Incremental backupsFull will backup only used blocksIncremental scheme to back up changed blocksBackup resources correlate to transaction activity and not the size of the database

    PPOUG, 05-OCT-01

  • RMAN Advantages (continued)Tablespaces not put in backup modeNo extra logging of full blocks to online redo logs during backupWith RMAN a database process is doing the copyRMAN does a head/tail check on each block

    PPOUG, 05-OCT-01

  • RMAN Advantages (continued)Automatic checking for corruptionDatabase blockArchived redo logRMAN reads every block and checks for corruptionCorrupt blocks information loggedv$backup_corruptionv$copy_corruption

    PPOUG, 05-OCT-01

  • RMAN Advantages (continued)Configurable I/O characteristicsConfigure multiple I/O channels to process in parallel backup and restore commandsSet max file sizeSet max read rate

    PPOUG, 05-OCT-01

  • RMAN Advantages (continued)Logging of all backup operationsRMAN writes what/when/where to target controlfile (and catalog if using)Listing and reporting commands

    PPOUG, 05-OCT-01

  • Implementation DecisionsBackup to disk (no MML required)Backup to tape (must use MML)Use RMAN with catalogUse RMAN without catalog

    PPOUG, 05-OCT-01

  • Most Moving PartsTargetDatabasedatafilescontrolfilesArchived redo logsrmanServerProcessesRecoveryCatalogDatabaseServerProcessesServerProcessesMMLBackupmedia

    PPOUG, 05-OCT-01

  • Simplest Implementation TargetDatabasedatafilescontrolfilesArchived redo logsrmanServerProcessesBackup fileson diskServerProcesses

    PPOUG, 05-OCT-01

  • Disk Based BackupSet channel type diskLet O/S backup scrape files to tapeSometime after O/S backup delete RMAN backup files from diskAdvantages of DiskEasier to setup (no MML)Fewer moving partsDisk access faster

    PPOUG, 05-OCT-01

  • Disk Based Backup (continued)Disadvantages of DiskIf RMAN backup file has been deleted from disk, and if needed during a restore, DBA has to tell Operator which file needs to be retrieved and what day it was backed up

    PPOUG, 05-OCT-01

  • Tape Based BackupConfigure RMAN to backup to tape Implement MMLSet channel type sbt_tape

    Advantages of TapeTape storage is cheaper than diskMight be only option for a large databaseMML keeps track of long history of what file is on what tape

    PPOUG, 05-OCT-01

  • Tape Based Backup (continued)Disadvantages of TapeMML setup can be frustratingAnd MML adds complexity

    PPOUG, 05-OCT-01

  • Why Use a Catalog?Gives you more flexibility in certain situations

    Oracle8i reasons to use a catalogRestoring controlfileMarking backup sets unavailableListing commands

    PPOUG, 05-OCT-01

  • Why Use a Catalog? (continued)8i and 9i Reasons to Use CatalogOne centralized repository for all your target databasesIf not using catalog, finite amount of days of RMAN backup operations storedcontrol_file_record_keep_time has a default of 7 daysCould be an issue for a database with hundreds of datafilesWith catalog you can store data for long periods of time

    PPOUG, 05-OCT-01

  • Catalog DisadvantagesAnother moving partAnother database to maintain, monitor, backup, etc.Can get complex if many different versions of targetsOne catalog, one schemaOne catalog, multiple schemasDifferent catalogs

    PPOUG, 05-OCT-01

  • If Not Using a CatalogMay need to increase init.ora control_file_record_keep_timeIn 8i, ensure that you backup your controlfile outside of RMAN

    SQL> alter database backup controlfile to /;

    PPOUG, 05-OCT-01

  • RMAN 9i New FeaturesRESTORE command optimizedBlock level recoveryNew ways to handle archived redoConfigurable Persistent SettingsAutobackup of controlfileOptimizationI/O channel characteristicsBackup/Restore syntax simplified

    PPOUG, 05-OCT-01

  • Oracle9i New FeaturesCan easily give fellow DBA heart attackPick a paranoid oneSetupNo Server Manager in Oracle9iCreate a file $ORACLE_HOME/bin/svrmgrlchmod +x

    echo echo SVRMGR> ORA-99999: deleting all datafilessleep 2

    PPOUG, 05-OCT-01

  • RMAN 9i New FeaturesRESTORE command optimized

    RMAN restore now does:Checks if file is on diskChecks file headerIf passes checks, does not restore

    Can override w/FORCE option

    PPOUG, 05-OCT-01

  • RMAN 9i New FeaturesBlock Level RecoveryDetecting block level corruptionv$backup_corruptiontrace filesdbverify

    RMAN> blockrecover datafile 2 block 30;

    PPOUG, 05-OCT-01

  • RMAN 9i New FeaturesBlock Level Recovery (continued)Appropriate for small amounts of corruptionCould reduce mean time to recoveryDoes not replace datafile restore/recoveryGives DBA another restore/recovery tool

    PPOUG, 05-OCT-01

  • RMAN 9i Archive Redo BackupsNew BACKUP PLUS ARCHIVELOG command

    RMAN> backup database plus archivelog; Switches online redo logsBackup archivelog all;Backs up files database datafilesSwitches online redo logsBacks up any archived redo logs generated during backup

    PPOUG, 05-OCT-01

  • 9i RMAN Controlfile RestoreNew CONFIGURE commandSettings stored in target controlfileEnable autobackup controlfile

    RMAN> configure controlfile autobackup on;

    Controlfile automatically backed up with BACKUP and COPY commandsRMAN controlfile restore can then be done without connecting to catalog

    PPOUG, 05-OCT-01

  • RMAN 9i New Features (continued)Configure optimization

    RMAN> configure backup optimization on;

    If a file has been backed up and hasnt changed since last backup, RMAN will skip the file

    PPOUG, 05-OCT-01

  • RMAN 9i New Features (continued)Configure persistent channel I/O settingsPersist until you change or clear

    RMAN> configure default device type to disk;RMAN> configure device type disk parallelism 2;RMAN> configure channel device type disk format /ora01/brdstn/rman_%U.bus;

    RMAN> show all;

    PPOUG, 05-OCT-01

  • RMAN 9i New Features (continued)Syntax simplified for BACKUP and RESTORE commandsNo longer required to wrap within RUN{} commandSyntax now can be as simple as:

    RMAN> backup database;RMAN> restore database;

    PPOUG, 05-OCT-01

  • RMAN SummaryRMAN has significant advantagesMany different ways to implementEnhancements to RMAN in Oracle9iQ&A

    PPOUG, 05-OCT-01