58
Microsoft SQL Server Microsoft SQL Server Administration for SAP Administration for SAP Database Backup and Database Backup and Restore Restore

Microsoft SQL Server Administration for SAP Database Backup and Restore

  • View
    235

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Microsoft SQL Server Administration for SAP Database Backup and Restore

Microsoft SQL Server Microsoft SQL Server Administration for SAPAdministration for SAP

Database Backup and RestoreDatabase Backup and Restore

Page 2: Microsoft SQL Server Administration for SAP Database Backup and Restore

2

OverviewOverview

SQL Server ArchitectureSQL Server Architecture SQL Server with SAPSQL Server with SAP Performance Monitoring and TuningPerformance Monitoring and Tuning Administration and TroubleshootingAdministration and Troubleshooting Database Backup and RestoreDatabase Backup and Restore

Page 3: Microsoft SQL Server Administration for SAP Database Backup and Restore

3

Importance of BackupImportance of Backup

User ErrorsUser Errors

Physical ErrorsPhysical Errors

External FactorsExternal Factors

Logical ErrorsLogical Errors

Page 4: Microsoft SQL Server Administration for SAP Database Backup and Restore

4

Recovery ModelsRecovery Models

Full Full No work lossNo work loss Supports recovery to any point-in-timeSupports recovery to any point-in-time

SimpleSimple Simplest backup/restore strategySimplest backup/restore strategy Less log space requiredLess log space required Greatest work loss possibleGreatest work loss possible

Bulk_LoggedBulk_Logged High performance bulk operationsHigh performance bulk operations Minimal log space for bulk operationsMinimal log space for bulk operations Some work loss exposureSome work loss exposure

Page 5: Microsoft SQL Server Administration for SAP Database Backup and Restore

5

BackupBackup

FullFull DifferentialDifferential LogLog FileFile File GroupFile Group NT BackupNT Backup

Page 6: Microsoft SQL Server Administration for SAP Database Backup and Restore

6

Full BackupFull Backup

Copy all used data pages to the backup media

Data

Andre Vasser Hil Frenzen

X0 X1 X2 X3 X4 X5 X6 X7

Kojak MagnumDerrick Marple

X8 X9 X10 X11 X12 X13 X14 X15

Landis Wolf Wang Kerber Kania Thomas Merdes

X16 X17 X18 X19 X20 X21 X22 X23

Mozart Bach Strauss Wagner Beeth.

X24 X25 X26 X27 X28 X29 X30 X31

1111

Copy all used log pages to the backup media

Set the timestamp of the backup to the time when the backup has finished

Transaction Log

begin update begin insert commit chkp insert rollback

LSN0 LSN1 LSN2 LSN3 LSN4 LSN5 LSN6 LSN7

delete

LSN8 LSN9 LSN10 LSN11 LSN12 LSN13 LSN14 LSN15

LSN16 LSN17 LSN18 LSN19 LSN20 LSN21 LSN22 LSN23

LSN24 LSN25 LSN26 LSN27 LSN28 LSN29 LSN30 LSN31

2222

3333

Page 7: Microsoft SQL Server Administration for SAP Database Backup and Restore

7

Log BackupLog Backup

Copy all used log pages to the backup media

begin1 update begin2 insert commit2 chkp insert begin3

LSN0 LSN1 LSN2 LSN3 LSN4 LSN5 LSN6 LSN7

delete dump commit1 chkp insert insert delete delete

LSN8 LSN9 LSN10 LSN11 LSN12 LSN13 LSN14 LSN15

insert

LSN16 LSN17 LSN18 LSN19 LSN20 LSN21 LSN22 LSN23

LSN24 LSN25 LSN26 LSN27 LSN28 LSN29 LSN30 LSN31

1111

Transaction Log

Truncate the inactive portion of the transaction log

begin1 update begin2 insert commit2 chkp insert begin3

LSN0 LSN1 LSN2 LSN3 LSN4 LSN5 LSN6 LSN7

delete dump commit1 chkp insert insert delete delete

LSN8 LSN9 LSN10 LSN11 LSN12 LSN13 LSN14 LSN15

insert

LSN16 LSN17 LSN18 LSN19 LSN20 LSN21 LSN22 LSN23

LSN24 LSN25 LSN26 LSN27 LSN28 LSN29 LSN30 LSN31

2222

Transaction Log

Page 8: Microsoft SQL Server Administration for SAP Database Backup and Restore

8

Differential BackupDifferential Backup

Andre Vasser Schumi Frenzen

X0 X1 X2 X3 X4 X5 X6 X7

Kojak Rex Derrick Marple

X8 X9 X10 X11 X12 X13 X14 X15

Dilg Wolf Wang Kerber Kania Thomas

X16 X17 X18 X19 X20 X21 X22 X23

Mozart Bach Strauss

X24 X25 X26 X27 X28 X29 X30 X31

Data

Copy all modified records since the last full database backup to the backup media1111

Copy all used log pages to the backup media

Set the timestamp of the backup to the time when the backup has finished

Transaction Log

begin update begin insert commit chkp insert rollback

LSN0 LSN1 LSN2 LSN3 LSN4 LSN5 LSN6 LSN7

delete

LSN8 LSN9 LSN10 LSN11 LSN12 LSN13 LSN14 LSN15

LSN16 LSN17 LSN18 LSN19 LSN20 LSN21 LSN22 LSN23

LSN24 LSN25 LSN26 LSN27 LSN28 LSN29 LSN30 LSN31

2222

3333

Page 9: Microsoft SQL Server Administration for SAP Database Backup and Restore

9

File BackupFile Backup

...

<SID>DATA1

<SID>DATA2

<SID>DATA3

<SID>DATAnCopy one or more database files to the backup media

1111

Page 10: Microsoft SQL Server Administration for SAP Database Backup and Restore

10

Filegroup BackupFilegroup Backup

PRIMARY...

<SID>DATA1

<SID>DATA2

<SID>DATA3

<SID>DATAnCopy one filegroup to the backup media

1111

Page 11: Microsoft SQL Server Administration for SAP Database Backup and Restore

11

NT BackupNT Backup Directory Files Directory Files

X:\<SID>DATA1 Primary data fileX:\<SID>DATA2 Secondary data fileX:\<SID>DATA3 Secondary data file

Y:\<SID>LOG1 Transaction log file

Z:\Tempdb data and log files of the tempdb

C:\Mssql7\Backup Default Backup directoryBinn MS SQL Server executablesBooks Online documentationData System and sample database filesHtml Enterprise Manager Html Files Install Installation scripts and logsJob Temporary job output filesLog Errorlogs and JoblogsRepldata Working directory for replication tasksUpgrade Files used for upgrade (6.5 to 7.0)

D:\usr\sap\<SID> R/3 executablestrans Transport directory

E:\WINNT NT System directory

Copy all R/3 and SQL Server files to the backup media1111

Create a document containingthe file structure2222

File System Structure

Page 12: Microsoft SQL Server Administration for SAP Database Backup and Restore

12

How to Perform a BackupHow to Perform a Backup

MonthlyMonthlyBackupBackupCycleCycle

Query Analyzer

??. . . .

Mon Tue Wed Thu Fri Sat

Tue Wed Thu Fri Sat Sun

Mon Tue Wed Thu Fri Sat Sun

Mon

SunTue

Mon Tue Wed Thu Fri Sat Sun

regularTue

SQLEnterprise Manager

unplanned

CCMS DBA Calendar (DB13)

Page 13: Microsoft SQL Server Administration for SAP Database Backup and Restore

13

Backup Requirements and CostsBackup Requirements and CostsDuration of a backup

Time window for a recovery

High availability

Training

Administrative workload

Acquisition costs

Page 14: Microsoft SQL Server Administration for SAP Database Backup and Restore

14

Backup strategiesBackup strategies

Single DB and Transaction Log Single DB and Transaction Log BackupsBackups

Parallel Tape SupportParallel Tape Support Two-Step Disk BackupTwo-Step Disk Backup Supplementary Differential BackupsSupplementary Differential Backups Hot-Standby ServerHot-Standby Server

Page 15: Microsoft SQL Server Administration for SAP Database Backup and Restore

15

Restore ProcedureRestore Procedure

Availability

ONLINETargetActual

OFFLINE

Replace hardwareand set up system

Problemanalysis

Applytransaction

logs

Automaticrecovery

Time

Restoredatabase

Page 16: Microsoft SQL Server Administration for SAP Database Backup and Restore

16

Data Volume CrashData Volume Crash

Back up recent transaction logBack up recent transaction log

Replace RAID systemReplace RAID system

Restore R/3 databaseRestore R/3 database

Restore transaction logsRestore transaction logs

Check restore operationCheck restore operation

<SID>

<SID>

<SID>

Procedure andescalation plan

PRIMARY

<SID>DATA3

<SID>DATA2

<SID>DATA1

Page 17: Microsoft SQL Server Administration for SAP Database Backup and Restore

17

Log Volume CrashLog Volume Crash

Replace RAID systemReplace RAID system

Restore R/3 databaseRestore R/3 database

Restore transaction logsRestore transaction logs

Check restore operationCheck restore operation

<SID>

<SID>

Procedure andescalation plan

<SID>LOG1 <SID>LOG1

Page 18: Microsoft SQL Server Administration for SAP Database Backup and Restore

18

Executable Volume CrashExecutable Volume Crash

Reload lost files from latest NT Backup

Reload lost files from latest NT Backup

Reboot Primary NTReboot Primary NT

Restore msdb (and master) Database

Restore msdb (and master) Database

Check Restore OperationCheck Restore Operation

Procedure andEscalation Plan

Replace disks and installauxiliary NT

Replace disks and installauxiliary NT

msdb master

Directory Directory

C:\Tempdb

C:\Mssql7\

C:\usr\sap\

C:\WINNT

Page 19: Microsoft SQL Server Administration for SAP Database Backup and Restore

19

SummarySummaryRAID 1 crash :Log files lost

<SID> suspect

Replace crashed disk(s), synchronize RAID

SQL Restore of database and transaction logs

Automatic recovery

OK Some data lost! OK OK OK

NT Restore of EXEs;not log file(s)!

RAID 5 crash:Data files lost<SID> suspect

System crash: Data + EXEs lostSQL Server down

Exe disk crash: EXEs lost

SQL Server down

One disk crash

Shut down SQL Server

SQL Restore of msdb (and master)

Back up log <SID> with

no_truncate

Page 20: Microsoft SQL Server Administration for SAP Database Backup and Restore

20

System CrashSystem Crash

Reload executables from latest NT Backup

Reload executables from latest NT Backup

Reboot primary NTReboot primary NT

Restore msdb (and master) database

Restore msdb (and master) database

Check restore operationCheck restore operation

Procedure andescalation plan

Replace hardware and install auxiliary NT

Replace hardware and install auxiliary NT

msdb master

Directory Directory

C:\Tempdb

C:\Mssql7\

C:\usr\sap\

C:\WINNT

Restore R/3 databaseRestore R/3 database

Restore transaction logsRestore transaction logs <SID>

<SID>

Page 21: Microsoft SQL Server Administration for SAP Database Backup and Restore

21

Backup and restoreBackup and restore

Log marksLog marks RESTORE optionsRESTORE options

RECOVERY, NORECOVERY, STANDBY RECOVERY, NORECOVERY, STANDBY

Backup passwordBackup password Snapshot BackupSnapshot Backup Database Copy WizardDatabase Copy Wizard New Backup modesNew Backup modes

Page 22: Microsoft SQL Server Administration for SAP Database Backup and Restore

22

Hot standbyHot standby

Scheduled movement of T-logsScheduled movement of T-logs Pulled to secondary machine(s)Pulled to secondary machine(s) Copies all Logged OperationsCopies all Logged Operations

DML + schema, permissions, roles,...DML + schema, permissions, roles,...

Setup & managed via Maintenance Setup & managed via Maintenance ‘Plan’‘Plan’

Interactive remote monitoringInteractive remote monitoring Used for creating ‘warm backup’ DBsUsed for creating ‘warm backup’ DBs Roll reversal (swap source <-> Roll reversal (swap source <->

destination)destination)

Page 23: Microsoft SQL Server Administration for SAP Database Backup and Restore

23

DB12DB12

Page 24: Microsoft SQL Server Administration for SAP Database Backup and Restore

24

Backup HistoryBackup History

Page 25: Microsoft SQL Server Administration for SAP Database Backup and Restore

25

SQL Agent SettingsSQL Agent Settings

Page 26: Microsoft SQL Server Administration for SAP Database Backup and Restore

26

Backup DeviceBackup Device

Page 27: Microsoft SQL Server Administration for SAP Database Backup and Restore

27

JobsJobs

Page 28: Microsoft SQL Server Administration for SAP Database Backup and Restore

28

Restore informationRestore information

Page 29: Microsoft SQL Server Administration for SAP Database Backup and Restore

29

DB13 CalendarDB13 Calendar

Page 30: Microsoft SQL Server Administration for SAP Database Backup and Restore

30

DB13 Scheduling BackupDB13 Scheduling Backup

Page 31: Microsoft SQL Server Administration for SAP Database Backup and Restore

31

DB13 Scheduling BackupDB13 Scheduling Backup

Page 32: Microsoft SQL Server Administration for SAP Database Backup and Restore

32

DB13 Scheduling BackupDB13 Scheduling Backup

Page 33: Microsoft SQL Server Administration for SAP Database Backup and Restore

33

DB13 Scheduling BackupDB13 Scheduling Backup

Page 34: Microsoft SQL Server Administration for SAP Database Backup and Restore

34

DB13 CalendarDB13 Calendar

Page 35: Microsoft SQL Server Administration for SAP Database Backup and Restore

35

Failed JobFailed Job

Page 36: Microsoft SQL Server Administration for SAP Database Backup and Restore

36

Failed JobFailed Job

Page 37: Microsoft SQL Server Administration for SAP Database Backup and Restore

37

Jobs in SQL ServerJobs in SQL Server

Page 38: Microsoft SQL Server Administration for SAP Database Backup and Restore

38

Backup from SQL Enterprise Backup from SQL Enterprise ManagerManager

Page 39: Microsoft SQL Server Administration for SAP Database Backup and Restore

39

Backup from SQL Enterprise Backup from SQL Enterprise ManagerManager

Page 40: Microsoft SQL Server Administration for SAP Database Backup and Restore

40

Backup from SQL Enterprise Backup from SQL Enterprise ManagerManager

Page 41: Microsoft SQL Server Administration for SAP Database Backup and Restore

41

Backup from SQL Enterprise Backup from SQL Enterprise ManagerManager

Page 42: Microsoft SQL Server Administration for SAP Database Backup and Restore

42

Backup from SQL Enterprise Backup from SQL Enterprise ManagerManager

Page 43: Microsoft SQL Server Administration for SAP Database Backup and Restore

43

Restore from SQL Enterprise Restore from SQL Enterprise ManagerManager

Page 44: Microsoft SQL Server Administration for SAP Database Backup and Restore

44

Restore from SQL Enterprise Restore from SQL Enterprise ManagerManager

Page 45: Microsoft SQL Server Administration for SAP Database Backup and Restore

45

Failed Job in SQL ServerFailed Job in SQL Server

Page 46: Microsoft SQL Server Administration for SAP Database Backup and Restore

46

Details of the failed jobDetails of the failed job

Page 47: Microsoft SQL Server Administration for SAP Database Backup and Restore

47

Details of the failed jobDetails of the failed job

Page 48: Microsoft SQL Server Administration for SAP Database Backup and Restore

48

Job InformationJob Information

Page 49: Microsoft SQL Server Administration for SAP Database Backup and Restore

49

Job InformationJob Information

Page 50: Microsoft SQL Server Administration for SAP Database Backup and Restore

50

Job ScheduleJob Schedule

Page 51: Microsoft SQL Server Administration for SAP Database Backup and Restore

51

NotificationNotification

Page 52: Microsoft SQL Server Administration for SAP Database Backup and Restore

52

Backup DeviceBackup Device

Page 53: Microsoft SQL Server Administration for SAP Database Backup and Restore

53

Backup – media set nameBackup – media set name

Page 54: Microsoft SQL Server Administration for SAP Database Backup and Restore

54

Restore from DeviceRestore from Device

Page 55: Microsoft SQL Server Administration for SAP Database Backup and Restore

55

Point in time restorePoint in time restore

Page 56: Microsoft SQL Server Administration for SAP Database Backup and Restore

56

LabLab

Create a Backup DeviceCreate a Backup Device Backup using CCMSBackup using CCMS Backup using SQL Enterprise Backup using SQL Enterprise

ManagerManager Backup from Query AnalyzerBackup from Query Analyzer Check the media naming convention Check the media naming convention

by SAPby SAP Setup a stand by database and Setup a stand by database and

switch to the standby databaseswitch to the standby database

Page 57: Microsoft SQL Server Administration for SAP Database Backup and Restore

57

LabLab

Restore using SQL Enterprise Restore using SQL Enterprise ManagerManager

Restore from Query Analyzer(1 full Restore from Query Analyzer(1 full backup followed by 2 trans log backup followed by 2 trans log restore)restore)

Setup log shipping and switch to the Setup log shipping and switch to the backup serverbackup server

Perform point-in-time recoveryPerform point-in-time recovery

Page 58: Microsoft SQL Server Administration for SAP Database Backup and Restore

58

SummarySummary

Write module summaryWrite module summary