Archiving & Restoring

  • View
    39

  • Download
    0

Embed Size (px)

DESCRIPTION

Archiving & Restoring. John F. Miller III. TOC. Term & History Disaster Recovery Planning Backup & Restore Procedures Architecture (XPS differences) The grab bag. Terminology. Serial Backup Archives the entire system at a single point in time using only one data stream Parallel Backup - PowerPoint PPT Presentation

Text of Archiving & Restoring

  • Archiving & Restoring

    John F. Miller III

  • TOCTerm & HistoryDisaster Recovery PlanningBackup & Restore ProceduresArchitecture (XPS differences)The grab bag

  • TerminologySerial BackupArchives the entire system at a single point in time using only one data streamParallel BackupArchives the requested dbspace one at a time to N data streamsExternal BackupAllows a third party application to backup the database server while maintain logical consistency

  • TerminologyCold RestoreRestoring the server when the database engine is offlineWarm RestoreRestores of dbspaces which occur while the database engine is onlineMixed RestoreA cold restore of set dbspaces followed by a warm restore of other dbspaces

  • TerminologyImported RestoreTransferring an archive taken on one computer and restoring it on a second computerPoint-in-Time RestoreRestoring the entire system to a single point it timeRestartable RestoreAllows the DBA to pickup the restore from the failure point

  • Early Backup and Restore History1.X TurboOnly Quiescent mode archives4.X named OnLine for advanced archiving technology5.X same core technologylimitation revealed (scalability & extensibility)

  • DSA Backup and Restore History6.0 new client/server model developed7.1 & 7.20 same core technology7.21 new client (onbar)7.3 server API re-write9.2 onbar usability features added

  • Pre-DSA Archive Bad Grammar ArchiveArchive Checkpoint (get timestamp)Free extents recordedReserve pages savedChunks backed-up by ascending chunk numberPages modified during archive are placed in physical logtbtape routinely scans physical log for unarchived before-imagesPages placed directly to tape

  • Pre-DSA RestoreBegins with OnLine off-lineReads configuration file, matches params to config params of archive tapeZero out logs (physical & logical)Validate size of all chunksRead tape, copying pages based on their address directly to disk

  • DSA Archive ArchitectureMajor DifferencesTrue client-server architectureArchived pages logically grouped by dbspacesGranularity of creationsGranularity of restoresWarm restoresPhysical log pages kept in temp tables

  • Server Algorithm ChangesGood Grammar ArchiveList is made of all pages that should be archivedCost vs BenefitBefore images are queued by the modifierA new thread is responsible for the before image handling

  • Disaster RecoveryGoalsPlanning

  • What is a Successful Recovery?Successful recovery is defined by your business needs

  • Goals For RecoveryDetermine acceptable recovery time How long can your business function without the data?How long can your production system be down during a restore?

  • Determine Acceptable Data LossTypeTimeDistributionQuantity

  • Recovery StrategyTune theStrategyAnalyze/Testthe StrategyImplementThe StrategySelectToolsPlan RecoveryGoals

  • Data LayoutPoor data layout can hurt BAR performanceIsolating the different types of data can facility restore priorityExample8 dbspaces each with 2 chunk, but one dbspace has 68 chunk

  • Data Layout ExamplesImportant frequently modified in its own dbspacesimportant data such as orders should dbspace_ordersdbspace containing zipcodes and other lightly modified data can be backed up with less frequency

  • Right, Fast or Cheap?Choose Two!

  • Select ToolsBackup UtilitiesontapeON-BarExternal Backup/RestoreFault Tolerance MechanismsMirroringHigh Availability Data Replication (HDR)Enterprise Data Replication (DR)Load/UnloadHigh Performance Loader (HPL)dbexport/dbimportdbschemaSQL load/unloadonload/onunloaddbloadCustomer ESQL programs

  • Ontape Backup FeaturesBackup at the Server levelSupport for incremental backupsManual or continuous logical log backupRestore entire system or single dbspaceBackup is self describing

  • On-Bar Backup FeaturesParallel backup and restoreSystem and dbspace level backup and restoreSupport for incremental backupsManual or automatic backup of logical logsInstance point-in time recoveryOpen interface for communication with storage managers (XBSA)

  • External Backup FeaturesEBR allows administrators to make a consistent copy of their dbspaces using external toolsUsed with many 3rd party backup productsAllows for both cold and warm restores

  • EBR - ExamplesPlanned uses:File system snapshotsBreaking of mirrorsThird party raw backupBasic StepsBlock coserver(s) at checkpointBackup dbspaces using third party toolsUnblock coserver(s)

  • RestoringLogical Logs requiredRestore looks hung, nothings happeningHandling unanticipated problems

  • Logical Logs Required for a RestoreCold Parallel RestoreStarting log is the log that contains the begin of the oldest active transaction when the first archive checkpoint occurredAt least the logical log that contains the last archive checkpointCold Whole System (Non-Parallel)No logical logs requiredLogs included with archive

  • Logical Logs Required for a RestoreWarm RestoreStarting log is the log that contains the begin of the oldest active transaction when the first archive checkpoint All logs to the current point in timeIf you are using DR then you must include the replay point

  • Example of Logical Logs Required for a RestoreArchive CheckpointLog 10Log 11Log 12Log 13BBOldest Begin WorkBBCold restore allLogs 10-12Optional 13Warm restore Logs 11->No Optional LogsLogs Required

  • Restartable vs. Suspended RestoredRestartable RestoreWhen the database engine prematurely shuts down the engine may be restarted in recovery modeSuspended RestoreWhen the archive client receives an error which is restartable and the database engine does not shutdown

  • Restartable RestoreTurned OFF by defaultWhat can restart when? Whole systemPartial RestoreLogical Recovery from a cold restoreOnly available with On-BARonbar -RESTART

  • ArchitectureOverviewArchive ClientsMoving DataIDSXPSServer ThreadsXPS Architecture

  • What Pages are Sent to the ArchiveIf pages timestamp is older than maxstamp and newer than minstamp, it is put to tapeIf a page is greater than current stamp, but older than minstamp, it is put to tape, and its timestamp is updated to maxstamp-1Pages newer than max, but older than current are considered to be modified after the archive started, and are ignored.

  • Understanding Timestamps0Not ArchivedMax-StampCurrent Stamp

  • OnLine Wheel-O-Death0Not ArchivedMax-StampMin-StampCurrent StampThe timestamp at the start of the archiveThe timestamp at the current point in timeThe timestamp 50% away from Max-Stampie Max-Stamp - 2GBAll Pages in the red region have their timestamp updated along with being archived

  • Archive ClientsEBROntapeXBSAOnbarCommonArchiveCodeSMVXBSA

  • DSA Client Server ModelSQLI/ASFNetwork ConnectionStreamsLocal ConnectionArchive ClientArchiveBE

  • Moving Data between Client and ServerArchive ClientONINITShared MemorySQLI RequestsArchive Data BufferSQLI Returns SharedMemory Address

  • Moving Data between Client/ServerThe size of the buffers used to transmit dataontape - control by onconfigs TAPEBLOCKonBar - BAR_XFER_BUFSIZE - maximum size is one online page smaller than 64kbThe number of buffers:ontape onbar - BAR_XPORT_COUNT min 3 max 99Monitoring the data transferonstat -g stq

  • What Data is Shipped to the Archive ClientServer sends raw online pages just like they exist on disk

  • Example of onstat -g stqStream Queue: (session 11 cnt 10) 0:ad91400 1:ada1400 2:adb1400 3:adc1400 4:add1400 5:ade1400 6:adf1400 7:ae01400 8:ae11400 9:ae21400 Full Queue: (cnt 0 waiters 0) 0:0 1:ada1400 2:adb1400 3:adc1400 4:add1400 5:ade1400 6:adf1400 7:ae01400 8:ae11400 Empty Queue: (cnt 0 waiters 1) Stream Queue: (session 10 cnt 10) 0:ac8d400 1:ac9d400 2:acad400 3:acbd400 4:accd400 5:acdd400 6:aced400 7:acfd400 8:ad0d400 9:ad1d400 Full Queue: (cnt 9 waiters 0) 0:ac9d400 1:acad400 2:0 3:accd400 4:acdd400 5:aced400 6:acfd400 7:ad0d400 8:ad1d400 Empty Queue: (cnt 0 waiters 1)

  • Server ThreadsontapeScannerBefore Image Processor

  • Ontape ThreadAlways called ontape regardless of archive clientResponsible for all communication to archive client

  • Scanner Thread (arc_backup1)The dummy thread, geared for I/O performance and not thinkingHanded a list of pages to backupScans data from disk into shared memory buffersMakes NO decisions about the dataEnsures the page address is correct

  • Before Image Processor Thread (arc_backup2)Monitors the before image queuesDetermines if the before image needs to be saved or discardedDrains the before image memory queue, by storing the page images into temp tablesCreates multiple temp tables if required

  • XPS Difference & Architecture OverviewBasic XPS ArchitectureClient Sub-SystemsServer Sub-SystemsDifferencessysutilsconfiguration

  • Basic XPS ArchitectureonbarStorageManager 1StorageManager 2OnLine XPSCoserver 3Coserver 2Coserver 4Coserver 1

  • Client Sub-Systems

    Executable

    Function

    onbar

    Shell script wrapper

    onbar_d

    The driver

    start_worker

    Shell script wrapper

    onbar_w

    Worker process

    onbar_m

    Distributes bootfiles

    onbar_s

    Checks server state

  • Client Sub-SystemsonbarStorageManager 1OnLine XPSCoserver 3Coserver 2Coserver 4Coserver 1onbar_donbar_w

  • Server Sub-SystemsASF/local streamsSend/Receive commands and data buffersBackup Scheduler (BUS)distributes tasks to workersXBARcommunicates between coserversRSAMonly sees a single coservermanages all I/O to disk (dbspaces/c