Presentation is loading. Please wait.

Presentation is loading. Please wait.

Summit Nashville /14/2018 9:26 PM

Similar presentations


Presentation on theme: "Summit Nashville /14/2018 9:26 PM"— Presentation transcript:

1 Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

2 ITP18: SQL Backups and Maintenance
Summit Nashville 2017 9/14/2018 9:26 PM ITP18: SQL Backups and Maintenance Tudor Coleman Manager of Cloud Services Njevity, Inc. © 2017 Dynamic Communities. All rights reserved.

3 Manager of Cloud Service
Tudor Coleman Manager of Cloud Service Njevity, Inc. About Tudor 35+ years in Information Technologies 15+ years working with Dynamics GP and CRM Architected NjevityToGo Private Cloud environment PowerGP Development Team Member Njevity is my dream job! About Njevity We Deliver Exceptional Cloud Experiences for Dynamics GP, Power BI and Office365 on Azure and Private Cloud 1 Tier Microsoft Cloud Service Provider (CSP) Gold ERP, Silver Cloud Platform, Silver Small and Midmarket Cloud Solutions Competencies Compliance, Mobility, Analytics, Productivity

4 Why do we backup our Data?
Summit Nashville 2017 9/14/2018 9:26 PM Why do we backup our Data? © 2017 Dynamic Communities. All rights reserved.

5 Why do we backup our Data?
Summit Nashville 2017 9/14/2018 9:26 PM Why do we backup our Data? Disasters happen! Natural disasters Man made disasters Server/Hardware crashes Data corruption Human error © 2017 Dynamic Communities. All rights reserved.

6 What is most common? Human error Data corruption Server crashes
Summit Nashville 2017 9/14/2018 9:26 PM What is most common? Human error Data corruption Server crashes Man made disasters Natural disasters © 2017 Dynamic Communities. All rights reserved.

7 What is your methodology?
Summit Nashville 2017 9/14/2018 9:26 PM What is your methodology? Are you backing up your SQL data? © 2017 Dynamic Communities. All rights reserved.

8 What is your methodology?
Summit Nashville 2017 9/14/2018 9:26 PM What is your methodology? Are you backing up your SQL data? What tools are you using? © 2017 Dynamic Communities. All rights reserved.

9 What is your methodology?
Summit Nashville 2017 9/14/2018 9:26 PM What is your methodology? Are you backing up your SQL data? What tools are you using? Do you know what recovery model your databases are set to? © 2017 Dynamic Communities. All rights reserved.

10 What is your methodology?
Summit Nashville 2017 9/14/2018 9:26 PM What is your methodology? Are you backing up your SQL data? What tools are you using? Do you know what recovery model your databases are set to? How often do you backup your SQL data? Full backup? Transaction Log or differential Backups? © 2017 Dynamic Communities. All rights reserved.

11 What is your methodology?
Summit Nashville 2017 9/14/2018 9:26 PM What is your methodology? Are you backing up your SQL data? What tools are you using? Do you know what recovery model your databases are set to? How often do you backup your SQL data? Full backup? Transaction Log or differential Backups? Do you offsite your backups? © 2017 Dynamic Communities. All rights reserved.

12 What is your methodology?
Summit Nashville 2017 9/14/2018 9:26 PM What is your methodology? Are you backing up your SQL data? What tools are you using? Do you know what recovery model your databases are set to? How often do you backup your SQL data? Full backup? Transaction Log or differential Backups? Do you offsite your backups? Do you test your backups? © 2017 Dynamic Communities. All rights reserved.

13 Summit Nashville 2017 9/14/2018 9:26 PM In a recovery scenario the question is not when was your last backup but, when was your last good backup? © 2017 Dynamic Communities. All rights reserved.

14 How long can you be down? Recovery Time Objective (RTO)
Summit Nashville 2017 9/14/2018 9:26 PM How long can you be down? Recovery Time Objective (RTO) Recovery Point Objective (RPO) © 2017 Dynamic Communities. All rights reserved.

15 Recommended Methodology*
Summit Nashville 2017 9/14/2018 9:26 PM Recommended Methodology* Use SQL Maintenance plans / SQL Agent jobs to backup databases Backup the BAK files Offsite the backup of the BAK files Test restoring all the way from the offsite backups *By Tudor © 2017 Dynamic Communities. All rights reserved.

16 Simple Full Recovery Models vs. Summit Nashville 2017
9/14/2018 9:26 PM Recovery Models Simple vs. Full © 2017 Dynamic Communities. All rights reserved.

17 Supports log shipping but that is more advanced?
Summit Nashville 2017 9/14/2018 9:26 PM Supports log shipping but that is more advanced? © 2017 Dynamic Communities. All rights reserved.

18 Simple Recovery This supports full backups, then differential backups.
Summit Nashville 2017 9/14/2018 9:26 PM Simple Recovery This supports full backups, then differential backups. Full backup contains all the data in the database files and enough of the log to allow recovery. Differential Backs up changes to the database since the last full backup Recovery point is to the state of the database at the completion of the last full backup or applied differential backup. Restore process Restore last full backup Restore differential backup © 2017 Dynamic Communities. All rights reserved.

19 Summit Nashville 2017 9/14/2018 9:26 PM Full Recovery Supports Full backups, then Differential and/or Transaction Log backups Differential Transaction Log Backup Backs up all transactions since the last transaction log backup Recovery is to point in time. Restore process Restore last full backup Apply Transaction log backups to the point in time © 2017 Dynamic Communities. All rights reserved.

20 Full Recovery Hybrid Full backup Differential backup
Summit Nashville 2017 9/14/2018 9:26 PM Full Recovery Hybrid Full backup Differential backup Transaction Log Backups Recovery is to point in time Restore process Restore last full backup Restore differential backup Apply Transaction log backups © 2017 Dynamic Communities. All rights reserved.

21 Let’s go play in SSMS Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

22 Why would you pick one over the other?
Summit Nashville 2017 9/14/2018 9:26 PM Why would you pick one over the other? © 2017 Dynamic Communities. All rights reserved.

23 Demo – Full Backup Steps
Summit Nashville 2017 9/14/2018 9:26 PM Demo – Full Backup Steps © 2017 Dynamic Communities. All rights reserved.

24 Demo – Full Backup Steps
Summit Nashville 2017 9/14/2018 9:26 PM Demo – Full Backup Steps © 2017 Dynamic Communities. All rights reserved.

25 Demo – Full Backup Steps
Summit Nashville 2017 9/14/2018 9:26 PM Demo – Full Backup Steps © 2017 Dynamic Communities. All rights reserved.

26 Demo – Full Backup Steps
Summit Nashville 2017 9/14/2018 9:26 PM Demo – Full Backup Steps © 2017 Dynamic Communities. All rights reserved.

27 Demo – Full Backup Steps
Summit Nashville 2017 9/14/2018 9:26 PM Demo – Full Backup Steps © 2017 Dynamic Communities. All rights reserved.

28 Demo – Full Backup Steps
Summit Nashville 2017 9/14/2018 9:26 PM Demo – Full Backup Steps © 2017 Dynamic Communities. All rights reserved.

29 Demo – Full Backup Steps
Summit Nashville 2017 9/14/2018 9:26 PM Demo – Full Backup Steps © 2017 Dynamic Communities. All rights reserved.

30 Full Backup Query --Full Backup with checksum and validate
Summit Nashville 2017 9/14/2018 9:26 PM Full Backup Query --Full Backup with checksum and validate BACKUP DATABASE [JOR70] TO DISK = N'B:\BACKUP\SQL-SUMMIT\JOR70\FULL\JOR70FullDemo.bak' WITH NOFORMAT, NOINIT, NAME = N'JOR70-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10, CHECKSUM GO as int = position from msdb..backupset where database_name=N'JOR70' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'JOR70' ) is null begin raiserror(N'Verify failed. Backup information for database ''JOR70'' not found.', 16, 1) end RESTORE VERIFYONLY FROM DISK = N'B:\BACKUP\SQL-SUMMIT\JOR70\FULL\JOR70FullDemo.bak' WITH FILE NOUNLOAD, NOREWIND © 2017 Dynamic Communities. All rights reserved.

31 Make some changes Open Customer Baker's Emporium Inc.
Contact: John Watson We will make some changes in GP Contact: Sherlock Holmes Note the time:Make another change to the same field Contact: Arthur Conan Doyle

32 Transaction Log Backup Query
Summit Nashville 2017 9/14/2018 9:26 PM Transaction Log Backup Query --Transaction Log Backup BACKUP LOG [JOR70] TO DISK = N'B:\BACKUP\SQL-SUMMIT\JOR70\LOG\JOR70LogDemo01.bak' WITH NOFORMAT, NOINIT, NAME = N'JOR70-Log Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10 GO © 2017 Dynamic Communities. All rights reserved.

33 Restore Notes If possible, always do restores to a test company first Creating a test company: Restore Full Backup. Point at Test Database Overwrite

34 Demo – Full Restore Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

35 Demo – Full Restore Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

36 Demo – Full Restore Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

37 Demo – Full Restore Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

38 Restore From Full Backup Query
Summit Nashville 2017 9/14/2018 9:26 PM Restore From Full Backup Query RESTORE DATABASE [JRST] FROM DISK = N'B:\BACKUP\SQL-SUMMIT\JOR70\FULL\JOR70FullDemo.bak' WITH FILE = 1, MOVE N'GPSJOR70Dat.mdf' TO N'D:\SQL_Data\MSSQLSERVER\GPSJRSTDat.mdf', MOVE N'GPSJOR70Log.ldf' TO N'L:\SQL_Logs\MSSQLSERVER\GPSJRSTLog.ldf', NOUNLOAD, REPLACE, STATS = 5 GO © 2017 Dynamic Communities. All rights reserved.

39 Did the restore work as expected
Baker's Emporium Inc. Contact: John Watson

40 Demo – TLog Restore (Point-in-time)
Summit Nashville 2017 9/14/2018 9:26 PM Demo – TLog Restore (Point-in-time) © 2017 Dynamic Communities. All rights reserved.

41 Restore to Point-in-time
Summit Nashville 2017 9/14/2018 9:26 PM Restore to Point-in-time USE [master] RESTORE DATABASE [JRST] FROM DISK = N'B:\BACKUP\SQL-SUMMIT\JOR70\FULL\JOR70FullDemo.bak' WITH FILE = 1, MOVE N'GPSJOR70Dat.mdf' TO N'D:\SQL_Data\MSSQLSERVER\GPSJRSTDat.mdf', MOVE N'GPSJOR70Log.ldf' TO N'L:\SQL_Logs\MSSQLSERVER\GPSJRSTLog.ldf', NORECOVERY, NOUNLOAD, REPLACE, STATS = 5 RESTORE LOG [JRST] FROM DISK = N'B:\BACKUP\SQL-SUMMIT\JOR70\LOG\JOR70LogDemo01.bak' WITH FILE = 1, NOUNLOAD, STATS = 5, STOPAT = N' T11:34:04' GO © 2017 Dynamic Communities. All rights reserved.

42 Did the restore work as expected
Baker's Emporium Inc. Contact: Sherlock Holmes

43 Restore to End of Transactin Log
Summit Nashville 2017 9/14/2018 9:26 PM Restore to End of Transactin Log USE [master] RESTORE DATABASE [JRST] FROM DISK = N'B:\BACKUP\SQL-SUMMIT\JOR70\FULL\JOR70FullDemo.bak' WITH FILE = 1, MOVE N'GPSJOR70Dat.mdf' TO N'D:\SQL_Data\MSSQLSERVER\GPSJRSTDat.mdf', MOVE N'GPSJOR70Log.ldf' TO N'L:\SQL_Logs\MSSQLSERVER\GPSJRSTLog.ldf', NORECOVERY, NOUNLOAD, REPLACE, STATS = 5 RESTORE LOG [JRST] FROM DISK = N'B:\BACKUP\SQL-SUMMIT\JOR70\LOG\JOR70LogDemo01.bak' WITH FILE = 1, NOUNLOAD, STATS = 5 GO © 2017 Dynamic Communities. All rights reserved.

44 Did the restore work as expected
Baker's Emporium Inc. Contact: Arthur Conan Doyle

45 Off Site Those Backups Copy to Azure Storage account
Summit Nashville 2017 9/14/2018 9:26 PM Off Site Those Backups Copy to Azure Storage account Use Microsoft’s Data Protection Manager Backup to off site DPM server Use DPM to backup to Azure Use 3rd Party (Perennial favorites, PC magazine) IDrive SugarSync Carbonite SpiderOakONE Acronis True Image © 2017 Dynamic Communities. All rights reserved.

46 SQL Backup to Azure You can find full instructions:
Summit Nashville 2017 9/14/2018 9:26 PM SQL Backup to Azure You can find full instructions: Steve Endow, MVP blog post: Create Azure Storage Account From SSMS, Create Credentials Backup and restore from SSMS © 2017 Dynamic Communities. All rights reserved.

47 Create Credentials CREATE CREDENTIAL mycredential
Summit Nashville 2017 9/14/2018 9:26 PM Create Credentials CREATE CREDENTIAL mycredential WITH IDENTITY= 'mystorageaccount' -- this is the name of the storage account you specified when creating a storage account (See Lesson 1) , SECRET = '<storage account access key>' -- this should be either the Primary or Secondary Access Key for the storage account (See Lesson 1) © 2017 Dynamic Communities. All rights reserved.

48 Demo – Backup to Azure Note that this will break
Summit Nashville 2017 9/14/2018 9:26 PM Demo – Backup to Azure Note that this will break the current backup chain. © 2017 Dynamic Communities. All rights reserved.

49 Summit Nashville 2017 9/14/2018 9:26 PM Run your backup BACKUP DATABASE [JOR70] TO URL = N' WITH CREDENTIAL = N'MyAzureCredential' , NOFORMAT, NOINIT, NAME = N'JOR70-Full Database Backup', NOSKIP, NOREWIND, NOUNLOAD, STATS = 10 GO © 2017 Dynamic Communities. All rights reserved.

50 And, a restore USE [master]
Summit Nashville 2017 9/14/2018 9:26 PM And, a restore USE [master] RESTORE DATABASE [JRST] FROM URL = ' WITH CREDENTIAL = 'MyAzureCredential', FILE = 1, MOVE N'GPSJOR70Dat.mdf' TO N'D:\SQL_Data\MSSQLSERVER\GPSJRSTDat.mdf', MOVE N'GPSJOR70Log.ldf' TO N'L:\SQL_Logs\MSSQLSERVER\GPSJRSTLog.ldf', NOUNLOAD, REPLACE, STATS = 5 © 2017 Dynamic Communities. All rights reserved.

51 Don’t forget, clean up after yourself
Summit Nashville 2017 9/14/2018 9:26 PM Don’t forget, clean up after yourself Clean up history Clean up backup files © 2017 Dynamic Communities. All rights reserved.

52 Demo – Clean up Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

53 Demo – Clean up Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

54 Demo – Clean up Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

55 Demo – Clean up Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

56 Demo – Clean up Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

57 Demo – Clean up Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

58 Demo – Clean up Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

59 Other SQL Maintanence Rebuild indexes / reorganize indexes
Summit Nashville 2017 9/14/2018 9:26 PM Other SQL Maintanence Rebuild indexes / reorganize indexes Rebuild Completely rebuilds the indexes In Standard Edition this is an offline and single threaded so, you need downtime In Enterprise Edition you can specify Online with some caveats Integrity check © 2017 Dynamic Communities. All rights reserved.

60 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

61 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

62 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

63 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

64 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

65 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

66 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

67 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

68 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

69 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

70 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

71 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

72 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

73 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

74 SQL Maintenance Tasks Summit Nashville 2017 9/14/2018 9:26 PM
© 2017 Dynamic Communities. All rights reserved.

75 What else do you need to backup?
Summit Nashville 2017 9/14/2018 9:26 PM What else do you need to backup? GP Install media Current version Any applied hot fixes Backups of Custom Forms and Reports Copies of the .DIC files Or Exported .package files ISV install media? Are you using SSRS? Management Reporter? © 2017 Dynamic Communities. All rights reserved.

76 Ola Hallengren https://ola.hallengren.com
Summit Nashville 2017 9/14/2018 9:26 PM Ola Hallengren © 2017 Dynamic Communities. All rights reserved.

77 What is your SQL Backup Method
Summit Nashville 2017 9/14/2018 9:26 PM What is your SQL Backup Method Are you backing up your SQL data? What tools are you using? Do you know what recovery model your databases are set to? How often do you backup your SQL data? Full backup? Transaction Log or differential Backups? Do you offsite your backups? Do you test your restores? © 2017 Dynamic Communities. All rights reserved.


Download ppt "Summit Nashville /14/2018 9:26 PM"

Similar presentations


Ads by Google