Thursday, December 05, 2019

Data Platform Tips 19 - What are DTUs on Azure SQL Database?

DTU (Database Transaction Unit) is a blended measure of CPU, memory, reads and writes. It provides a pre-configured capacity for a specific price for every month.

DTU model is available for Azure SQL Databases and not for managed instances.

It is always better to start with low DTUs if you are not sure about the capacity as Azure allows you to increase the DTUs based on your loads.

To migrate on-premises sql server to Azure and to calculate the required DTUs, use the DTU Calculator.

Wednesday, December 04, 2019

Data Platform Tips 18 - Automatic Tuning on Azure SQL Database

Azure SQL Database provides automatic tuning capabilities to monitor your server as well as database. The performance recommendations from Azure can be applied manually or automatically.

To enable Automatic Tuning on Azure SQL Database,

a) Logon to the Azure Portal, steps a) and b) for creation of resource group and Azure SQL Database.

b) Navigate to the "sampledb" under "AAD-SQL" resource group and click on "Automatic Tuning".














c) You can turn on automatic tuning at server level or database level.












d) You can turn on the automatic tuning options for Force Plan, Create Index and Drop Index.











Note: Drop Index is not compatible with application using partition switching and index hints.












e) Going forward, you will be recommended for any new indexes to be created or dropping any existing indexes based on the queries that are executed on the database.

Tuesday, December 03, 2019

Data Platform Tips 17 - Restore database on Azure using automated backups

Azure SQL Database allows you to restore database from Point-in-time-restore backups or Long-term backups. The backups can be restored to

a) New database on same database server
b) New database on any database server in the same region
c) New database on any database server in any other region

Restore Database on Azure Portal

a) Log on to the Azure Portal. steps a) and b) for creation of resource group and Azure SQL Database.

b) Navigate to the "sampledb" under "AAD-SQL" resource group and click on "Restore".









c) Restore database from Point-in-time backups. In this scenario, you will be restoring the database to a different database within the same server.

























d) Once the restore is complete, you can see the new database as shown below.








e) Restore database from long-term backup retention as shown below.

























Monday, December 02, 2019

Data Platform Tips 16 - Backing up an Azure SQL Database

Database backups are really important for every organisation for Business Continuity and Disaster Recovery scenarios.

Azure SQL Databases are backup automatically and they are kept between 7 and 35 days. Point-in-time restore is a self-service capability allowing organisations to restore a database from the backups (Full, Differential and Transaction Log) that are created automatically. These automatic backups are part of Azure SQL Database service. The storage for the automatic backups cannot be changed or copied to a different storage account as they are managed by Azure.

If the backups needs to be retained for a longer duration then long term retention for the backups needs to be configured.

The first full backup is immediately created after the database is created. After the full backup, all further backups are scheduled automatically.

Full Database Backups
Differential Backups
Transactional Log Backups
Every Week
Every 12 hours
Every 5 to 10 minutes

a) Log on to the Azure Portal. steps a) and b) for creation of resource group and Azure SQL Database.

b)Navigate to the "sampledb" under the "AAD-SQL" resource group and click on "Manage Backups" to check the Backup Policies.










c) The default Backup Retention can be changed to manage backups for longer terms using "Configure Retention" policy.















d) Here is the modified Retention policy.









e) You can see the available backups under the "Available backups" section.

Sunday, December 01, 2019

Data Platform Tips 15 - Advanced Data Security on Azure SQL Database

Advanced Data Security (ADS) on Azure SQL Database provides advanced security capabilities to detect threats and protects them. ADS includes the following components.

  • Data Discovery & Classification
  • Vulnerability Assessment
  • Advanced Threat Protection

Data Discovery & Classification provides abilities to discover, classify, label and protect sensitive data on your Azure SQL Database. The classification can be either automated or manually created.

Vulnerability Assessment allows you to discover, track and resolve any database vulnerabilities on your Azure SQL Database.

Advanced Threat Protection monitors and detects anomaly activities, SQL injection attacks and potential vulnerabilities on your Azure SQL Database and immediately raises alerts to address them.

a) Logon to the Azure Portal. Refer steps a) and b) for creation of resource group and Azure SQL Database.

b) Navigate to the "sampledb" under the "AAD-SQL" resource group and click on "Advanced data security" and enable it.















c) Once you enable "Advanced Threat Protection", you can see the three components enabled.












Note: In this scenario, we are enabling Advanced Data Security on the server level which means it will be enabled on all Azure SQL Databases within the server.

d) Advanced Data Security can be enabled at the Database level by selecting the database and clicking on "Advanced Data Security" and "Settings".













e) Now you can enable "Advanced Data Security" at Database level as shown below.



















f) Now you choose the different vulnerability types you need to monitor at the database level, assign a storage account and assign the email address where the alerts needs to be sent and save the settings.




















g) Now you have successfully enabled Azure Data Security both on the server as well as the Database level. Turning it on at Database level is really handy if you need to be notified on specific vulnerabilities at the database level.