presentación de powerpoint -...

108
COMMUNITY EVENTS: SQLBITS XV | LIVERPOOL http://sqlbits.com

Upload: dinhmien

Post on 03-Apr-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

COMMUNITY EVENTS: SQLBITS XV | LIVERPOOL

http://sqlbits.com

COMMUNITY EVENTS: SQL SATURDAYS| EXETER, DUBLIN, CAMBRIDGE

http://sqlsaturday.com

COMMUNITY EVENTS: DATA CULTURE EVENTS

https://www.microsoft.com/en-gb/enterprise/event/microsoft-data-culture-series.aspx

COMMUNITY EVENTS: SQLDAY 2016 | POLAND, WROCLAW

http://sqlday.pl/en

COMMUNITY EVENTS: PASS EAST MIDLANDS USER GROUP

http://www.meetup.com/es-ES/PASSEastMidlands/

SQL AZURE IN DERBY

TOBIASZ JANUSZ KOPROWSKI

| INDEPENDENT CONSULTANT | DATA PLATFORM MVP |

THE PLAN

6:00 – Registration & Intro

6:15 – Part One | Windows Azure SQL Database (tips&tricks)

7:15 – Break & Refreshments

7:30 – Part Two | SQL Server & WASD Backup, Restore and Management

8:15 – Part Three | Backup & Restore Best Practices in AD 2015

8:25 – Part Four | The Future of the DBA

8:30 – Event close

ABOUT ME

• independent consultant, security & licensing auditor

• Microsoft Certified Trainer

• SQL Server MVP (five… years in a row)

• MVP Mentor Program Member

• SharePoint Subject Matter Expert at CQURE

• active blogger, influencer, technical writer

• last 9 years living in Data Processing Center Jungle

• last 15 years working arroung banking and ICT

• Polish Information Technology Society Board Member

• Information Security Systems Association Board Member

PART ONE

WINDOWS AZURE SQL DATABASETIPS AND TRICKS FOR BEGINNERS

PART ONE OF PART ONE: SLIDE TALKS

PART ONE: PRIVATE > IAAS > PAAS

UNDERSTANDING CLOUD SERVICES

PART ONE: AZURE SHORT INTRODUCTION

• Windows Azure

Compute:

Virtualized compute environment based

on Windows Server

Storage:

Durable, scalable, & available storage

Management:

Automated, model-driven management of the service

• SQL Azure (cloud-based database)

Database:

Relational processing for structured/unstructured data

• App Fabric (.NET services)

Service Bus:

General purpose application bus

Access Control:

Rules-driven, claims-based access control

WHERE THE CLOUDS ARE BORN…

WHERE THE CLOUDS ARE BORN…

DATA CENTERS FOR AZURE PLATFORM

DATA CENTERS FOR AZURE PLATFORM

North America

US Central - Iowa

US East – Virginia / US East 2 - Virginia

US Gov Iowa – Iowa / US Gov Virginia - Virginia

US North Central - Illinois

US South Central - Texas

US West – California

Asia

Asia Pacific East - Hong Kong

Asia Pacific Southeast – Singapore

Europe

North Europe - Dublin, Ireland

West Europe - Amsterdam, Netherlands

Japan

Japan East - Saitama Prefecture

Japan West - Osaka Prefecture

Oceania (announced, coming soon)

Australia - Sydney, New South Wales

Australia - Melbourne, Victoria

South America (preview)

Brasil - Sao Paulo,

Some datacenters have servers grouped inside

containers - each containing

1800-2500 servers.

SECURITY REQUIREMENTS

As a Service Provider Microsoft has an obligation to passing the several rules for security:

• ISO/IEC 27001:2005

• SAS 70 Type 1 and II

Also they passing (continuisly) several data securing audits:

• PCI DSS

• SOX compliance

• HIPAA compliance

And of course requirements for Data Centers:

• Physical security of the data centers (locks, cameras, biometric devices, card readers, alarms)

• Firewalls, application gateways and IDS to protect the network

• Access Control Lists (ACLs) applied to virtual local area networks (VLANs) and applications

• Authentication and authorization of persons or processes that request access to data

• Hardening of the servers and operating system instances

• Redundant internal and external DNS infrastructure with restricted write access

• Securing of virtual machine objects

• Securing of static and dynamic storage containers

SECURITY REQUIREMENTS

• ISO/IEC 27001:2005 Audit and CertificationISO Scope: The following Azure features are in scope for the current ISO audit: Cloud Services (including Fabric and RDFE), Storage (Tables, Blobs, Queues),

Virtual Machines (including with SQL Server), Virtual Network, Traffic Manager, Web Sites, BizTalk Services, Media Services, Mobile Services, Service Bus,

Workflow, Multi-Factor Authentication, Active Directory, Right Management Service, SQL Database, and HDInsight. This includes the Information Security

Management System (ISMS) for Azure, encompassing infrastructure, development, operations, and support for these features. Also included are Power BI for

Office 365 and Power Query Service.

• SOC 1 and SOC 2 SSAE 16/ISAE 3402 AttestationsScope: The following Azure features are in scope for the current SOC 1 Type 2 and SOC 2 Type 2 attestations: Cloud Services (includes stateless Web, and

Worker roles), Storage (Tables, Blobs, Queues), Virtual Machines (includes persistent virtual machines for use with supported operating systems) and Virtual

Network (includes Traffic Manager).

• United Kingdom G-Cloud Impact Level 2 AccreditationScope: The following Azure features are in scope for the IL2 accreditation: Virtual Machines, Cloud Services, Storage (Tables, Blobs, Queues, Drives), and

Virtual Network.

• Cloud Security Alliance Cloud Controls Matrix

• Federal Risk and Authorization Management Program (FedRAMP)

• Payment Card Industry (PCI) Data Security Standards (DSS) Level 1

• HIPAA Business Associate Agreement (BAA)

• Family Educational Rights and Privacy Act (FERPA)

碧云寺 - TEMPLE OF AZURE CLOUDS

T

e

m

p

l

e

o

f

A

z

u

r

e

C

l

o

u

d

s

MICROSOFT AZURE SERVICES

MICROSOFT AZURE SERVICES

Azure Active Directory API Management Application Insights

Automation Backup Batch BizTalk Services Azure CDN Cloud

Services Data Factory DocumentDB Event Hubs ExpressRoute

HDInsight Key Vault Machine Learning Managed Cache Media

Services Mobile Engagement Mobile Services Multi-Factor

Authentication Notification Hubs Operational Insights Redis Cache

RemoteApp Scheduler Azure Search Service Bus Site Recovery

SQL Database Storage StorSimple Stream Analytics Traffic

Manager Virtual Machines Virtual Network Visual Studio Online

Websites

MICROSOFT AZURE SERVICES

SQL DATABASE IN THE CLOUD

A relational database-as-a-service that makes tier-1 capabilities

easily accessible

scalable to thousands of databases

predictable performance you can dial up or down

availability-backed by replicas & uptime sla

data protection via auditing, restore & geo-replication

programmatic dba-like functionality for efficient devops

self-managed for near-zero maintenance

VIRTUAL MACHINES

Launch Windows Server and Linux in minutes

scale from 1 to 1000s of vm instances

built-in virtual networking, load balancing

leverage hybrid consistency with on-premises

microsoft sql server and sharepoint server

oracle, mysql, redis, mongodb

save money with per-minute billing

HDINSIGHT

Our 100% Apache Hadoop-based service in the cloud

scale to petabytes on demand

process unstructured and semi-structured data

develop in java, .net, and more

no hardware to buy or maintain

pay only for what you use

spin up a hadoop cluster in minutes

visualize your hadoop data in excel

easily integrate on-premises hadoop clusters

MACHINE LEARNING

Powerful cloud-based predictive analytics

designed for new and experienced users

proven algorithms from ms research, xbox and bing

first class support for the open source language r

seamless connection to hdinsight for big data solutions

deploy models to production in minutes

pay only for what you use. no hardware or software to buy.

EXPRESS ROUTE

Experience a faster, private connection to Azure

private connections to azure

increased reliability and speed

lower latencies

higher security

significant cost benefits possible

directly connect from your wan

KEY VAULT

Safeguard cryptographic keys and other secrets used by cloud apps and services

• increase security and control over keys and passwords

• create and import encryption keys in minutes

• applications have no direct access to keys

• use fips 140-2 level 2 certified hsms

• reduce latency with cloud scale and global redundancy

TRAFFIC MANAGER

Geo-route incoming traffic to your app for better performance and availability

• improve app availability with automatic failover

• increase your app’s responsiveness

• enable smooth cloud migration

• distribute your app traffic equally or with weighted values

• a/b test new deployments

• seamlessly combine on-premises and cloud

OPERATIONAL INSIGHTS

Gain deeper insight into your environments

• collect, search and visualize machine data

• manage and forecast the capacity of your infrastructure

• assess the safety and security of your servers

• track server configuration changes

• proactively avoid workload problems

• ensure your servers are up to date

VISUAL STUDIO ONLINE

Ship better software with Visual Studio Online

• free for up to five users

• unlimited private source code repositories

• use visual studio, eclipse, or your own tools

• track bugs, work items, feedback and more

• monitor your apps and services

• scales to any team size

SHARED ENVIRONMENT

Hardware Boundary

Hardware Boundary

Hardware Boundary

Hardware Boundary

BC

D

AA

B

B

C

CD

D

A

SQL AZURE FEW DAYS AGO

We want to work with SQL Azure (oops SQL Database)

Size does matter?

• Personal: 1GB, 5GB

• Business: 10GB, 20 GB, 30 GB, 40 GB, 50 GB, 100 GB, 150 GB (3x50)

• “Private”: less than 100 MB ($4.995 / month)

Version does matter?

• 10.25 my first experience, but after July 2011 Service Release…

• 11.0.9214.51 now > close to SQL Server 2012

Row Versioning-Based Isolation Levels

• Both the READ_COMMITTED_SNAPSHOT and ALLOW_SNAPSHOT_ISOLATION database options

are set to ON in Microsoft Azure SQL Database.

• Because SET <snapshot_option> in the ALTER DATABASE Transact-SQL statement is not supported,

these database options cannot be changed.

error msg 40544:

The database has reached its size quota. Partition or delete data, drop indexes, or consult the documentation for possible resolutions.

SQL AZURE NOW

Size does matter?

• Personal: 1GB, 5GB

• Business: 10GB, 20 GB, 30 GB, 40 GB, 50 GB, 100 GB, 150 GB (3x50)

• “Private”: less than 100 MB ($4.995 / month)

Size does matter!

• BASIC

• size: 100MB, 500MB, 1GB, 2GB

• performance: 5DTU

• STANDARD

• size: 100MB, 500MB, 1GB, 2GB, 5GB, 10GB, 20GB, 30GB, 40GB, 50GB, 100GB, 150GB, 200GB, 250GB

• performance: S0 10DTU, S1 20DTU, S2 50DTU

• PREMIUM

• size: 100MB, 500MB, 1GB, 2GB, 5GB, 10GB, 20GB, 30GB, 40GB, 50GB, 100GB, 150GB, 200GB, 250GB, 500GB

• performance: P10 100DTU, P2 200DTU, SP3 800DTU

What is DTU

DTUs provide a way to describe the relative capacity of a performance level of Basic, Standard, and Premium databases. DTUs are based on a blended measure of CPU, memory, reads, and writes.

SQL AZURE AND DTU

Service TierPerformance Level

DTU MAX DB SizeMax Concurrent

RequestsMax Concurrent

LoginsMax Sessions

BenchmarkTransaction Rate

Predictability

Basic 5 2 GB 30 30 30016,600

transactions per hour

Good

Standard/S0 10 250 GB 60 60 600521 transactions

per minuteBetter

Standard/S1 20 250 GB 90 90 900934 transactions

per minuteBetter

Standard/S2 50 250 GB 120 120 1,2002,570 transactions

per minuteBetter

Standard/S3 100 250 GB 200 200 2,4005,100 transactions

per minuteBetter

Premium/P1 125 500 GB 200 200 2,400105 transactions

per secondBest

Premium/P2 250 500 GB 400 400 4,800228 transactions

per secondBest

Premium/P4 500 500 GB 800 800 9,600447 transactions

per secondBest

Premium/P6(formerly P3)

1000 500 GB 1,600 1,600 19,200735 transactions

per secondBest

SQL AZURE AND DTU

SQL AZURE COLLATION

Is Collation does matter?

• default database collation used by Microsoft Azure SQL Database is

SQL_LATIN1_GENERAL_CP1_CI_AS, where LATIN1_GENERAL is English (United States),

CP1 is code page 1252, CI is case-insensitive, and AS is accent-sensitive

SQL_Latin1_General_CP1_CI_AS

• When using an on-premise SQL Server, you can set collations at server, database,

column, and expression levels.

• Microsoft Azure SQL Database does not allow setting the collation at the server level.

• To use the non-default collation with Microsoft Azure SQL Database, set the collation

with the Create Database Collate option, or at the column level or the expression level.

• SQL Database does not support the Collate option with the Alter Database command.

• By default, in SQL Database, temporary data will have the same collation as the

database

USERS, MIGRATION, AUTOMATION,

Naming, Logins, Users

• Admin, administrator, guest, root, sa

Data Migration Support

• You can use:

• SQL Server 2008 Integration Services (SSIS)

• The bulk copy utility (BCP.exe)

• System.Data.SqlClient.SqlBulkCopy class

• Scripts that use INSERT statements to load data into the database

• SQL Data Compare from Red Gate

• You can't use:

• The RESTORE statement.

• Attaching a database to the SQL Database server.

No SQL Server Agent (almost)

No SQL Server jobs

No SQL Server Browser

No Cross Database queries

INDEXES

Indexes, of course indexes

• You MUST use CLUSTERED INDEX with your (Azure) SQL Database.

• Heap tables are not supportes, so You MUST create CLUSTERED INDEX before INSERT

will be executed

error msg 40054:

Tables without a clustered index are not supported in this version of SQL Server. Create a clustered index and try again.

CREATE TABLE Source (Id int NOT NULLIDENTITY, [Name] nvarchar(max),CONSTRAINT [PK_Source] PRIMARY KEYCLUSTERED(

[Id] ASC))

SQL DATABASE

Closed connections to the service… by the service

Because of multi-tenant :

• Excessive resource usage

• Connections that have been idle for 30 minutes or longer (Program assuming your

connection is going to fail)

• Failover because of server failures

errors:

40197, 40501, 40544, 40549, 40550, 40551, 40552, 40553, 40613

SAMPLE OF SQL COMPABILITY

In Scope for v1

• Constants

• Constraints

• Cursors

• Index management and rebuilding indexes

• Local temporary tables

• Reserved keywords

• Stored procedures

• Statistics management

• Transactions

• Triggers

• Tables, joins, and table variables

• Transact-SQL language elements such as

• Create/drop databases

• Create/alter/drop tables

• Create/alter/drop users and logins

• and so on.

• User-defined functions

• Views

Out of Scope for v1

• Common Language Runtime (CLR)

• Database file placement

• Database mirroring

• Distributed queries

• Distributed transactions

• Filegroup management

• Global temporary tables

• Spatial data and indexes

• SQL Server configuration options

• SQL Server Service Broker

• System tables

• Trace Flags

• Physical server or catalog DDL and views

SQL SERVER 2005 {9.0} NON-COMPABILITY

• Common Language Runtime (CLR) and CLR User-Defined Types

• Database Mirroring

• Service Broker

• Table Partitioning

• Typed XML and XML indexing is not supported. The XML data type is supported by SQL Azure.

SQL SERVER 2008 {10.0} NON-COMPABILITY• Change Data Capture

• Data Auditing

• Data Compression

• Extended Events

• External Key Management / Extensible Key Management

• FILESTREAM Data

• Integrated Full-Text Search

• Large User-Defined Aggregates (UDAs)

• Large User-Defined Types (UDTs)

• Performance Data Collection (Data Collector)

• Policy-Based Management

• Resource Governor

• SQL Server Replication

• Transparent Data Encryption

SQL SERVER 2008R2 {10.50} NON-COMPABILITY

• SQL Server Utility

• SQL Server PowerShell Provider

• Master Data Services

SQL Server Management Studio

does not support Windows Azure SQL Database in versions prior to

SQL Server 2008 R2

CONNECTION MODEL

When writing applications for Windows Azure SQL Database, you can use the following drivers and libraries:

• .NET Framework Data Provider for SQL Server (System.Data.SqlClient) from the .NET Framework 3.5 Service Pack 1 or

later.

• Entity Framework from the .NET Framework 3.5 Service Pack 1 or later.

• SQL Server 2008 R2 Native Client ODBC driver. SQL Server 2008 Native Client ODBC driver is also supported, but has less

functionality.

• SQL Server 2008 Driver for PHP version 1.1 or later.

• An updated version of SQL Server JDBC Driver 3.0 that supports SQL Database.

• Windows Azure SQL Database supports tabular data stream (TDS) protocol client version 7.3 or later. Earlier versions of

TDS protocol are not supported.

• Connecting to Windows Azure SQL Database by using OLE DB or ADO is not supported

• Support for ASP.NET controls

• Clients connect directly to a database

SECURITY MODEL

Uses regular SQL security model

• Authenticate logins, map to users and roles

• Authorize users and roles to SQL objects

Support for standard SQL Auth logins

• Username + password

AD Federation, WLID – Windows Live ID, etc as alternate authentication protocols

[admin, administrator, guest, root, sa] Security model is 100% compatible with on-premise SQL

SCENARIOS FOR V1

Departmental Applications

• Simple application built by individual or department

• Need simple deployment, self-management, IT: “Empowerment and Governance”

Web Applications

• Small business or startup that uses the cloud as their IT

• Simple deployment, self-management, scale on demand

ISV

• ISV hosting software on behalf of customer

• Multi-tenant support for billing and isolation

Data Hub (Shortly After V1)

• Sharing and aggregating of data across tiers and across enterprises

• Centralized place for data, high scale, sync with existing data sources

POINTS OF DIFFERENCES

Point of Difference On-premise SQL Server Windows Azure SQL Database

Where you manage server-level

security

The Security folder in SQL Server Management

Studio'sObject ExplorerThe master database

Server-level security role for

creating loginssecurityadmin fixed server role loginmanager database role in the master database

Commands for managing logins

CREATE LOGIN CREATE LOGIN

ALTER LOGIN ALTER LOGIN

DROP LOGIN DROP LOGIN

(There are some parameter limitations and you must be

connected to the master database)

View that shows all loginssys.syslogins (sys.sql_logins for SQL Server

authentication logins)

sys.sql_logins

(You must be connected to the master database)

Server-level role for creating

databasesdbcreator fixed database role dbmanager database role in the master database

Command for creating a database CREATE DATABASE

CREATE DATABASE

(There are some parameter limitations and you must be

connected to the master database)

Dropping databases DROP DATABASE

DROP DATABASE

If a user is in the dbmanager role, they have permission

to DROP any database, regardless of which user originally

created it.

View that lists all databasessys.databases sys.databases

(view) (You must be connected to the master database)

ADVENTURE WITH WASD

Adventure…

… of course Adventure Works 2012 for SQL Database

Adventure Works for SQL Server 2012

• Release date: March 2012

Adventure Works for SQL Azure

• Release date: April 2012

PART TWO OF PART ONE: DEMO MODE

AFTER DEMO: AZURE IN THE WEB

• azure portal

• management portal

• management studio

• third party tools

BREAK, TALKS, NETWORKING

PART TWO

SQL SERVER & WASDBACKUP & RESTORE MANAGEMENT

PART ONE OF PART TWO: SLIDE TALKS

BACKUP STRATEGY

What is Backup?

What is Strategy?

Will we need this?

SQL SERVER BACKUP MODE

If your database is in the Simple recovery model, you can still use full and differential backups. This does not

allow you to do point in time recovery, but it will allow you to restore your data to a more current point in time

then if you only had a full backup.

If your database is in the Full or Bulk-Logged recovery model you can also use differential backups to eliminate

the number of transaction logs that will need to be restored. Since the differential will backup all extents since

the last full backup, at restore time you can restore your full backup, your most recent differential backup and

then any transaction log backups that were created after the most recent differential backup. This cuts down on

the number of files that need to be restored.

FULL BACKUPS

The most common types of SQL Server backups are complete or full backups, also known as database

backups.

These backups create a complete backup of your database as well as part of the transaction log, so the

database can be recovered.

This allows for the simplest form of database restoration, since all of the contents are contained in one

backup.

DIFFERENTIAL BACKUPS (1)

The most common types of SQL Server backups are complete or full backups, also known as database

backups.

These backups create a complete backup of your database as well as part of the transaction log, so the

database can be recovered.

This allows for the simplest form of database restoration, since all of the contents are contained in one

backup.

DIFFERENTIAL BACKUPS (2)

So if you do a full backup and then do a differential backup, the differential backup will contain only the

extents that have changed.

If you wait some time and do another differential backup, this new differential backup will contain all

extents that have changed since the last full backup.

Each time you create a new differential backup it will contain every extent changed since the last full

backup.

When you go to restore your database, to get to the most current time you only need to restore the full

backup and the most recent differential backup.

All of the other differential backups can be ignored.

TRANSACTION LOG BACKUPS (1)

If your database is set to the "Full" or "Bulk-logged" recovery model then you will be able to issue

"Transaction Log" backups.

By having transaction log backups along with full backups you have the ability to do a point in time

restore, so if someone accidently deletes all data in a database you can recover the database to the

point in time right before the delete occurred.

The only caveat to this is if your database is set to the "Bulk-logged" recovery model and a bulk

operation was issued, you will need to restore the entire transaction log.

TRANSACTION LOG BACKUPS (2)

A transaction log backup allows you to backup the active part of the transaction log.

So after you issue a "Full" or "Differential" backup the transaction log backup will have any transactions

that were created after those other backups completed.

After the transaction log backup is issued, the space within the transaction log can be reused for other

processes.

If a transaction log backup is not taken, the transaction log will continue to grow.

SQL SERVER FILE BACKUPS

This allows you to backup each file independently instead of having to backup the entire database.

This is only relevant when you have created multiple data files for your database.

One reason for this type of backup is if you have a very large files and need to back them up individually.

For the most part you probably only have one data file, so this is option is not relevant.

SQL SERVER FILEGROUP BACKUPS

In addition to doing "File" backups you can also do "Filegroup" backups which allows you to backup all

files that are in a particular filegroup.

By default each database has a PRIMARY filegroup which is tied to the one data file that is created.

You have an option of creating additional filegroups and then placing new data files in any of the

filegroups.

In most cases you will probably only have the PRIMARY filegroup, so this is topic is not relevant..

BEST PRACTICE FOR SURVIVING DISASTER

ITS ONLY ONE: BE PREPARED

Backups

• about type of backup ( simple rm / full rm)

• about place for stored backup data

• about backup window

• about procedure used for backup

• about backup tools

• about backup of „backup logs”

• about estimated time for executing backup

• about REAL TIME of executing backup

BACKUP > EXTRACT FROM SOP*

In the request, backup, should include the following information:

• Information about the operating system and application version for online backup and installed updates

for these components

• a file backup policy, in particular:

a number of versions of a file stored

the storage time of the next version of the file

the frequency of execution of such incremental backups with the proposal of their implementation

• Online Backup Policy

the storage time of a full backup with storage time such an incremental backup

the time of transaction log files

the frequency of execution of a full backup with the proposal deadline for its implementation

the frequency of execution of the transaction log backup

• Information about trees directories / files that should be omitted or included during backup tasks (include

/ exclude)

• Number and type / model of physical processors,

• Does the node will use the connection to the SAN to implement backup

BACKUP (REG) > EXTRACT FROM SOP*

This register contains information about a backup plan implemented.

• Backup file space:

• number of versions of a file stored in a backup

• number of days that are kept more versions of a file

• number of versions of a file stored in the backup system after its removal from client device

• number of days that will store the latest version of the deleted file from the client device

• number of days that will be stored in the archive

• Online Backup:

• number of backups stored in full backup

• number of incremental backups / diff / full stored in the backup

• frequency of transaction log backups stored in the backup (for databases)

• number of days the backups to be stored on-line backup system

• The list of nodes defined in the system backup:

• Domain | Node name | IP address of the node

• The list of defined backup tasks (called schedule)

• name of the task (schedule) | execution time

• a period of at which the task is repeated

RESTORE STRATEGY

What is Restore?

What is Strategy?

Will we need this?

BEST PRACTICES BY BRENT OZAR

SQL Server Backup Best Practices | http://bit.ly/12oXm4h

Written on October 17, 2007 by Brent Ozar in SQL Server

I’ve been backing up SQL Servers for almost a decade now, and it’s time to share the lessons I’ve learned. All of this is

my own opinion – your mileage may vary – but I’ll try to explain the reasoning behind the choices I make. I won’t

address log shipping or snapshots this time around.

• Never back up databases to local disk.

• Back up databases to a fileshare, then back the share up to tape.

• Cost justify the network share with lower licensing costs & simpler backups.

• Back up to a different SAN if possible.

• My sweet spot for the backup array is raid 10 SATA.

• Backup agents like NetBackup and Backup Exec mean giving up scheduling control.

• Do regular fire drill rebuilds and restores.

• Build a standalone restore testbed.

• Keep management informed on restore time estimates.

• Trust no one.

BEST PRACTICE FOR SURVIVING DISASTER

ITS ONLY ONE: BE PREPARED

Restore

• about type of backup ( simple rm / full rm)

• about place for stored backup data

• about the procedures of recovery

• about estimated time for recovery

• about REAL TIME for recovery

• about tools for recovery

• about Corporate Backup Manager

• about password for access to library

RESTORE > EXTRACT FROM SOP*

Register for Recovery/Restore/Replacement Tests

This register contains information about the tests and replacement of part or all of the environment. It

consists of the following fields:

• the date of commencement and completion of the recovery test

• client for which the test was performed recovery test

• servers involved in testing and replacement

• extent of testing and replacement

• person / persons performing the recovery test

• person on the client side accepts the correctness of the recovery test

• subsequent to the recovery test

WASD BACKUP AND RESTORE

Microsoft Azure SQL Database has built-in backups to support self-service Point in Time Restore and

Geo-Restore for Basic, Standard, and Premium service tiers.

If you have Web or Business Edition databases, you must create your own backup strategy. You can

use database copy or Import and Export services to create copies of the data and export the file to an

Microsoft Azure storage account.

Built-in Automatic Backup in Azure SQL Database >> Azure SQL Database automatically creates backups

of every active database using the following schedule:

• full database backup once a week,

• differential database backups once a day,

• transaction log backups every 5 minutes.

The full and differential backups are replicated across regions to ensure availability of the backups in the

event of a disaster.

WASD BACKUP AND RESTORE

Backup storage is the storage associated with your automated database backups that are used for Point

in Time Restore and Geo-Restore. Azure SQL Database provides up to 200% of your maximum

provisioned database storage of backup storage at no additional cost.

For example, if you have a database in the Standard service tier with a provisioned size of 250 GB, you

will be provided with 500 GB of backup storage at no additional charge.

Point in Time Restore is designed to recover a database to a specific point in time within the backup

retention period supported by the service tier of the database. Restoring creates a new database with

the same service tier that was in use at the chosen restore point and the lowest performance level

supported by that tier.

For example, if you restore a database which was set to Premium at the specified restore point in time,

the new database will also be a Premium database and the performance level is set to P1

WASD BACKUP AND RESTORE

Service Tier Geo-RestoreSelf-Service Point in

Time RestoreBackup Retention Period

Restore a Deleted Database

Web Not supported Not supported n/a n/a

Business Not supported Not supported n/a n/a

Basic Supported Supported 7 days √

Standard Supported Supported 14 days √

Premium Supported Supported 35 days √

The time taken to complete a restore depends on the size of the database and the length of the log

chain. To get a good estimate of the restore time, you should periodically test restoring the database.

You can monitor the restore operation using sys.dm_operation_status.

SQL SERVER BACKUP AND RESTORE WITH WINDOWS AZURE BLOB STORAGE SERVICE

• sql server backups to and restoring from the windows azure blob storage service. it also provides

a summary of the benefits of using the windows azure blob service to store sql server backups.

• sql server supports storing backups to the windows azure blob storage service in the following

ways:

• manage your backups to windows azure: using the same methods used to backup to disk and

tape, you can now back up to windows azure storage by specifying url as the backup destination.

you can use this feature to manually backup or configure your own backup strategy like you

would for a local storage or other off-site options. this feature is also referred to as sql server

backup to url. for more information, see sql server backup to url. this feature is available in sql

server 2012 sp1 cu2 or later.

SQL SERVER BACKUP AND RESTORE WITH WINDOWS AZURE BLOB STORAGE SERVICE

Benefits of Using the Windows Azure Blob Service for SQL Server Backups

• Flexible, reliable, and limitless off-site storage:

Storing your backups on Windows Azure Blob service can be a convenient, flexible, and easy to access off-site option.

Creating off-site storage for your SQL Server backups can be as easy as modifying your existing scripts/jobsBy choosing

to geo replicate the Blob storage you have an extra layer of protection in the event of a disaster that could affect the

whole region. In addition, backups are available from anywhere and at any time and can easily be accessed for restores.

• Backup Archive:

The Windows Azure Blob Storage service offers a better alternative to the often used tape option to archive backups.

Tape storage might require physical transportation to an off-site facility and measures to protect the media. Storing

your backups in Windows Azure Blob Storage provides an instant, highly available, and a durable archiving option.

• No overhead of hardware management:

There is no overhead of hardware management with Windows Azure services. Windows Azure services manage the

hardware and provide geo-replication for redundancy and protection against hardware failures.

• Cost Benefits:

Pay only for the service that is used. Can be cost-effective as an off-site and backup archive option. See the Windows

Azure Billing Considerations section for more information and links.

SQL SERVER BACKUP AND RESTORE WITH WINDOWS AZURE BLOB STORAGE SERVICE

Benefits of Using the Windows Azure Blob Service for SQL Server Backups

• Currently for instances of SQL Server running in a Windows Azure Virtual Machine, backing up to

Windows Azure Blob storage services can be done by creating attached disks.

However, there is a limit to the number of disks you can attach to a Windows Azure Virtual Machine.

This limit is 16 disks for an extra large instance and fewer for smaller instances. By enabling a direct

backup to Windows Azure Blob Storage, you can bypass the 16 disk limit.

• In addition, the backup file which now is stored in the Windows Azure Blob storage service is directly

available to either an on-premises SQL Server or another SQL Server running in a Windows Azure

Virtual Machine, without the need for database attach/detach or downloading and attaching the VHD.

PART TWO OF PART TWO: DEMO MODE

CONNECTION

AFTER DEMO: BACKUP WITH AZURE

• backup with azure

• backup with management studio

• file management with azure management apps

• restore with azure

• restore with management studio

PART THREE: BACKUP RESTORE BEST PRACTICES

BEST PRACTICES >> GENERAL

• backups should not be on the same physical storage as your database files

• set up schedules to automate your backups

• use a test server to verify the restore procedure of your backups

• test your recovery strategies

• use all available verification options during backup process

BEST PRACTICES >> FREQUENCY

• doing a full backup daily

• doing differential backups more frequently

• do transaction log backups even more frequently

• back up system databases as well

• back up offline database as well even less frequently

BEST PRACTICES >> TAPE

with tape you get:

• very long media lifetime (20 – 30 years)

• very easy to transport

• lower power consumption

• higher reliability

• a long lifetime for the drive (around 10 years)

today’s tapes, which are the 5th generation, LTO-5:

have a high speed at around 140 mb/sec

can store around 1.5 tb of uncompressed data

BEST PRACTICES >> CLOUD

• use cloud services (aka azure)

• use newest version of management studio

• use third party tools

• store backup on azure blob storage

• use encryption for external store

BEST PRACTICE ANALYZER

The SQL Server 2012 Best Practice Analyzer (SQL Server 2012 BPA) provides rules to detect situations

where some of these backup recommendations are not followed

| run the BPA tool and encounter an Error with the title of Database Engine - database files and backups

exist on the same volume, and then you need to verify the location where you store the backups for

your databases.

| You will encounter this error if the backups are stored in the same location as the database files. If you

get this error, there are a couple of important points to consider: This rule checks only logical volumes

of the location for the backup file and the database file. You need to manually ensure that these logical

volumes are actually on separate physical disks or drives.

• You could encounter this error from the BPA tool when there are old entries present in the backup

history tables that shows backup was taken to the same volume as the database files. If you are

aware of such backups, you could either ignore the error or clean up the old information from the

msdb backup history tables using the stored procedure sp_delete_database_backuphistory.

• You could encounter this error if you have your database files and backup files located on network

locations or shares. Currently the BPA tool evaluates the first 3 characters of the physical path to find

out the drive name.

DON’T ASK ME…

PART FOUR: THE FUTURE OF THE DBA’S

THE FUTURE OF THE DBA - DISCUSSION

FUTURE OF THE DBA’S

SQL Server on Premise

• same job (almost like always)

• same tasks, planning, architecture

• same problems

• same fun especially with new versions every… two years?

FUTURE OF THE DBA’S

New horizons, new skills

• SQL as a service (SQL Azure Database)

• not very new but still new concepto of work

• some restriction (in minus)

• some improvements (such a security)

FUTURE OF THE DBA’S

Automation behind our business

someone (in MS DC) making half of our job

we can forget about few important features/tasks:

• tempdb

• mirroring

• auditing

• backup & restore

what is our role?

APPENDIX: LINKS & DEMOS

appendix: additional links

appendix: additional links

SQL Database Migration Wizard v3.11 & v4.11 & v5.11

• Project Description

SQL Database Migration Wizard (SQLAzureMW) is designed to help you migrate your SQL Server

2005/2008/2012/2014 databases to Azure SQL Database.

Requirements

SQLAzureMW v3x and tools requires .NET Framework 3.5 and SQL Server 2008 R2 SP1

SQLAzureMW v4x and tools requires .NET Framework 4.5 and SQL Server 2012

SQLAzureMW v5x and tools requires .NET Framework 4.5 and SQL Server 2014

• AzureMWBatchBackup:

• This is used to create a backup of a database schema and data. The data is downloaded via BCP. The TSQL

output from SQLAzureMWBatchBackup can be used by SQLAzureMW or SQLAzureMWBatchUpload.

• SQLAzureMWBatchUpload:

• Takes the output from SQLAzureMW or SQLAzureMWBatchBackup and runs it against the target Azure SQL

Database (or SQL Server) server.

very important article

Authors: Conor Cunningham, Tobias Ternström, Silvano Coriani, Ewan Fairweather

Contributing Author: Ralph Squillace http://bit.ly/WIHlDL

msdn sql database district

Windows Azure SQL Database (formerly SQL Azure) | http://bit.ly/H0Wdfx

• What's New in Windows Azure SQL Database (formerly SQL Azure)

• Backward Compatibility in Windows Azure SQL Database

• Known Issues in Windows Azure SQL Database

• Introducing Windows Azure SQL Database

• Tutorials

• Feedback and Community Information

• Windows Azure Platform Management Portal

• Windows Azure SQL Database Concepts

• Administration

• Development

• Guidelines and Limitations

• Management REST API Reference

• Transact-SQL Reference

• Errors and Exceptions Reference

appendix: additional links

• Red Gate Cloud Ready Services

• http://cloudservices.red-gate.com/

• Windows Azure DataCenter Video

http://www.youtube.com/watch?v=JJ44hEr5DFE

• General Guidelines and Limitations (Windows Azure SQL Database)

• http://bit.ly/11wB6cK

• Adventure Works for SQL Database (formerly SQL Azure)

• http://bit.ly/125s0W0

• Federations: Building Scalable, Elastic, and Multi-tenant Database Solutions

• http://bit.ly/ZxzjmQ | http://bit.ly/15GzIEE

• Error Messages (Windows Azure SQL Database)

• http://bit.ly/17tnQtE

• Compare SQL Server with Windows Azure SQL Database

• http://bit.ly/15RyB5u

appendix: additional links

• Trust Center: Security, Privacy and Compliance Information for Office 365 and Microsoft Dynamics

CRM Online

• http://bit.ly/1q4i8bY

• Announcing PCI DSS compliance and expanded ISO certification for Windows Azure

• http://bit.ly/1tyt7vE

• Windows Azure cloud services achieve critical federal security milestone

• http://bit.ly/1osDHfi

• INFOSYS – Microsoft Data Access Technologies SWOT

• http://infy.com/1kgujKC

• One year in, and the use cases for Microsoft's SQL Azure are becoming clear

• http://bit.ly/TYWRRV

appendix: additional links

• New Levels of Security via Machine Learning & Combined Data Sets

• http://bit.ly/1s6seth

• Predict What's Next: Getting Started on Azure Machine Learning - Part 1

• http://bit.ly/1BLfWq1

• Predict What's Next: How to Get Started with Machine Learning Part 2

• http://bit.ly/1BLg099

• Introducing Elastic Scale preview for Azure SQL Database

• http://bit.ly/1xZk5sG

• New D-Series Virtual Machine Sizes

• http://bit.ly/10IapFg

appendix: additional links

• Windows Azure IT Camp Resources–Slide Deck and Hands-on-Lab

• http://blogs.technet.com/b/bobh/archive/2013/09/18/windows-azure-it-camp-resources-slide-deck-and-

hands-on-lab.aspx#sthash.yFgxwPLv.dpuf

• Microsoft Azure Free one month trial

• http://azure.microsoft.com/en-us/pricing/free-trial/?WT.mc_id=AB7B32386

• Microsoft Virtual Academy

• http://azure.microsoft.com/en-us/pricing/free-trial/?WT.mc_id=AB7B32386

• Introducing Elastic Scale preview for Azure SQL Database

• http://azure.microsoft.com/blog/2014/10/02/introducing-elastic-scale-preview-for-azure-sql-database/

• Performance Best Practices for SQL Server in Azure Virtual Machines

• http://msdn.microsoft.com/en-

us/library/azure/dn133149.aspx?WT.mc_id=Social_SQL_General_DI&WT.mc_id=Social_FB_OutgoingPromotion_2

0140922_90669619_Microsoft%20SQL%20Server%20-%20sqlserver&linkId=9703972

JUST AZUREhttp://JustAzure.com

AFTER SESSION CONTACT:

• MAIL: [email protected]

• SOCIAL MEDIA: facebook, twitter, linkedin, xing

SLIDES FROM SESSION:

• SlideShare Profile: http://www.slideshare.net/Anorak

BLOGS:

• ITPRO Anorak’s Vision: http://itblogs.pl/notbeautifulanymore/ [PL/EN]

• Volume Licensing Specialites: http://koprowskit.eu/licensing/ [PL]

• My MVP Blog: http://koprowskit.eu/geek/ [EN/ES/PL]

THANK YOU!