COMP283-Lecture 7 Applied Database Managementphil/Teaching/COMP283/lecture... · 2018. 4. 17. ·...
Transcript of COMP283-Lecture 7 Applied Database Managementphil/Teaching/COMP283/lecture... · 2018. 4. 17. ·...
COMP283-Lecture7
AppliedDatabaseManagement
Introduction
HighAvailability ServerMaintenance
Redundancy
MitigationPlan
�1
COMP283-Lecture7DBAdministration:BackupsandRestore● Backup,Backup,Backup!● DatabasebackupandSystembackup
● Setabackupschedule.● Onaregularbasis.
● Verifybackupsareworking.● How?
● Storebackupssecurely
�2
COMP283-Lecture7DBAdministration:BackupScheme● Backupsshouldneverbetothesamediskasthedataorsystemfiledisks.●Whynot?
�3
COMP283-Lecture7DBAdministration:BackupScheme● Identifyabackup● Determinewhenabackupcanbereplaced/overwritten● Typesofbackups:● FullBackup● DifferentialBackup● Recordsallthechangessincethepreviousfullbackup
● IncrementalBackup● Recordsthechangessincethepreviousincrementalbackup
● Identify/labelallbackupsonthebackupmedium�4
COMP283-Lecture7DBAdministration:BackupStrategies● On-lineBackup● Immediatelyavailableforrecovery
● Near-lineBackup● Filesnotimmediatelyavailable,butcanbemadeavailableeasily.
● Off-lineBackup● Toaremoteserverorremovablemedia.
�5
COMP283-Lecture7DBAdministration:BackupStrategies
�6
COMP283-Lecture7DBAdministration:BackupStrategies
�7
COMP283-Lecture7DBAdministration:BackupStrategies● MostDBMShaveutilitiestocreatebackups● e.g.mysqldump
● Manyoftheseare“commandline”programs-canbeplacedintoascript
● CanuseOStoschedulebackups● e.g.unix/linuxcronsystem
●
�8
15 2 * * * root mysqldump -u root -pPASSWORD --all-databases |
gzip > /mnt/disk2/database_`date ' %m-%d-%Y'`.sql.gz
COMP283-Lecture7DBAdministration:BackupStrategies●Whentobackup?● CheckpatternofuseofDB/System● Lookfortimesoflittle/lowuse● Overnight?Weekends?● Perhapsdoadifferentialorincrementalbackuptoreducedowntime.Dofewerfullbackups.
�9
COMP283-Lecture7ServerMaintenance:MitigationPlans● twomaintypesofmitigationplans:● DisasterRecoveryandBusinessContinuity
● Bothrequire:● Uptodatecontactlist● Decisiontreeforvariousscenarios● Infoonrecoveringadminusernamesandpasswords● Detailsonbackups● Systemconfigurationinfo● Definitionofasuccessfulrecovery
�10
COMP283-Lecture7ServerMaintenance:MitigationPlans● DisasterRecoveryPlan:Howwillyoudealwithatotallossofdata,equipmentorinfrastructure?
● Essentialthatyouhave:● Assetinventory● Adequateinsurance● Backups● Systemconfigurationdetails● Detailsofessentialinfrastructureandequipment.
�11
COMP283-Lecture7ServerMaintenance:MitigationPlans● BusinessContinuityPlan:Howwillyoucopewithlossofemployeesorbusinesspartners,businessrestructuringorreorganisation,businesstakeovers,andsystemsmaintenance.
●Whathappenswhenthekeypersonnelleave?● SystemMaintenancePlan:● Usergroup-consultformaintenanceschedule● UsersmustcheckDBaftere.g.updatestoOS/DBMS
�12
COMP283-Lecture7ServerMaintenance:ServerPerformance● SomeDBMSsystemsincludefacilitiestomonitortheirownperformance.
● Alternatively,OStoolswillallowyoutomonitorthehealth/utilisationofe.g.thediskandreportwhenitisgettingfull.● e.g.onUnix/Linuxsystemdureportsdiskusage,topdisplaysprocessstats
● maybeusedaspartofascript● Monitoredovertime,youcangetafeelforwhetherthesystemistunedcorrectly.
�13
COMP283-Lecture7ServerMaintenance:ServerPerformance●WindowsManagementInstrumentation(WMI)isaWindowssystemsmanagementsuiteoftools.
● MS-SQLServersupportsalertsbasedonWMIevents.● LinuxandUnixbasedDBMS-typicallyyouhaveto“rollyourown”● Oracle(theDBMScompany)sellacompleteLinuxsystemwhichincludestheirDBandtoolstoadministerit.
● Howeverit’sdoneyougenerallycan’tjustsetupyourdatabase(andserver)andforgetit.
�14
COMP283-Lecture7Conclusions● Introducedservermaintenance:● Failureplanningandmitigation(includingBackups!)● Maintenanceplanning
�15