Download presentation
Presentation is loading. Please wait.
Published byIngeborg Feld Modified over 5 years ago
1
Microsoft SQL Server 2014 for Oracle DBAs Module 10
11: Monitoring and performance tuning Microsoft SQL Server 2014 for Oracle DBAs Module 10 Backup and Recovery
2
Backup and recovery tools and solutions
Module Overview 11: Backup and Recovery Backup and recovery tools and solutions
3
Lesson 1: Understanding database backups
11: Backup and Recovery Backup methods
4
Database errors The most common database errors include:
11: Backup and Recovery The most common database errors include: Statement failure—when a program encounters a failure in the handling of a statement Process failure—when a background process, user process, or server process encounters an abnormal disconnection or process termination Instance failure—when an instance ceases to run due to a hardware or software failure User or application error—when objects are dropped or data is deleted accidentally Media failure—when reading from or writing to a database file fails Network failure—when a network segment fails or a phone connection aborts
5
Two types: logical and physical backups
Backup methods 11: Backup and Recovery Two types: logical and physical backups Logical backups facilitate recovery at the individual schema object level In SQL Server, you can use SSIS, bcp, and other data transport tools Physical backups are copies of physical database files. These include: Online (or inconsistent) backups Offline (or consistent) backups Incremental backups Archive log backups
6
Recovering from database errors
Lesson 2: Data recovery 11: Backup and Recovery Recovering from database errors
7
Available recovery models include: Full Bulk logged Simple
11: Backup and Recovery Available recovery models include: Full Bulk logged Simple Recovery models determine the amount of logging at the database or command level Recovery models provide much needed control over logging and speed up bulk operations while providing recoverability to transaction-heavy systems Full recovery model—is used when the data is critical and must be recoverable to point of failure. All recovery options are available in this recovery model. This is equivalent to Oracle’s ARCHIVELOG mode (when NOLOGGING option not specified at any level) where all transactions are logged and logs are archived for full recoverability. Bulk-Logged recovery model—mid-level recovery model, available for bulk operations such as Bulk Copy, SELECT INTO, and text processing. This recovery model does not provide point-in- time recovery past the beginning of any bulk operation. Simple recovery model—used when all operations since the last database backup are expendable or can be redone. This recovery model has the lowest logging overhead.
8
Demonstration: Recovery model
11: Backup and Recovery In this demonstration you will learn to: Locate the recovery model option for a database Make the changes through the SSMS GUI or with scripts Demonstration Steps Within SSMS’s Object Explorer, select Databases. From the View menu, select Object Explorer Details. Note the Recovery Model and Compatibility Level columns in the detail view. (Scroll to the right if necessary.) From the Object Explorer Details, right-click on AdventureWorks2012, then select Properties. Select the Options page in the left pane. Change the Recovery Model near the top of the window to “Full”. Click the Script button at the top of the Properties dialog. Click the Cancel button. Review the T-SQL used to change the recovery model, and then execute the script.
9
Factors affecting backup strategy decisions
11: Backup and Recovery Transaction rate and rate of data change Availability requirements of databases Value and degree of mission critical nature of data Nature of data access File system storage space available for backups Backup media space available Cost of other hardware and software resources Performance load requirements
10
Recovering from database errors
11: Backup and Recovery Statement failure—Oracle and SQL Server automatically recover and return control Process failure—PMON in Oracle and SQLOS in SQL Server automatically roll back the current transaction and release held resources Instance failure—Oracle and SQL Server recover on instance startup User or application error—Oracle and SQL Server offer point in time recovery options Media failure—Oracle and SQL Server offer file-level recovery Network failure PMON in Oracle and SQLOS in SQL Server recover aborted transactions RECO in Oracle and MSDTC in SQL Server recover from failures during two-phase commit of distributed transactions
11
Lesson 3: Backup and recovery tools and solutions
Demonstration: Differential and log backups, and restore Demonstration: Backup to Windows Azure storage Third-party backup and recovery solutions
12
Backup and recovery tools
Oracle Recovery Manager (RMAN)—part of Oracle, used to back up and recover database files. SQL Server backup and restore components—in conjunction with SQL Server Agent, you can set up, schedule, automate backups and perform recovery. BACKUP and RESTORE commands can be used in applications, T- SQL scripts, stored procedures, and triggers. Backup history is maintained in the RMAN recovery catalog. The equivalent system catalog tables are in the msdb database in SQL Server. Consider Encryption/Compression – Both tools provide it in some approach.
13
Demonstration: Maintenance Plan backup
11: Backup and Recovery In this demonstration you will learn to: Create a Maintenance Plan using SSMS Schedule the plan for future execution Use SQL Server Agent – Job Activity Monitor to monitor the execution status Demonstration Steps Open SQL Server Configuration Manager, from Start – All Programs – Microsoft SQL Server 2014 – Configuration Tools. Start the SQL Server Agent (INST01) service, if it is not started already.From SSMS, expand the Management folder within the Object Explorer for INST01. Right-click on Maintenance Plans and select the New Maintenance Plan option. Enter “AW2012MaintPlan” in the Name property of the New Maintenance Plan window. Click OK. Enter “AdventureWorks2012 Maintenance Plan” in the Description property. From the Toolbox, now visible below Object Explorer, drag a “Back Up Database Task” object to the designer surface. Double-click on the task object to open the editor window. Click the New Connection button, and enter “SQLTBWS\INST01” in the “Connection name” and the “Select or enter a server name” text boxes. Use Windows NT Integrated security. Click the dropdown arrow next to Database(s), select the radio button next to These Databases Check the AdventureWorks2012 database. Click the checkbox to “Verify backup integrity”. Note: It is possible to link several tasks together to implement complex, full-automated solutions for database maintenance. One important task is to notify database operators when items succeed, fail, or (More notes on the next slide)
14
Demonstration: Differential and log backups, and restore
11: Backup and Recovery In this demonstration you will learn to: Create a tail log backup Restore a database to every committed transaction Demonstration Steps Open a New Query Window and execute the following T-SQL script: USE AdventureWorks2012 GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[HumanResources].[Employee4]') AND type = N'U') DROP TABLE [HumanResources].[Employee4] CREATE TABLE [HumanResources].[Employee4] (emp_id int NOT NULL, last_name varchar(50) NULL, first_name varchar(50) NULL, job_title varchar(50) NULL, hire_date date NULL, vac_hours numeric(6,2) NULL, sick_hours numeric(6,2) NULL, active_fg bit NOT NULL DEFAULT 1 ) INSERT INTO [HumanResources].[Employee4] (emp_id, last_name, first_name, job_title, hire_date, vac_hours, sick_hours, active_fg) VALUES (More notes on the next slide)
15
Demonstration: Backup to Windows Azure storage
11: Backup and Recovery In this demonstration you will learn to: Setup and Azure storage account for backups Backup a database to a Windows Azure storage account (More notes on the next slide)
16
Demonstration: Managed backups
11: Backup and Recovery In this demonstration you will learn to: Configure a managed backup (More notes on the next slide)
17
Third-party backup and recovery solutions
System Center Data Protection Manager (DPM) provides centralized backup solution for SQL Server Third-party backup and recover tools interface RDBMS native backup and restore components with media management. Some examples include: BMC’s Recovery Manager EMC’s Datamanager Symantec’s NetBackup HP’s Data Protector Red Gate’s SQL Backup Dell’s LightSpeed Idera’s SQLsafe
18
Identified types of database errors
Review 11: Backup and Recovery Identified types of database errors Discussed backup methods available for online, offline, incremental backups, and backups to the cloud Learned about available recovery methods Discussed how to recover for different types of failures Introduced third-party solutions for aiding in backup and recovery Next module – Monitoring and Performance Tuning
19
© 2014 Microsoft Corporation. All rights reserved
© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.