SlideShare a Scribd company logo
1 of 47
SQL Server Backup to Azure
Christian Sanabria J.
csanabria@itcr.ac.cr
@csanabriaj
https://cr.linkedin.com/in/csanabria
MCP Office 365, ITILf, Scrum Master
csanabria@edublogs.org
Preparado con apoyo de:
Juan Carlos Gilaranz B.
http://www.mundosql.es
Microsoft Active Professional 2014
España
Organiza
http://tinyurl.com/ComunidadWindows
Patrocinadores del SQL Saturday
Premier Sponsor
Gold Sponsor
Bronze Sponsor
Agenda
 ¿Qué se requiere?
 Azure
 SQL Server
 Configuración en Azure
 Servicio
 Datos necesarios
 Creación de respaldos:
 Respaldar mediante interfaz gráfica
 Respaldar mediante T-SQL
 Comandos de Powershell
 Versiones de SQL Server que no lo soportan. ¿Qué
hacer?
5/19/2015
|
SQL Backup to Azure4 |
¿Qué NO se trata?
 Tipos ni planes de respaldos
 Detalles y conceptos de Azure / Servicios,
etc.
 Respaldos de servicios SQL en máquinas
virtuales Azure o Azure SQL Storage
 Hablamos de respaldo de SQL on-premises hacia
Azure
5/19/2015
|
SQL Backup to Azure5 |
SQL Backup to Azure
 Disponible desde SQL Server 2012 SP1 CU2
como opción adicional
 También conocido como “Backup to URL”
5/19/2015
|
SQL Backup to Azure6 |
Problem
As DBAs, we don't only have the responsibility to backup databases on regular basis,
but also to ensure that backup drives and tapes are secure so databases can be
restored when needed. I heard that SQL Server 2012 supports backups and restores
using a Windows Azure Blob Storage account. How does this work and how do I get
started?
By: Arshad Ali
Configuración de Windows Azure
https://manage.windowsazure.com
Ver:
https://www.youtube.com/watch?v=NuVsVCCwLmA
5/19/2015
|
SQL Backup to Azure7 |
Azure Management Portal
5/19/2015
|
SQL Backup to Azure8 |
Acceso al Storage
5/19/2015
|
SQL Backup to Azure9 |
Creación del contenedor dentro del servicio
de Storage
5/19/2015
|
SQL Backup to Azure10 |
Permite listar
contenido
Se debe
conocer la
ruta exacta
Creación del contenedor
5/19/2015
|
SQL Backup to Azure11 |
Contenedor
5/19/2015
|
SQL Backup to Azure12 |
Binary Large Objects (BLOBs)
Configuración de SQL Server
(on-premises)
5/19/2015
|
SQL Backup to Azure13 |
 Configurar:
 Credencial
 Login
 Backup
 Métodos:
 SSMS
 T-SQL
 Powershell
 SMO (Microsoft.SqlServer.Management.Smo)
Se debe configurar
 1. Credencial para acceso al Storage en
Azure
5/19/2015
|
Footer Goes Here14 |
Se debe configurar
5/19/2015
|
Footer Goes Here15 |
Login para respaldos
Permisos
 Permissions
 BACKUP DATABASE and BACKUP LOG
permissions default to members of
the sysadmin fixed server role and
the db_owner and db_backupoperator fixed
database roles.
https://msdn.microsoft.com/en-us/library/ms186865.aspx
Opciones del respaldo
5/19/2015
|
Footer Goes Here17 |
Finalmente
5/19/2015
|
Footer Goes Here18 |
19 percent processed.
39 percent processed.
59 percent processed.
72 percent processed.
84 percent processed.
93 percent processed.
Processed 648 pages for database 'BDDemoPASS', file
'BDDemoPASS' on file 1.
100 percent processed.
Processed 2 pages for database 'BDDemoPASS', file
'BDDemoPASS_log' on file 1.
BACKUP DATABASE successfully processed 650 pages in
11.725 seconds (0.433 MB/sec).
SSMS
T-SQL
Backup – T-SQL
BACKUP DATABASE [ProductInfoSPA]
TO URL =
N'https://sqlbackuptec.blob.core.windows.net/sqlbacku
pazure1/ProductInfoSPA_backup_2015_04_06_11320
8.bak'
WITH CREDENTIAL = N'SQLBackup2AzureCred' ,
DESCRIPTION = N'Demo SQL PASS 2015',
NOFORMAT, NOINIT,
NAME = N'ProductInfoSPA-Full Database Backup',
NOSKIP, NOREWIND, NOUNLOAD,
COMPRESSION, STATS = 10
GO
5/19/2015
|
Footer Goes Here19 |
Restore – SSMS (2014)
5/19/2015
|
Footer Goes Here20 |
Restore – SSMS (2014)
 Main Text / Bullets Here, Gray, 30 pt.
 Main Text / Bullets Here, Gray, 30 pt.
 Bullet Points, Line 2, 26 pt.
 Bullet Points, Line 3, 22 pt.
 Bullet Points, Line 4, 20 pt.
5/19/2015
|
Footer Goes Here21 |
Restore – T-SQL
 USE [master]
 ALTER DATABASE [ProductInfoSPA] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
 BACKUP LOG [ProductInfoSPA] TO URL =
N'https://sqlbackuptec.blob.core.windows.net/sqlbackupazure1/ProductInfoSPA_LogBackup_2015
-04-06_16-24-57.bak' WITH CREDENTIAL = N'SQLBackup2AzureCred' , NOFORMAT, NOINIT,
NAME = N'ProductInfoSPA_LogBackup_2015-04-06_16-24-57', NOSKIP, NOREWIND,
NOUNLOAD, NORECOVERY , STATS = 5
 RESTORE DATABASE [ProductInfoSPA] FROM URL =
N'https://sqlbackuptec.blob.core.windows.net/sqlbackupazure1/ProductInfoSPA_backup_2015_04
_06_113208.bak' WITH CREDENTIAL = N'SQLBackup2AzureCred' , FILE = 1, NORECOVERY,
NOUNLOAD, REPLACE, STATS = 5
 RESTORE LOG [ProductInfoSPA] FROM URL =
N'https://sqlbackuptec.blob.core.windows.net/sqlbackupazure1/ProductInfoSPA_LogBackup_2015
-04-06_16-21-51.bak' WITH CREDENTIAL = N'SQLBackup2AzureCred' , FILE = 1,
NOUNLOAD, STATS = 5
 ALTER DATABASE [ProductInfoSPA] SET MULTI_USER
 GO
5/19/2015
|
Footer Goes Here22 |
Restore exitoso
5/19/2015
|
Footer Goes Here23 |
Respaldo y restauración con Azure usando
PowerShell
5/19/2015
|
Footer Goes Here24 |
import-module sqlps
# definir variables
$storageAccount = "mystorageaccount"
$storageKey = "<storageaccesskeyvalue>"
$secureString = convertto-securestring
$storageKey -asplaintext -force
$credentialName = "mybackuptoURL"
#cd to computer level
cd sqlserver:sqlCOMPUTERNAME
# get the list of instances
$instances = Get-childitem
#pipe the instances to new-sqlcredentail cmdlet to create SQL
credential
$instances | new-sqlcredential -Name
$credentialName -Identity
$storageAccount -Secret $secureString
Powershell – crear credencial
Respaldo y restauración con Azure usando
SMO
http://www.mssqltips.com/sqlservertip/3054/bac
kup-and-restore-sql-server-databases-with-
azure-cloud-services-and-smo/
5/19/2015
|
Footer Goes Here25 |
SMO: SQL Server Management Objects
(Microsoft.SqlServer.Management.Smo)
Programming Guide https://msdn.microsoft.com/en-us/library/ms162169.aspx
Referencias y código C#
5/19/2015
|
Footer Goes Here26 |
SMO – C# - BackupDatabase
5/19/2015
|
Footer Goes Here27 |
SMO – C# - RestoreDatabase
Versiones de SQL Server que no lo soportan
¿Qué hacer?
 SQL Backup to Azure Tool
 Antes de SQL 2012 SP1
 Configuración similar
 Mismos datos
 Se basa en reglas:
 Carpetas
 Tipos de archivo
 Permite:
 Compresión
 Distintos tipos de encripción
 Está en:
 http://www.microsoft.com/en-us/download/details.aspx?id=40740
 Video de forma de uso en:
 https://www.youtube.com/watch?v=5epRBcwEz00
5/19/2015
|
Footer Goes Here29 |
Configuración – agregar regla
5/19/2015
|
Footer Goes Here30 |
Configuración - Ruta y patrón
5/19/2015
|
Footer Goes Here31 |
Configuración – Storage y contenedor
5/19/2015
|
Footer Goes Here32 |
Configuración – cifrado y compresión
5/19/2015
|
Footer Goes Here33 |
Lista y opciones
5/19/2015
|
Footer Goes Here34 |
Mejores prácticas
 Usar nombres únicos para identificar cada backup
fecha/hora/bd/servidor
 Definir el acceso al contenedor como private
 Utilizar la misma región para mejorar rendimiento y manejar
costos (*)
 Monitorear constantemente el fallo/éxito de las operaciones si
se automatiza
 Usar la opción WITH COMPRESSION para minimizar los
costos de storage y el tiempo
 Usar encripción (*)
 Hacer pruebas de tiempo de respaldo y recuperación
 Revisar los SLA’s de Azure(http://www.microsoft.com/en-
us/download/details.aspx?id=6656)
https://msdn.microsoft.com/en-us/library/jj919149.aspx
5/19/2015
|
Footer Goes Here35 |
¿Cómo adapto mi plan de respaldos?
37 |
Christian
Sanabria
csanabria@itcr.ac.cr
@csanabriaj
PREGUNTAS Y RESPUESTAS
Gracias!
 PASS
 PASS LATAM
 PASS CR Chapter
5/19/2015
|
Footer Goes Here38 |
Todos ustedes!!!
Slides de apoyo
Estructura del Storage en Azure
5/19/2015
|
Footer Goes Here40 |
Tail-log backup (respaldo del log)
 A tail-log backup is a transaction log backup
that includes the portion of the log that
has not previously been backed up (known
as the active portion of the log). A tail-log
backup does not truncate the log and is
generally used when the data files for a
database have become inaccessible but the
log file is undamaged.
5/19/2015
|
Footer Goes Here41 |
Error de master key decryption
Respaldo FULL (incluyendo BD’s del sistema)
 This includes both user databases
and msdb system database. The script filters
out tempdb and model system databases.
5/19/2015
|
Footer Goes Here43 |
import-module sqlps
# set the parameter values
$storageAccount = "mystorageaccount"
$blobContainer = "privatecontainertest"
$backupUrlContainer = "https://$storageAccount.blob.core.windows.net/$blobContainer/"
$credentialName = "mybackuptoURL"
# cd to computer level
cd SQLServer:SQLCOMPUTERNAME
$instances = Get-childitem
# loop through each instances and backup up all the databases -filter out tempdb and model databases
foreach ($instance in $instances) {
$path = "sqlserver:sql$($instance.name)databases" $alldatabases = get-childitem -Force -path $path |
Where-object {$_.name -ne "tempdb" -and $_.name -ne "model"} $alldatabases |
Backup-SqlDatabase -BackupContainer $backupUrlContainer -SqlCredential $credentialName -Compression On -script }
Referencia:
https://msdn.microsoft.com/en-us/library/dn223322.aspx
Full Database Backup for ALL User Databases
import-module sqlps
$storageAccount = "mystorageaccount"
$blobContainer = "privatecontainertest"
$backupUrlContainer =
"https://$storageAccount.blob.core.windows.net/$blobContainer/"
$credentialName = "mybackuptoURL"
# cd to computer level
cd SQLServer:SQLCOMPUTERNAME
$instances = Get-childitem
# loop through each instances and backup up all the user databases
foreach ($instance in $instances) {
$databases = dir "sqlserver:sql$($instance.name)databases"
$databases | Backup-SqlDatabase -BackupContainer $backupUrlContainer -SqlCredential
$credentialName -Compression On
}
5/19/2015
|
Footer Goes Here44 |
Full Database Backup for MASTER and MSDB (SYSTEM
DATABASES) On All the Instances of SQL Server
The following script can be used to back up master and msdb databases on all the instances
of SQL Server installed on the computer.
import-module sqlps
$storageAccount = "mystorageaccount"
$blobContainer = "privatecontainertest" $backupUrlContainer =
"https://$storageAccount.blob.core.windows.net/$blobContainer/"
$credentialName = "mybackupToUrl"
$sysDbs = "master", "msdb"
#cd to computer level cd sqlserver:sqlCOMPUTERNAME
$instances = Get-childitem
foreach ($instance in $instances) {
foreach ($s in $sysdbs) {
Backup-SqlDatabase -Database $s -path
"sqlserver:sql$($instance.name)" -BackupContainer $backupUrlContainer -SqlCredential
$credentialName - Compression On
}
}
5/19/2015
|
Footer Goes Here45 |
Ejemplo de script Powershell
$db = $svr.Databases['AdventureWorks']
$dbname = $db.Name
$dt = get-date -format yyyyMMddHHmmss
$dbbk = new-object
('Microsoft.SqlServer.Management.Smo.Backup')
$dbbk.Action = 'Database'
$dbbk.BackupSetDescription = "Full backup of " + $dbname
$dbbk.BackupSetName = $dbname + " Backup"
$dbbk.Database = $dbname
$dbbk.MediaDescription = "Disk"
$dbbk.Devices.AddDevice($bdir + "" + $dbname + "_db_" + $dt
+ ".bak", 'File')
$dbbk.SqlBackup($svr)
5/19/2015
|
Footer Goes Here46 |
Uso del Cmdlet Backup-SqlDatabase
 $svnm = $svr.Name
 $db = $svr.Databases['AdventureWorks']
 $dbname = $db.Name
 $dt = get-date -format yyyyMMddHHmmss
 $bfil = "$bdir$($dbname)_db_$($dt).bak"
 Backup-SqlDatabase -ServerInstance $svnm -
Database $dbname -BackupFile $bfil
5/19/2015
|
Footer Goes Here47 |
http://sqlmag.com/powershell/powershell-lets-you-back-sql-server-your-way

More Related Content

What's hot

MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMiguel Araújo
 
MySQL 8.0.22 - New Features Summary
MySQL 8.0.22 - New Features SummaryMySQL 8.0.22 - New Features Summary
MySQL 8.0.22 - New Features SummaryOlivier DASINI
 
MySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoMySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoKeith Hollman
 
MySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features SummaryMySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features SummaryOlivier DASINI
 
MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersRonald Bradford
 
MySQL Technology Overview
MySQL Technology OverviewMySQL Technology Overview
MySQL Technology OverviewKeith Hollman
 
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...Keith Hollman
 
MySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsMySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsRonald Bradford
 
MySQL Enterprise Edition - Complete Guide (2019)
MySQL Enterprise Edition - Complete Guide (2019)MySQL Enterprise Edition - Complete Guide (2019)
MySQL Enterprise Edition - Complete Guide (2019)Keith Hollman
 
MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourRonald Bradford
 
2012 scale replication
2012 scale replication2012 scale replication
2012 scale replicationsqlhjalp
 
Mysql nowwhat
Mysql nowwhatMysql nowwhat
Mysql nowwhatsqlhjalp
 
The History and Future of the MySQL ecosystem
The History and Future of the MySQL ecosystemThe History and Future of the MySQL ecosystem
The History and Future of the MySQL ecosystemRonald Bradford
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlsqlhjalp
 
My sql crashcourse_2012
My sql crashcourse_2012My sql crashcourse_2012
My sql crashcourse_2012sqlhjalp
 
Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Olivier DASINI
 
Azure Nights Melbourne July 2017 Meetup
Azure Nights Melbourne July 2017 MeetupAzure Nights Melbourne July 2017 Meetup
Azure Nights Melbourne July 2017 MeetupMichael Frank
 
My two cents about Mysql backup
My two cents about Mysql backupMy two cents about Mysql backup
My two cents about Mysql backupAndrejs Vorobjovs
 
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
MySQL High Availability Solutions  -  Avoid loss of service by reducing the r...MySQL High Availability Solutions  -  Avoid loss of service by reducing the r...
MySQL High Availability Solutions - Avoid loss of service by reducing the r...Olivier DASINI
 

What's hot (20)

MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
 
MySQL 8.0.22 - New Features Summary
MySQL 8.0.22 - New Features SummaryMySQL 8.0.22 - New Features Summary
MySQL 8.0.22 - New Features Summary
 
MySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoMySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & Demo
 
MySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features SummaryMySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features Summary
 
MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and Developers
 
MySQL Technology Overview
MySQL Technology OverviewMySQL Technology Overview
MySQL Technology Overview
 
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
 
MySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsMySQL Backup and Recovery Essentials
MySQL Backup and Recovery Essentials
 
MySQL on Docker and Kubernetes
MySQL on Docker and KubernetesMySQL on Docker and Kubernetes
MySQL on Docker and Kubernetes
 
MySQL Enterprise Edition - Complete Guide (2019)
MySQL Enterprise Edition - Complete Guide (2019)MySQL Enterprise Edition - Complete Guide (2019)
MySQL Enterprise Edition - Complete Guide (2019)
 
MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD Tour
 
2012 scale replication
2012 scale replication2012 scale replication
2012 scale replication
 
Mysql nowwhat
Mysql nowwhatMysql nowwhat
Mysql nowwhat
 
The History and Future of the MySQL ecosystem
The History and Future of the MySQL ecosystemThe History and Future of the MySQL ecosystem
The History and Future of the MySQL ecosystem
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdl
 
My sql crashcourse_2012
My sql crashcourse_2012My sql crashcourse_2012
My sql crashcourse_2012
 
Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0
 
Azure Nights Melbourne July 2017 Meetup
Azure Nights Melbourne July 2017 MeetupAzure Nights Melbourne July 2017 Meetup
Azure Nights Melbourne July 2017 Meetup
 
My two cents about Mysql backup
My two cents about Mysql backupMy two cents about Mysql backup
My two cents about Mysql backup
 
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
MySQL High Availability Solutions  -  Avoid loss of service by reducing the r...MySQL High Availability Solutions  -  Avoid loss of service by reducing the r...
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
 

Viewers also liked

Резервное копирование локальной ит-инфраструктуры в облако
Резервное копирование локальной ит-инфраструктуры в облакоРезервное копирование локальной ит-инфраструктуры в облако
Резервное копирование локальной ит-инфраструктуры в облакоOlga Bezotosnaya
 
Простая сложная облачная платформа Azure
Простая сложная облачная платформа AzureПростая сложная облачная платформа Azure
Простая сложная облачная платформа AzureTechExpert
 
Stor simple presentation customers rus
Stor simple presentation customers rusStor simple presentation customers rus
Stor simple presentation customers rusMMI Group
 
Eric Moreau - Samedi SQL - Backup dans Azure et BD hybrides
Eric Moreau - Samedi SQL - Backup dans Azure et BD hybridesEric Moreau - Samedi SQL - Backup dans Azure et BD hybrides
Eric Moreau - Samedi SQL - Backup dans Azure et BD hybridesMSDEVMTL
 
Azure backup v0.7
Azure backup v0.7Azure backup v0.7
Azure backup v0.7Luca Mauri
 
5. Готовые инструменты Azure: бизнес-прогнозирования в Machine Learning
5.	Готовые инструменты Azure: бизнес-прогнозирования в Machine Learning5.	Готовые инструменты Azure: бизнес-прогнозирования в Machine Learning
5. Готовые инструменты Azure: бизнес-прогнозирования в Machine LearningTechExpert
 
Startup Crash Test - Andrey Kvjatkovsky - Cloud Berry
Startup Crash Test - Andrey Kvjatkovsky - Cloud BerryStartup Crash Test - Andrey Kvjatkovsky - Cloud Berry
Startup Crash Test - Andrey Kvjatkovsky - Cloud BerryNevaCamp
 
Microsoft azure backup overview
Microsoft azure backup overviewMicrosoft azure backup overview
Microsoft azure backup overviewSumantro Mukherjee
 
Introduccion Backup azure
Introduccion Backup azure Introduccion Backup azure
Introduccion Backup azure Ivan Martinez
 

Viewers also liked (9)

Резервное копирование локальной ит-инфраструктуры в облако
Резервное копирование локальной ит-инфраструктуры в облакоРезервное копирование локальной ит-инфраструктуры в облако
Резервное копирование локальной ит-инфраструктуры в облако
 
Простая сложная облачная платформа Azure
Простая сложная облачная платформа AzureПростая сложная облачная платформа Azure
Простая сложная облачная платформа Azure
 
Stor simple presentation customers rus
Stor simple presentation customers rusStor simple presentation customers rus
Stor simple presentation customers rus
 
Eric Moreau - Samedi SQL - Backup dans Azure et BD hybrides
Eric Moreau - Samedi SQL - Backup dans Azure et BD hybridesEric Moreau - Samedi SQL - Backup dans Azure et BD hybrides
Eric Moreau - Samedi SQL - Backup dans Azure et BD hybrides
 
Azure backup v0.7
Azure backup v0.7Azure backup v0.7
Azure backup v0.7
 
5. Готовые инструменты Azure: бизнес-прогнозирования в Machine Learning
5.	Готовые инструменты Azure: бизнес-прогнозирования в Machine Learning5.	Готовые инструменты Azure: бизнес-прогнозирования в Machine Learning
5. Готовые инструменты Azure: бизнес-прогнозирования в Machine Learning
 
Startup Crash Test - Andrey Kvjatkovsky - Cloud Berry
Startup Crash Test - Andrey Kvjatkovsky - Cloud BerryStartup Crash Test - Andrey Kvjatkovsky - Cloud Berry
Startup Crash Test - Andrey Kvjatkovsky - Cloud Berry
 
Microsoft azure backup overview
Microsoft azure backup overviewMicrosoft azure backup overview
Microsoft azure backup overview
 
Introduccion Backup azure
Introduccion Backup azure Introduccion Backup azure
Introduccion Backup azure
 

Similar to SQL Backup to Azure

24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...SpanishPASSVC
 
Backup and Restore SQL Server Databases in Microsoft Azure
Backup and Restore SQL Server Databases in Microsoft AzureBackup and Restore SQL Server Databases in Microsoft Azure
Backup and Restore SQL Server Databases in Microsoft AzureDatavail
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availabilityPeter Gfader
 
005-Business-Continuity-DR-EDM.pptx
005-Business-Continuity-DR-EDM.pptx005-Business-Continuity-DR-EDM.pptx
005-Business-Continuity-DR-EDM.pptxNaradaDilshan
 
Automating Your Azure Environment
Automating Your Azure EnvironmentAutomating Your Azure Environment
Automating Your Azure EnvironmentMichael Collier
 
Instrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaInstrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaMark Leith
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 EditionMark Broadbent
 
Performance Demystified for SQL Server on Azure Virtual Machines
Performance Demystified for SQL Server on Azure Virtual MachinesPerformance Demystified for SQL Server on Azure Virtual Machines
Performance Demystified for SQL Server on Azure Virtual MachinesAmit Banerjee
 
Be05 introduction to sql azure
Be05   introduction to sql azureBe05   introduction to sql azure
Be05 introduction to sql azureDotNetCampus
 
CIAOPS Need to Know Azure Webinar - December 2017
CIAOPS Need to Know Azure Webinar - December 2017CIAOPS Need to Know Azure Webinar - December 2017
CIAOPS Need to Know Azure Webinar - December 2017Robert Crane
 
02_DP_300T00A_Plan_implement.pptx
02_DP_300T00A_Plan_implement.pptx02_DP_300T00A_Plan_implement.pptx
02_DP_300T00A_Plan_implement.pptxKareemBullard1
 
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy ReyesSpanishPASSVC
 
AUSPC 2013 - Business Continuity Management in SharePoint
AUSPC 2013 - Business Continuity Management in SharePointAUSPC 2013 - Business Continuity Management in SharePoint
AUSPC 2013 - Business Continuity Management in SharePointMichael Noel
 
Introduction to SQL Server on RHEL
Introduction to SQL Server on RHELIntroduction to SQL Server on RHEL
Introduction to SQL Server on RHELTakayoshi Tanaka
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKYoungHeon (Roy) Kim
 
Trouble shooting apachecloudstack
Trouble shooting apachecloudstackTrouble shooting apachecloudstack
Trouble shooting apachecloudstackSailaja Sunil
 
SQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesSQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesGuillermo Caicedo
 
Session 2: SQL Server 2012 with Christian Malbeuf
Session 2: SQL Server 2012 with Christian MalbeufSession 2: SQL Server 2012 with Christian Malbeuf
Session 2: SQL Server 2012 with Christian MalbeufCTE Solutions Inc.
 

Similar to SQL Backup to Azure (20)

24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
 
Backup and Restore SQL Server Databases in Microsoft Azure
Backup and Restore SQL Server Databases in Microsoft AzureBackup and Restore SQL Server Databases in Microsoft Azure
Backup and Restore SQL Server Databases in Microsoft Azure
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
005-Business-Continuity-DR-EDM.pptx
005-Business-Continuity-DR-EDM.pptx005-Business-Continuity-DR-EDM.pptx
005-Business-Continuity-DR-EDM.pptx
 
Automating Your Azure Environment
Automating Your Azure EnvironmentAutomating Your Azure Environment
Automating Your Azure Environment
 
Instrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaInstrumenting plugins for Performance Schema
Instrumenting plugins for Performance Schema
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
 
Performance Demystified for SQL Server on Azure Virtual Machines
Performance Demystified for SQL Server on Azure Virtual MachinesPerformance Demystified for SQL Server on Azure Virtual Machines
Performance Demystified for SQL Server on Azure Virtual Machines
 
Be05 introduction to sql azure
Be05   introduction to sql azureBe05   introduction to sql azure
Be05 introduction to sql azure
 
Day2
Day2Day2
Day2
 
CIAOPS Need to Know Azure Webinar - December 2017
CIAOPS Need to Know Azure Webinar - December 2017CIAOPS Need to Know Azure Webinar - December 2017
CIAOPS Need to Know Azure Webinar - December 2017
 
02_DP_300T00A_Plan_implement.pptx
02_DP_300T00A_Plan_implement.pptx02_DP_300T00A_Plan_implement.pptx
02_DP_300T00A_Plan_implement.pptx
 
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
 
AUSPC 2013 - Business Continuity Management in SharePoint
AUSPC 2013 - Business Continuity Management in SharePointAUSPC 2013 - Business Continuity Management in SharePoint
AUSPC 2013 - Business Continuity Management in SharePoint
 
Introduction to SQL Server on RHEL
Introduction to SQL Server on RHELIntroduction to SQL Server on RHEL
Introduction to SQL Server on RHEL
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
Trouble shooting apachecloudstack
Trouble shooting apachecloudstackTrouble shooting apachecloudstack
Trouble shooting apachecloudstack
 
Copy Data Management for the DBA
Copy Data Management for the DBACopy Data Management for the DBA
Copy Data Management for the DBA
 
SQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesSQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud Features
 
Session 2: SQL Server 2012 with Christian Malbeuf
Session 2: SQL Server 2012 with Christian MalbeufSession 2: SQL Server 2012 with Christian Malbeuf
Session 2: SQL Server 2012 with Christian Malbeuf
 

Recently uploaded

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 

SQL Backup to Azure

  • 1. SQL Server Backup to Azure Christian Sanabria J. csanabria@itcr.ac.cr @csanabriaj https://cr.linkedin.com/in/csanabria MCP Office 365, ITILf, Scrum Master csanabria@edublogs.org Preparado con apoyo de: Juan Carlos Gilaranz B. http://www.mundosql.es Microsoft Active Professional 2014 España
  • 3. Patrocinadores del SQL Saturday Premier Sponsor Gold Sponsor Bronze Sponsor
  • 4. Agenda  ¿Qué se requiere?  Azure  SQL Server  Configuración en Azure  Servicio  Datos necesarios  Creación de respaldos:  Respaldar mediante interfaz gráfica  Respaldar mediante T-SQL  Comandos de Powershell  Versiones de SQL Server que no lo soportan. ¿Qué hacer? 5/19/2015 | SQL Backup to Azure4 |
  • 5. ¿Qué NO se trata?  Tipos ni planes de respaldos  Detalles y conceptos de Azure / Servicios, etc.  Respaldos de servicios SQL en máquinas virtuales Azure o Azure SQL Storage  Hablamos de respaldo de SQL on-premises hacia Azure 5/19/2015 | SQL Backup to Azure5 |
  • 6. SQL Backup to Azure  Disponible desde SQL Server 2012 SP1 CU2 como opción adicional  También conocido como “Backup to URL” 5/19/2015 | SQL Backup to Azure6 | Problem As DBAs, we don't only have the responsibility to backup databases on regular basis, but also to ensure that backup drives and tapes are secure so databases can be restored when needed. I heard that SQL Server 2012 supports backups and restores using a Windows Azure Blob Storage account. How does this work and how do I get started? By: Arshad Ali
  • 7. Configuración de Windows Azure https://manage.windowsazure.com Ver: https://www.youtube.com/watch?v=NuVsVCCwLmA 5/19/2015 | SQL Backup to Azure7 |
  • 10. Creación del contenedor dentro del servicio de Storage 5/19/2015 | SQL Backup to Azure10 | Permite listar contenido Se debe conocer la ruta exacta
  • 12. Contenedor 5/19/2015 | SQL Backup to Azure12 | Binary Large Objects (BLOBs)
  • 13. Configuración de SQL Server (on-premises) 5/19/2015 | SQL Backup to Azure13 |  Configurar:  Credencial  Login  Backup  Métodos:  SSMS  T-SQL  Powershell  SMO (Microsoft.SqlServer.Management.Smo)
  • 14. Se debe configurar  1. Credencial para acceso al Storage en Azure 5/19/2015 | Footer Goes Here14 |
  • 15. Se debe configurar 5/19/2015 | Footer Goes Here15 | Login para respaldos
  • 16. Permisos  Permissions  BACKUP DATABASE and BACKUP LOG permissions default to members of the sysadmin fixed server role and the db_owner and db_backupoperator fixed database roles. https://msdn.microsoft.com/en-us/library/ms186865.aspx
  • 18. Finalmente 5/19/2015 | Footer Goes Here18 | 19 percent processed. 39 percent processed. 59 percent processed. 72 percent processed. 84 percent processed. 93 percent processed. Processed 648 pages for database 'BDDemoPASS', file 'BDDemoPASS' on file 1. 100 percent processed. Processed 2 pages for database 'BDDemoPASS', file 'BDDemoPASS_log' on file 1. BACKUP DATABASE successfully processed 650 pages in 11.725 seconds (0.433 MB/sec). SSMS T-SQL
  • 19. Backup – T-SQL BACKUP DATABASE [ProductInfoSPA] TO URL = N'https://sqlbackuptec.blob.core.windows.net/sqlbacku pazure1/ProductInfoSPA_backup_2015_04_06_11320 8.bak' WITH CREDENTIAL = N'SQLBackup2AzureCred' , DESCRIPTION = N'Demo SQL PASS 2015', NOFORMAT, NOINIT, NAME = N'ProductInfoSPA-Full Database Backup', NOSKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10 GO 5/19/2015 | Footer Goes Here19 |
  • 20. Restore – SSMS (2014) 5/19/2015 | Footer Goes Here20 |
  • 21. Restore – SSMS (2014)  Main Text / Bullets Here, Gray, 30 pt.  Main Text / Bullets Here, Gray, 30 pt.  Bullet Points, Line 2, 26 pt.  Bullet Points, Line 3, 22 pt.  Bullet Points, Line 4, 20 pt. 5/19/2015 | Footer Goes Here21 |
  • 22. Restore – T-SQL  USE [master]  ALTER DATABASE [ProductInfoSPA] SET SINGLE_USER WITH ROLLBACK IMMEDIATE  BACKUP LOG [ProductInfoSPA] TO URL = N'https://sqlbackuptec.blob.core.windows.net/sqlbackupazure1/ProductInfoSPA_LogBackup_2015 -04-06_16-24-57.bak' WITH CREDENTIAL = N'SQLBackup2AzureCred' , NOFORMAT, NOINIT, NAME = N'ProductInfoSPA_LogBackup_2015-04-06_16-24-57', NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY , STATS = 5  RESTORE DATABASE [ProductInfoSPA] FROM URL = N'https://sqlbackuptec.blob.core.windows.net/sqlbackupazure1/ProductInfoSPA_backup_2015_04 _06_113208.bak' WITH CREDENTIAL = N'SQLBackup2AzureCred' , FILE = 1, NORECOVERY, NOUNLOAD, REPLACE, STATS = 5  RESTORE LOG [ProductInfoSPA] FROM URL = N'https://sqlbackuptec.blob.core.windows.net/sqlbackupazure1/ProductInfoSPA_LogBackup_2015 -04-06_16-21-51.bak' WITH CREDENTIAL = N'SQLBackup2AzureCred' , FILE = 1, NOUNLOAD, STATS = 5  ALTER DATABASE [ProductInfoSPA] SET MULTI_USER  GO 5/19/2015 | Footer Goes Here22 |
  • 24. Respaldo y restauración con Azure usando PowerShell 5/19/2015 | Footer Goes Here24 | import-module sqlps # definir variables $storageAccount = "mystorageaccount" $storageKey = "<storageaccesskeyvalue>" $secureString = convertto-securestring $storageKey -asplaintext -force $credentialName = "mybackuptoURL" #cd to computer level cd sqlserver:sqlCOMPUTERNAME # get the list of instances $instances = Get-childitem #pipe the instances to new-sqlcredentail cmdlet to create SQL credential $instances | new-sqlcredential -Name $credentialName -Identity $storageAccount -Secret $secureString Powershell – crear credencial
  • 25. Respaldo y restauración con Azure usando SMO http://www.mssqltips.com/sqlservertip/3054/bac kup-and-restore-sql-server-databases-with- azure-cloud-services-and-smo/ 5/19/2015 | Footer Goes Here25 | SMO: SQL Server Management Objects (Microsoft.SqlServer.Management.Smo) Programming Guide https://msdn.microsoft.com/en-us/library/ms162169.aspx
  • 26. Referencias y código C# 5/19/2015 | Footer Goes Here26 |
  • 27. SMO – C# - BackupDatabase 5/19/2015 | Footer Goes Here27 |
  • 28. SMO – C# - RestoreDatabase
  • 29. Versiones de SQL Server que no lo soportan ¿Qué hacer?  SQL Backup to Azure Tool  Antes de SQL 2012 SP1  Configuración similar  Mismos datos  Se basa en reglas:  Carpetas  Tipos de archivo  Permite:  Compresión  Distintos tipos de encripción  Está en:  http://www.microsoft.com/en-us/download/details.aspx?id=40740  Video de forma de uso en:  https://www.youtube.com/watch?v=5epRBcwEz00 5/19/2015 | Footer Goes Here29 |
  • 30. Configuración – agregar regla 5/19/2015 | Footer Goes Here30 |
  • 31. Configuración - Ruta y patrón 5/19/2015 | Footer Goes Here31 |
  • 32. Configuración – Storage y contenedor 5/19/2015 | Footer Goes Here32 |
  • 33. Configuración – cifrado y compresión 5/19/2015 | Footer Goes Here33 |
  • 35. Mejores prácticas  Usar nombres únicos para identificar cada backup fecha/hora/bd/servidor  Definir el acceso al contenedor como private  Utilizar la misma región para mejorar rendimiento y manejar costos (*)  Monitorear constantemente el fallo/éxito de las operaciones si se automatiza  Usar la opción WITH COMPRESSION para minimizar los costos de storage y el tiempo  Usar encripción (*)  Hacer pruebas de tiempo de respaldo y recuperación  Revisar los SLA’s de Azure(http://www.microsoft.com/en- us/download/details.aspx?id=6656) https://msdn.microsoft.com/en-us/library/jj919149.aspx 5/19/2015 | Footer Goes Here35 |
  • 36. ¿Cómo adapto mi plan de respaldos?
  • 38. Gracias!  PASS  PASS LATAM  PASS CR Chapter 5/19/2015 | Footer Goes Here38 | Todos ustedes!!!
  • 40. Estructura del Storage en Azure 5/19/2015 | Footer Goes Here40 |
  • 41. Tail-log backup (respaldo del log)  A tail-log backup is a transaction log backup that includes the portion of the log that has not previously been backed up (known as the active portion of the log). A tail-log backup does not truncate the log and is generally used when the data files for a database have become inaccessible but the log file is undamaged. 5/19/2015 | Footer Goes Here41 |
  • 42. Error de master key decryption
  • 43. Respaldo FULL (incluyendo BD’s del sistema)  This includes both user databases and msdb system database. The script filters out tempdb and model system databases. 5/19/2015 | Footer Goes Here43 | import-module sqlps # set the parameter values $storageAccount = "mystorageaccount" $blobContainer = "privatecontainertest" $backupUrlContainer = "https://$storageAccount.blob.core.windows.net/$blobContainer/" $credentialName = "mybackuptoURL" # cd to computer level cd SQLServer:SQLCOMPUTERNAME $instances = Get-childitem # loop through each instances and backup up all the databases -filter out tempdb and model databases foreach ($instance in $instances) { $path = "sqlserver:sql$($instance.name)databases" $alldatabases = get-childitem -Force -path $path | Where-object {$_.name -ne "tempdb" -and $_.name -ne "model"} $alldatabases | Backup-SqlDatabase -BackupContainer $backupUrlContainer -SqlCredential $credentialName -Compression On -script } Referencia: https://msdn.microsoft.com/en-us/library/dn223322.aspx
  • 44. Full Database Backup for ALL User Databases import-module sqlps $storageAccount = "mystorageaccount" $blobContainer = "privatecontainertest" $backupUrlContainer = "https://$storageAccount.blob.core.windows.net/$blobContainer/" $credentialName = "mybackuptoURL" # cd to computer level cd SQLServer:SQLCOMPUTERNAME $instances = Get-childitem # loop through each instances and backup up all the user databases foreach ($instance in $instances) { $databases = dir "sqlserver:sql$($instance.name)databases" $databases | Backup-SqlDatabase -BackupContainer $backupUrlContainer -SqlCredential $credentialName -Compression On } 5/19/2015 | Footer Goes Here44 |
  • 45. Full Database Backup for MASTER and MSDB (SYSTEM DATABASES) On All the Instances of SQL Server The following script can be used to back up master and msdb databases on all the instances of SQL Server installed on the computer. import-module sqlps $storageAccount = "mystorageaccount" $blobContainer = "privatecontainertest" $backupUrlContainer = "https://$storageAccount.blob.core.windows.net/$blobContainer/" $credentialName = "mybackupToUrl" $sysDbs = "master", "msdb" #cd to computer level cd sqlserver:sqlCOMPUTERNAME $instances = Get-childitem foreach ($instance in $instances) { foreach ($s in $sysdbs) { Backup-SqlDatabase -Database $s -path "sqlserver:sql$($instance.name)" -BackupContainer $backupUrlContainer -SqlCredential $credentialName - Compression On } } 5/19/2015 | Footer Goes Here45 |
  • 46. Ejemplo de script Powershell $db = $svr.Databases['AdventureWorks'] $dbname = $db.Name $dt = get-date -format yyyyMMddHHmmss $dbbk = new-object ('Microsoft.SqlServer.Management.Smo.Backup') $dbbk.Action = 'Database' $dbbk.BackupSetDescription = "Full backup of " + $dbname $dbbk.BackupSetName = $dbname + " Backup" $dbbk.Database = $dbname $dbbk.MediaDescription = "Disk" $dbbk.Devices.AddDevice($bdir + "" + $dbname + "_db_" + $dt + ".bak", 'File') $dbbk.SqlBackup($svr) 5/19/2015 | Footer Goes Here46 |
  • 47. Uso del Cmdlet Backup-SqlDatabase  $svnm = $svr.Name  $db = $svr.Databases['AdventureWorks']  $dbname = $db.Name  $dt = get-date -format yyyyMMddHHmmss  $bfil = "$bdir$($dbname)_db_$($dt).bak"  Backup-SqlDatabase -ServerInstance $svnm - Database $dbname -BackupFile $bfil 5/19/2015 | Footer Goes Here47 | http://sqlmag.com/powershell/powershell-lets-you-back-sql-server-your-way