Showing posts with label DP-300 Administering Microsoft Azure SQL Solutions. Show all posts
Showing posts with label DP-300 Administering Microsoft Azure SQL Solutions. Show all posts

Saturday, April 5, 2025

Exam DP-300: Administering Microsoft Azure SQL Solutions Part -2


 1) You need to recommend a high-availability and disaster recovery (HA/DR) strategy for a SQL Server on Azure Virtual Machines instance. The solution must meet the following requirements:

  • All databases, including system databases, must be protected.
  • SQL Server Agent jobs must be protected.
  • Downtime must be minimized.
  • The failover process must be done automatically.

What should you include in the recommendation?


       a. an Always On availability group

       b. an Always On failover cluster instance

       c. log shipping

       d. transactional replication


You should recommend an Always On failover cluster instance because this feature protects the entire instance. A SQL Server on Azure Virtual Machines instance is the entire installation of Microsoft SQL Server, such as binaries and all the objects inside the instance, including logins, SQL Server Agent jobs, and databases. Instance-level protection means that the entire instance is accounted for in the availability feature.

An Always On availability group works at the database level rather than the instance level. Transactional replication cannot replicate system databases, and neither transactional replication nor log shipping allow you to perform automatic failover.




 2) You have an Azure SQL Database named db1.

You need to configure a backup strategy to ensure that the db1 has backups retained for six years.

What should you configure?


       a. differential backup frequency

       b. long-term retention

       c. point-in-time-restore


A long-term retention policy allows you to specify how many weeks, months, and years a backup should be kept. The maximum time is 10 years.

A point-in-time-restore policy only allow you to keep backups for 35 days, and a differential backup frequency policy specifies how often you want differential backup to be taken.

Back up and restore databases - Training | Microsoft Learn

Azure SQL Database: Manage long-term backup retention - Azure SQL Database | Microsoft Learn


 3) You have an Azure SQL Database.

You need to configure high availability for the database in the event of a regional outage.

Which two features can you use? Each correct answer presents a complete solution.


       a. active geo-replication

       b. Always On availability groups

       c. auto-failover groups

       d. long-term backup retention


Active geo-replication creates a secondary database replica in another region that is asynchronously kept up-to-date, and the auto-failover groups feature allows you to manage the replication and failover of some or all databases on a logical server to another region.

The Always On availability groups feature is a high-availability and disaster recovery (HA/DR) solution, but it is not used for Azure SQL Database. Long-term backup retention stores database backups in Azure Blob storage.

Describe active geo-replication for Azure SQL Database - Training | Microsoft Learn


 4) You have an Azure SQL Managed Instance that hosts five databases.

You need to configure disaster recovery for the databases in the event of a regional outage.

What can you use?


       a. active geo-replication

       b. Always On availability groups

       c. auto-failover groups

       d. long-term backup retention


The auto-failover groups feature allows you to manage the replication and failover of some or all databases on a logical server to another region, which allows you to configure high availability in the event of a regional outage.

Active geo-replication creates a secondary database replica in another region, but it is asynchronously kept up-to-date for Azure SQL Database. The Always On availability groups feature is a high-availability and disaster recovery (HA/DR) solution, but it is not for Azure SQL Database. Long-term backup retention stores database backups in Azure Blob storage.


5) You have an Azure subscription that contains four virtual machines. All the virtual machines have Microsoft SQL Server 2019 installed.

A distributed availability group named DG1 has a replica on each virtual machine.

You need to enable monitoring for DG1. The solution must help diagnose performance issues.

What should you use?


       a. SQL Database Advisor

       b. Query Performance Insight

       c. Azure SQL Insights


Azure SQL Insights is a comprehensive solution for monitoring any product in the Azure SQL family.

Query Performance Insight provides intelligent query analysis for single and pooled databases but cannot provide information about a distributed availability group.

SQL Database Advisor provides performance recommendations but cannot provide information about a distributed availability group.




6) You have an Azure subscription that contains five virtual machines. The virtual machines host a Microsoft SQL Server 2019 Always On availability group named AG1.

You need to enable monitoring for AG1. The solution must ensure that you can monitor the health of AG1 and diagnose performance issues.

What should you use?


       a. Intelligent Insights

       b. Query Performance Insight

       c. SQL Database Advisors

       d. SQL Insights


SQL Insights is a comprehensive solution for monitoring any product in the Azure SQL family. As such, it allows you to monitor the health of AG1 and diagnose any performance issues.

Query Performance Insight provides intelligent query analysis for single and pooled databases, SQL Database Advisor provides performance recommendations, and Intelligent Insights uses built-in intelligence to continuously monitor database usage through artificial intelligence (AI) and detect disruptive events that cause poor performance.

Azure SQL Database and Azure SQL Managed Instance monitoring and tuning documentation - Azure SQL | Microsoft Learn

Explore IaaS and PaaS solutions for high availability and disaster recovery - Training | Microsoft Learn


7) You have an Azure subscription.

You plan to deploy 100 Azure SQL Databases.

You need to automate the deployment. The solution must be parameterizable, repeatable, and be able to be versioned in source control.

Which three components can you use? Each correct answer presents a complete solution.


  • Azure Cloud Shell
  • Azure Policy
  • Azure PowerShell scripts
  • Azure Resource Manager (ARM) templates
  • Bicep templates

ARM templates, Bicep templates, and PowerShell scripts can all be parameterized and versioned.

Cloud Shell is an interactive, authenticated, browser-accessible shell, and Azure Policy helps to enforce organizational standards and to assess compliance at-scale.

Automate deployment by using Azure Resource Manager templates and Bicep - Training | Microsoft Learn



8) You have an Azure subscription. The subscription contains several Azure SQL Databases that support departmental applications. You plan to use elastic jobs to periodically execute T-SQL-based maintenance tasks against all the databases. 

What should you do first? 

  • Create an Azure SQL Database.
  • Create an Azure SQL elastic pool server.
  • Create an Elastic Job agent.
  • Create the Elastic Job targets.


You need to create an Azure SQL Database to keep the elastic job configuration.

The Elastic Job agent can be configured once the database and the elastic job configuration is prepared.

You cannot create Elastic Job targets until you have an agent.

You do not need to create an elastic pool server for this task. 

Job automation overview with Elastic Jobs - Azure SQL Database | Microsoft Learn


9) You have an on-premises Microsoft SQL Server 2016 instance that uses FileTable.

You need to migrate the instance to Azure. The solution must support the existing application code.

What should you use?


       a. Azure SQL Database HyperScale

       b. Azure SQL Database serverless

       c. Azure SQL Managed Instance

       d. SQL Server on Azure Virtual Machines


SQL Server on Azure Virtual Machines supports FileTable. It can be used to migrate the instance to Azure and support the existing application code.

Azure SQL Database serverless and Azure SQL Database Hyperscale are tiers of Azure SQL Database that do not support FileTable. Azure SQL Managed Instance does not support FileTable.

Explore Azure SQL Database Managed Instance - Training | Microsoft Learn

Compare the database engine features of SQL Database and SQL Managed Instance - Azure SQL Database & SQL Managed Instance | Microsoft Learn


10) You have a fact table that contains 500 million rows. The table has a clustered index. Most queries select data from the current week and rarely select data that is more than a month old.

Queries against the table are very slow.

You need to recommend a solution that will improve the performance of the majority of the queries against the table.

What should you include in the recommendation?

       a. an in-memory table

       b. page compression

       c. row compression

       d. table partitioning

The data of partitioned tables and indexes are divided into units that might be spread across more than one filegroup in a database or stored in a single filegroup. The partition that contains the most current data does not block any queries that are related to old data, so this will benefit the performance.

Row and page compression changes the internal table storage, but it does not help solve the performance issues. The in-memory table is best for transactional workloads, and the fact table is the analytical workload.

Deploy IaaS solutions with Azure SQL - Training | Microsoft Learn 

Partitioned tables and indexes - SQL Server, Azure SQL Database, Azure SQL Managed Instance | Microsoft Learn


11) You have several databases in an Azure SQL Managed Instance that uses the General Purpose vCore service tier.

You discover high latency in some of the database files.

What should you do to reduce latency?


       a. Add more files to the database.

       b. Add more virtual cores to the instance.

       c. Increase the file size.

       d. Change the service tier.


You should increase the file size to improve performance. If you have a file that is up to 128 GB, then you can have up to 500 IOPS. If you change the file size to 1 TB, then you can have up to 5,000 IOPS. 

You should not add more vCores to the instance in the General Purpose tier, as this will not change the available IOPS. Adding more files to the database also does not help, as the number of available IOPS is calculated per file size, not by the number of files. Changing the service tier will change the type of CPU, the maximum file size, and the amount of memory reserved per CPU. 


12) You are planning a migration from on-premises Microsoft SQL Server to Azure using Azure Database Migration Service.

You need to keep databases online during the migration.

Which two services can you use? Each correct answer presents a complete solution.

  •  Azure Cosmos DB
  • Azure SQL Database
  • Azure SQL Managed Instance
  • SQL Server on Azure Virtual Machines

SQL Server on Azure Virtual Machines and Azure SQL Managed Instance both support online migration. 

Azure SQL Database does not support online migration and Azure CosmosDB is not a relational database. 


13) You have an on-premises Microsoft SQL Server 2019 instance that hosts 10 databases.

You plan to migrate the databases to Azure SQL Database.

You need to validate the compatibility of the databases with Azure SQL Database.

Which two tools can you use? Each correct answer presents a complete solution.

 

  • App and Data Modernization Readiness Tool
  • Data Migration Assistant (DMA)
  • Microsoft Assessment and Planning (MAP) Toolkit for SQL Server
  • the Azure Migrate Discovery and assessment tool
  • the SQL Server Management Studio (SSMS) Copy Database Wizard

DMA will assess the database for compatibility. The Azure Migrate Discovery and assessment tool discovers and assesses on-premises VMware virtual machines, Hyper-V virtual machines, and physical servers for migration to Azure.

The MAP toolkit provides an inventory of the Microsoft Platform. The Copy Database Wizard is used for copying databases. The App and Data Modernization Readiness Tool is used to help customers evaluate their business strategies.





14) You plan to configure Extended Events monitoring to gather information about queries.

You need to add information about the session_id to all events.

What should you configure for the extended event session?

       a. action

       b. package

       c. predicate

       d. target


An action is a programmatic response or series of responses to an event. Actions are bound to an event, and each event may have a unique set of actions. Actions are global fields. Configuring an action allows you to add the required information to all events.

Targets process events, predicates are a set of logical rules used to evaluate events when they are processed, and a package is a container for Microsoft SQL Server Extended Events objects.



15) You have an Azure SQL Database.

Users report poor performance of the database overnight.

You need to identify the cause of the performance issue.

What should you do?

       a. Query the sys.dm_exec_requests dynamic management view.

       b. Use Auditing for Azure SQL Database to investigate.

       c. Use Query Store to investigate the metrics.

       d. Use SQL Server Profiler to gather a trace.


Using Query Store will enable a historical investigation, which will allow you to look at the metrics to identify the cause of the poor performance.

sys.dm_exec_requests returns information about currently running requests, but it does not allow you to look into past performance issues. Auditing for Azure SQL Database tracks database events. A SQL Server Profile trace will gather information about current activity, but it does not allow you to do a historical investigation of the issue.


16) You have an Azure SQL Database.

You need to troubleshoot blocking and deadlocking performance issues.

Which two features can you use? Each correct answer presents a complete solution.

  • an Azure SQL Database ledger
  • Extended Events
  • Microsoft Defender for SQL
  • Query Store
  • SQL Insights
Extended Events and SQL Insights can both capture blocking and deadlocking metrics that can be used to investigate and troubleshoot the performance issues.

Query Store does not capture blocking and deadlocking metrics, Azure SQL Defender surfaces database vulnerabilities, and an Azure SQL Database ledger incrementally captures the state of the database.

17) You have an Azure subscription that contains five Azure SQL Databases.

You need to configure SQL Insights.

What should you do first?

       a. Configure automatic tuning.

       b. Configure Extended Events.

       c. Create a monitoring profile.

       d. Enable Azure SQL Auditing.


Creating a monitoring profile is the first requirement to configuring SQL Insights.

Automatic tuning uses AI to provide peak performance. Azure SQL Auditing tracks database events and records them. Extended Events is a lightweight performance monitoring system.



18) You have an Azure SQL Managed Instance.

You discover a high number of blocking queries during peak business hours.

You need to investigate the root cause of the blocking queries.

Which two dynamic management views should you query? Each correct answer presents a complete solution.
  • sys.dm_exec_query_stats
  • sys.dm_exec_requests
  • sys.dm_exec_sessions_wait_stats
  • sys.dm_os_waiting_tasks
You should query the sys.dm_exec_requests view to get the blocking session ID information. This view returns information about each request that is executing in Microsoft SQL Server. You should also use sys.dm_os_waiting_tasks because the information is related to current connections and sessions. There is blocking session ID information that can be used to identify the root of the issue.

The sys.dm_exec_sessions_wait_stats view presents historical information about the waits that occurred on the server, and the sys.dm_exec_query_stats view returns aggregate performance statistics for cached query plans in SQL Server.



19) You have an Azure SQL Managed Instance that contains databases.

One of the databases experiences excessive blocking.

You need to identify which session is causing the blocking.

Which dynamic management view should you query?

       a. sys.dm_exec_query_stats

       b. sys.dm_exec_requests

       c. sys.dm_exec_session_wait_stats

       d. sys.dm_exec_sessions


sys.dm_exec_requests returns information about each request that is executing in Microsoft SQL Server. One of the columns exposed by this view is blocking_session_id.

sys.dm_exec_sessions returns one row per authenticated session in SQL Server. This view does not return information about blocking issues.

sys.dm_exec_query_stats returns aggregate performance statistics for cached plans in SQL Server.

sys.dm_exec_session_waits returns information about all the waits encountered by threads that are executed for each session.


20) You run the DBCC CHECKDB command for a production database. The command shows errors in several nonclustered indexes.

You need to repair the indexes and ensure the integrity of the database after the operation has complete.

Which parameter should you specify in the DBCC CHECKDB command?

       a. REPAIR_ALLOW_DATA_LOSS

       b. REPAIR_REBUILD

       c. REPAIR_FAST


Adding the REPAIR_REBUILD option to the DBCC CHECKDB command performs repairs that have no possibility of data loss. This option may include quick repairs, such as repairing missing rows in nonclustered indexes, and more time-consuming repairs, such as rebuilding an index.

The REPAIR_FAST option maintains syntax for backward compatibility only. No repair actions are performed. The REPAIR_ALLOW_DATA_LOSS option can introduce some data loss in the database.



21) You have an Azure SQL Database named db1.

You need to provide access to db1 for a Microsoft Entra ID user .

What should you do?

       a. In db1, run the CREATE USER statement with the FROM LOGIN option.

       b. In db1, run the CREATE USER statement with the FROM EXTERNAL PROVIDER option.

       c. In the master database, run the CREATE LOGIN statement with the FROM EXTERNAL PROVIDER option.

       d. In the master database, run the CREATE LOGIN statement with the WITH PASSWORD option.



22) You have an Azure SQL Database logical server named Instance1.

You create a user named User1 in the master database of Instance1.

You need to ensure that User1 can create and delete databases attached to Instance1. The solution must follow the principle of least privilege.

Which role should you assign to User1?

       a. db_ddladmin

       b. dbmanager

       c. db_owner

       d. loginmanager


Members of the dbmanager role can create databases.

Members of the db_owner role can perform all activities at the database level.

Members of the db_ddladmin role can run any DDL statements.

Members of the loginmanager can create and delete logins.



23) You create a stored procedure that runs dynamic SQL code to select data from a table named Sales.

All users have execute permissions to the stored procedure.

What should you do to ensure that the users can run the procedure without errors?


       a. Add a WITH RECOMPILE clause to the stored procedure.

       b. Add the SELECT permission to the Sales table for the users.

       c. Add an EXECUTE AS [owner] clause to the stored procedure.


You should add the SELECT permission to the Sales table because executing dynamic SQL code requires that the caller has all the necessary permissions to the objects that are called in the code.

Using the EXECUTE AS [owner] clause or the WITH RECOMPILE clause does not ensure that the caller has all the necessary permissions to the objects that are called in the code.

EXECUTE AS (Transact-SQL) - SQL Server | Microsoft Learn

Configure database authentication and authorization - Training | Microsoft Learn


24) You have an Azure SQL Database named db1 that contains a table named Sales.

You need to encrypt data in a column named CreditCard in the Sales table.

Which two actions should you perform before you can encrypt the data? Each correct answer presents part of the solution.

       a. Create a certificate in the db1 database.

       b. Create a certificate in the master database.

       c. Create a symmetric key encrypted by a certificate.

       d. Create an asymmetric key encrypted by a certificate.


The certificate created in db1 will be used to encrypt a symmetric key, which, in turn, will be used to protect data in the CreditCard column in the Sales table. The column containing encrypted data must be varbinary column.

A symmetric key, not an asymmetric key, is required for this operation. Creating the certificate in the master database would not work, as the certificate that is needed for encryption must be created in the user database.


25) You have an Azure SQL managed instance Azure SQL Managed Instance that hosts a database.

The database contains a column named Column1 that stores confidential information.

You need to audit access to Column1. The solution must meet the following requirements:

Retain audit data for at least eighteen years.

Minimize administrative effort.

Which three actions should you perform? Each correct answer presents part of the solution.

  • Apply a sensitivity classification to the column.
  • Configure a Log Analytics audit log destination.
  • Configure a Storage audit log destination.
  • Enable Always Encrypted for the column.
  • Enable Azure SQL Auditing.
  • Enable Transparent Data Encryption (TDE).

Azure SQL Auditing needs to be enabled to monitor access. A storage account allows unlimited retention. The column needs a classification label so that access is audited.

Log Analytics has a maximum retention limit of seven years, Always Encrypted is used to protect data in use or in transit, and TDE encrypts data files.


26) You 

Friday, April 4, 2025

Exam DP-300: Administering Microsoft Azure SQL Solutions Part-1


1) You have an Azure SQL Database named db1 and a Microsoft Entra group named db_readers.

You need to ensure that the members of db_readers can read data from db1. The solution must follow the principle of least privilege.

Which two actions should you perform? Each correct answer presents part of the solution.

  • Assign the db_accessadmin role to the user in the master database.
  • Assign the db_datareader role to the user in db1.
  • Assign the db_datareader role to the user in the master database.
  • Assign the db_denydatawriter role to the user in db1.
  • Create a user in the db1 database for db_readers.
  • Create a login and a user in the master database for db_readers.


You need to create a contained database user in the db1 database. The user must be assigned the db_datareader role for db1 to be able to read the data.

You should not create a user in the master database.

You should not assign the db_accessadmin role to the user because this role allows you to manage security assignments for other roles.

You should not assign the db_datareader role to the user for the master database because the user must read data from db1.

You should not assign the db_denydatawriter role to the user for db1 because this role prevents data changes in the database but is unrelated to data selection.



2) You have an app that stores data for multiple tenants using Azure SQL Database elastic pools. Each tenant has a database.

You need to configure an authentication solution for the app. The solution must meet the following requirements:

Ensure that users can only access the database of their respective tenant.

Ensure databases can be moved to a dedicated instance.

Minimize administrative effort.

What should you include in the solution?


    a. contained database users

    b. database roles

    c. server roles


Contained database users enable databases to be moved without recreating logins.

Server roles manage permissions at the server level only, and database roles manage permissions within a database.

Configure database authentication and authorization - Training | Microsoft Learn

Contained user access to contained databases - SQL Server | Microsoft Learn


3) You have an Azure SQL server that hosts 10 Azure SQL Databases.

You create an app named App1 with a system assigned managed identity.

You need to ensure that App1 has read access to each database.

Which three actions should you perform? Each correct answer presents part of the solution.


  • Assign the database user the db_reader role for each database.
  • Assign the database user the db_reader role for the master database.
  • Create a login for App1 from an external provider.
  • Create a login for App1 that uses Windows authentication.
  • Create a user in each database for the App1 login.
  • Create a user in the master database for the App1 login.


A managed identity requires that a login be created from an external provider, each database requires a user for the login, and assigning the database user the db_reader role for each database will allow read access to the user databases.

A managed identity cannot use Windows authentication. The app does not require a user in the master database and assigning the database user the db_reader role for the master database will allow the user read access to the master database, but not read access to the user databases.

Describe Security Principals - Training | Microsoft Learn


4) You have an Azure SQL Database named db1.

You create a user named User1 in the master database.

You need to ensure that User1 can create databases. The solution must follow the principle of least privilege.

Which role should you assign to User1?


       a. db_ddladmin

       b. dbmanager

       c. db_owner

       d. loginmanager


You should assign dbmanager, as members of this role can create databases.

Members of the loginmanager role can create and delete users, but they cannot create databases. Members of the db_ddladmin role can run any DDL statements. Members of the db_owner role can perform all activities at the database scope.


Configure database authentication and authorization - Training | Microsoft Learn

Data partitioning strategies - Azure Architecture Center | Microsoft Learn


5) You have a database named db1 in an Azure SQL Managed Instance named Instance1.

You need to encrypt db1 by using Transparent Data Encryption (TDE).

Which three actions should you perform before you can start the encryption? Each correct answer present part of the solution.


  • Create a certificate in db1.
  • Create a certificate in the master database.
  • Create a database encryption key in db1.
  • Create a master key in the master database.
  • Create a symmetric key in db1.


The procedure of preparing the database to use TDE is first to create a master key and a certificate in the master database, and then to create a database encryption key in the db1.

You should not create a certificate or an asymmetric key in db1, as TDE can only use certificates created in the master database.

Transparent data encryption (TDE) - SQL Server | Microsoft Learn

Protect data in-transit and at rest - Training | Microsoft Learn



6) You have an Azure SQL Database named db1.

You need to ensure that all the data in db1 is encrypted at rest.

What should you use?


       a. Always Encrypted

       b. Transparent Data Encryption (TDE)

       c. SQL Server auditing

       d. Microsoft Defender for SQL


TDE is the Azure SQL Database feature that encrypts data at rest. All the data saved to a disk is encrypted.

Auditing is not used for performing data encryption at rest, it is used for gathering diagnostic information.

Defender for SQL is used to mitigate potential database vulnerabilities and detect anomalous activities.

Always Encrypted protects data that is in use or in transit.

Explore Transparent Data Encryption - Training | Microsoft Learn


7) In an Azure SQL Database, you have a table that contains a column named Column1. Column1 stores credit card CVV data.
You need to configure Column1 to meet the following requirements:
The data in the column must be protected at rest.
The data in the column must be protected when in use.
Database administrators must be prevented from viewing the contents of Column1.
Which two features can you use? Each correct answer presents a complete solution.

  • Always Encrypted Deterministic encryption
  • Always Encrypted Randomized encryption
  • Column-level SQL Server encryption using symmetric keys
  • dynamic data masking
You should use Always Encrypted (Randomized encryption or Deterministic encryption), because this ensures that the administrators are unable to view and decrypt data.
Encryption with symmetric keys will allow the administrators to access the data. Dynamic data masking does not protect data at rest or in use.



8) You have an Azure SQL Database named db1 that contains a table named Sales.
You need to implement change tracking for Sales.
What should you do first?


       a. Create a certificate in db1.

       b. Enable change tracking for db1.

       c. Create a master key in the master database.

       d. Enable change tracking for Sales.


You should enable change tracking at the database level first, then you can enable change tracking for each table.

Change tracking must be enabled at the database level before it can be enabled for the Sales table. Creating a master key in the master database and creating a certificate in db1 are not needed for change tracking.

Enable and Disable Change Tracking - SQL Server | Microsoft Learn

Implement compliance controls for sensitive data - Training | Microsoft Learn


9) You have an Azure SQL Database named db1 that contains a table. The table contains a column that stores email addresses.
You need to ensure that reporting users can only view email addresses in a format of aXXX@XXX.com. The solution must minimize the impact on other users.
What should you configure?

       a. Always Encrypted

       b. column encryption

       c. dynamic data masking

       d. row-level security (RLS)


Dynamic data masking will enable users to only see masked values instead of email addresses.

Always Encrypted protects data in use or in transit. RLS controls access to rows in a table, and column encryption will encrypt the data in the column, which can hinder users’ ability to view the data.




10) You have a data estate that includes multiple Azure SQL Databases.
You need to audit the lifecycle of data across the estate. The solution must minimize administrative effort.
What should you use?

       a. Auditing for Azure SQL Database

       b. Azure Data Factory

       c. Microsoft Defender for SQL

       d. Microsoft Purview


Microsoft Purview will provide data lineage.

Auditing for Azure SQL Database tracks database events, Azure SQL Defender surfaces database vulnerabilities, and Azure Data Factory is a data integration service. These options do not provide a full view of the lifecycle of the data while minimizing the administrative effort required to perform the audit.



11) You have 20 on-premises Microsoft SQL Server instances.
You need to migrate the instances to Azure. The solution must support auditing at the server level.
Which two services can you use? Each correct answer presents a complete solution.

    • Azure SQL Database elastic pool
    • Azure SQL Database Hyperscale
    • Azure SQL Database serverless
    • Azure SQL Managed Instance
    • SQL Server on Azure Virtual Machines
SQL Server on Azure Virtual Machines and Azure SQL Managed Instance support SQL Server Audit and can be used.
Azure SQL Database serverless is a compute tier of Azure SQL Database that does not support SQL Server Audit. Azure SQL Database Elastic pool is a shared database offering of Azure SQL Database that doesn’t support SQL Server Audit. Azure SQL Database Hyperscale is a service tier of Azure SQL Database that does not support SQL Server Audit.






12) You are building a multi-tenant app that will use an Azure SQL Database.

You need to partition the database. The solution must meet the following requirements:
    • Improve scalability.
    • Reduce contention.
    • Optimize performance.
    • Isolate each tenant’s data.
What should you use?

       a.  a combination of list and range shard maps

       b. a list shard map only

       c. a range shard map only


Using only a list shard map is the correct solution because each tenant’s data will be stored in a separate database.

A range shard map will allow data from multiple tenants to be in stored in the same database.




13) You are deploying a SQL Server on Azure Virtual Machines instance that will be used as a development environment. You will develop two small databases, one of which will have in-memory tables.

You need to choose the most suitable virtual machine type for the deployment.

What should you choose?

       a. compute optimized

       b. GPU

       c. memory optimized

       d. general purpose


General purpose virtual machine sizes provide a balanced CPU-to-memory ratio. This is ideal for testing and development, small to medium databases, and low to medium traffic web servers.

Compute optimized virtual machine sizes have a high CPU-to-memory ratio. This is good for medium traffic web servers, network appliances, batch processes, and application servers.

Memory optimized virtual machine sizes offer a high memory-to-CPU ratio that is used for relational database servers, medium to large caches, and in-memory analytics.

GPU optimized virtual machine sizes are specialized virtual machines available with single, multiple, or fractional GPUs. These sizes are designed for compute-intensive, graphics-intensive, and visualization workloads.

Prepare to maintain SQL databases on Azure - Training | Microsoft Learn

Azure VM sizes - General purpose - Azure Virtual Machines | Microsoft Learn



14) You are deploying a SQL Server on Azure Virtual Machines instance for a production environment. One of the databases in this instance has in-memory tables.

You need to choose the most suitable virtual machine type for the deployment.

What should you choose?

       a. compute optimized

       b. GPU

       c. memory optimized

       d. general purpose



Memory optimized virtual machine sizes offer a high memory-to-CPU ratio that is good for relational database servers, medium to large caches, and in-memory analytics.

General purpose virtual machines provide a balanced CPU-to-memory ratio. These are best for testing and development, small to medium databases, and low to medium traffic web servers.

Compute optimized virtual machines have a high CPU-to-memory ratio. These are used for medium traffic web servers, network appliances, batch processes, and application servers.

GPU optimized virtual machine sizes are specialized virtual machines available with single, multiple, or fractional GPUs. These sizes are designed for compute-intensive, graphics-intensive, and visualization workloads.


15) You have an on-premises instance of Microsoft SQL Server 2019 that uses a SQL common language runtime (CLR) stored procedure to access a file share.

You need to migrate the instance to Azure.

To which Azure service should you migrate the instance?

       a. Azure SQL Database Hyperscale

       b. Azure SQL Database serverless

       c. Azure SQL Managed Instance

       d. SQL Server on Azure Virtual Machines


SQL Server on Azure Virtual Machine supports SQL CLR objects. The objects can access files shares, disks, and folders.

Azure SQL Database serverless is a compute tier for Azure SQL Database that does not support SQL CLR objects.

Azure SQL Database Hyperscale is a service tier of Azure SQL Database that does not support SQL CLR objects.

Azure SQL Managed Instance does not support SQL CLR objects that access file shares or folders of the operating system.

Compare the database engine features of SQL Database and SQL Managed Instance - Azure SQL Database & SQL Managed Instance | Microsoft Learn

T-SQL differences between SQL Server & Azure SQL Managed Instance - Azure SQL Managed Instance | Microsoft Learn


16) You plan to migrate a 40-TB OLTP database to Azure SQL Database.

Which service tier should you recommend for the database?


       a. Business Critical vCore service tier

       b. DTU Premium service tier

       c. General Purpose vCore service tier

       d. Hyperscale vCore service tier


You should recommend the Hyperscale vCore service tier, as it supports database sizes of up to 100 TB.

The General Purpose and Business Critical vCore service tier and the DTU Premium service tier only support a database size of up to 4 TB.

What is the Hyperscale service tier? - Azure SQL Database | Microsoft Learn

Understand SQL database hyperscale - Training | Microsoft Learn



17) You have an Azure SQL Managed Instance that contains a database named db1.

You need to implement table partitioning for a table in db1.

You create the filegroups.

What should you do next?

       a. Create a partition function, create a partition scheme, and then create a table on the partition function.

       b. Create a partition function, create a partition scheme, and then create a table on the partition scheme.

       c. Create a partition function, create a table on the partition function, and then change the fill factor settings on indexes.

       d. Create a partition scheme, create a table on the partition scheme, and then change the fill factor settings on indexes.


You should first create a partition function to define how the rows in a table or index map to a set of partitions based on the values of a partitioning column. Then you should create a partition scheme, which is a database object that maps the partitions of a partition function to one filegroup or to multiple filegroups. Finally, you should create a table specifying the partition scheme.

You should not create a table specifying the partition function, as a partition scheme is needed, nor should you change the fill factor settings for the indexes, as these settings relate to the free space at the index page level.



18) You have an Azure SQL Database that is only used to process data for three hours a day. Currently, the database has the Standard S3 (100 DTU) service tier configured.

You need to recommend a solution that will increase the performance without increasing the cost.

Which database service tier do you recommend?


       a. Premium

       b. Business Critical vCore

       c. Hyperscale vCore

       d. vCore serverless


By choosing the vCore serverless service tier, the database will be active only during the daily schedule, and the amount of vCores can be configured dynamically to handle the workload.

The Premium, Hyperscale, and Business Critical service tiers will be a more expensive solution.

Understand SQL database hyperscale - Training | Microsoft Learn

What is the Hyperscale service tier? - Azure SQL Database | Microsoft Learn



19) You have an on-premises SQL Server database that is used as part of a mission critical app.

You plan to migrate the database to SQL Server on Azure Virtual Machines.

You need to configure the disks for the virtual machine. The solution must meet the following requirements:

Maximize throughput.

Minimize latency.

Which type of disk should you use?


       a. Premium SSD

       b. Standard HDD

       c. Standard SSD

       d. Ultra disk


Ultra SSD will provide the highest throughput. Standard HDD, Standard SSD, and Premium SSD will not provide the highest throughput.

Explore performance and security - Training | Microsoft Learn


20) You have a database in an Azure SQL Managed Instance.

You need to synchronize data from five tables in the database to an Azure SQL Database. Any subsequent data changes must be visible in the Azure SQL Database as quickly as possible.

Which migration method should you use?


       a. Azure Data Factory

       b. BCP

       c. change data capture

       d. transactional replication


Transactional replication allows you to select tables and apply filters so only the required data will be sent to the target database. The replication process occurs nearly in real time, and it does not require any additional coding.

Change data capture and BCP require an additional orchestration component, such as Data Factory, to send changes from the source server to the target server. If you use Data Factory, you will need to detect changes when the pipeline is running. This process takes more time.


Transactional replication - Azure SQL Managed Instance | Microsoft Learn


21) You have an on-premises database that uses Transparent Data Encryption (TDE).

You plan to migrate the database to an Azure SQL Managed Instance named Instance1.

You export the TDE certificate to a file.

You need to ensure that you can restore the database to Instance1.

Where should you upload the certificate?


       a. a Recovery Services vault

       b. an Azure key vault

       c. Instance1

       d. Azure Blob Storage


The certificate should be uploaded to the managed instance, as the certificate should not be stored in either a Recovery Services vault or a key vault for the managed instance to have access.

Migrate SQL workloads to Azure Managed Instances - Training | Microsoft Learn

Migrate TDE certificate - managed instance - Azure SQL Managed Instance | Microsoft Learn



22) You have a SQL Server on an Azure Virtual Machines instance.

You need to configure an alert when a log truncation occurs in a database.

Which type of alert should you configure?


       a. SQL Server event alert

       b. WMI event alert

       c. SQL Server performance condition alert


Configuring a SQL Server performance condition alert allows you to use performance metrics that are generated by Microsoft SQL Server. You can specify an alert to occur in response to a particular performance condition. In this case, you specify the performance counter to monitor, a threshold for the alert, and the behavior that the counter must show if the alert is to occur.

A SQL Server event alert should be used when a specific error occurs and the WMI event alert occurs in response to a specific WMI event.

Alerts - SQL Server Agent | Microsoft Learn

Create and manage SQL Agent jobs - Training | Microsoft Learn


23) You have a SQL Server on Azure Virtual Machines instance.
You need to configure an alert when an error of severity 21 is detected.
Which type of alert should you configure?


       a. SQL Server event alert

       b. WMI event alert

       c. SQL Server performance condition alert


A SQL Server event alert should be used when a specific error occurs and the WMI event alert occurs in response to a specific WMI event.

Alerts - SQL Server Agent | Microsoft Learn

Create and manage SQL Agent jobs - Training | Microsoft Learn


24) You have a SQL Server on Azure Virtual Machines instance.

You need to ensure that an automated email is sent if a job fails. The solution must minimize administrative effort.

Which three actions should you perform? Each correct answer presents part of the solution.


  • Create a Database Mail profile.
  • Create an alert.
  • Enable the mail profile on SQL Server Agent.
  • Restart the SQL Server Agent service
  • Restart the SQL Server service. 


To ensure that an automated email is sent if a job fails, you need to create and configure a Database Mail profile, then configure the SQL Server Agent properties. You also need to enable the mail profile because it is disabled by default for security reasons, and a restart of the SQL Server Agent service is required.

Restarting the SQL Server service is unnecessary, because email notifications are configured on the SQL Server Agent level. You need to restart the SQL Server Agent service instead. You should not create an alert, as notifications about the job failure can be achieved directly on each job step.

Create and manage SQL Agent jobs - Training | Microsoft Learn

SQL Server Agent Properties (Alert System Page) - SQL Server Agent | Microsoft Learn


25) You deploy a SQL Server on Azure Virtual Machines instance.

You need to ensure that automated patching is enabled.

Which two cmdlets should you run? Each correct answer presents part of the solution.


a. New-AzVMConfig

b. New-AzVMSqlServerAutoPatchingConfig

c. Set-AzVMSqlServerExtension

d. Set-AzVMCustomScriptExtension


The New-AzVMSqlServerAutoPatchingConfig cmdlet allows you to create a configuration object for automatic patching on a virtual machine, and the Set-AzVMSqlServerExtension cmdlet establishes a maintenance window for a SQL Server on Azure Virtual Machines instance. Automated updates can only be installed during this maintenance window.

Set-AzVMCustomScriptExtensionUpdate Adds a custom script extension to a virtual machine, and the New-AzVMConfig cmdlet creates a configurable local virtual machine object for Azure. 

Set-AzVMSqlServerExtension (Az.Compute) | Microsoft Learn

Automate deployment of database resources - Training | Microsoft Learn


26) You have a bacpac file from an existing Microsoft SQL Server database. You copy the file to an Azure Storage account.

You need to apply the bacpac file to an existing Azure SQL Database.

Which command should you run?

       a. az sql db create

       b. az sql db restore

       c. az sql db import

       d. az sql db update


You can use the az sql db import command to import the database from the bacpac file. The database must be created before the bacpac file is imported.

The az sql db restore command creates a new database from backup, and the az sql db update command updates the existing database.





27) You create an Azure Logic App to insert data into a table named Sales in an Azure SQL Database named db1. The logic app uses the Insert row action.

Each execution of the logic app throws an error because there is trigger in the Sales table.

You need to fix the logic app without affecting the Sales table.

Which three actions should you perform? Each correct answer presents part of the solution.

    • Add a When item is created trigger to the logic app.
    • Create a stored procedure in db1 that inserts a row into the Sales table.
    • Create an Execute stored procedure action in the logic app.
    • Remove the Insert row action from the logic app.
    • Remove the trigger from the Sales table.
You should create a stored procedure in db1 that inserts a row into the Sales table. In this case, the information about the trigger execution is captured in the stored procedure. You should also remove the Insert row action from the logic app, create an Execute stored procedure action in the logic app, and then add a reference to the stored procedure you created in db1.

Removing the existing trigger from the Sales table is incorrect, as the table cannot be affected. Adding a When item is created trigger to the logic app is useful if the logic app needs to take action when data is added to the Sales table.




28) You have an Azure SQL Database named db1 that contains a table named Sales.

You create an Azure Logic App.

You need to configure the logic app to capture information when a new row is added to Sales.

What should you configure in the logic app?

       a. a Get rows action

       b. a When item is created trigger

       c. an Execute SQL statement action

       d. an Insert row action


By configuring a When item is created trigger, the trigger will be executed when a new row is inserted into the table.

The Execute SQL query action is used when you provide a query that will be executed by the logic app on the target database, the Get rows action selects data from a table, and the Insert row action inserts a new row into the table.

SQL Server - Connectors | Microsoft Learn

Manage Azure PaaS tasks using automation - Training | Microsoft Learn



29) You have an Azure subscription that includes 20 Azure SQL logical servers.

You need to automate management tasks using an Azure Automation runbook.

What should you do first?

       a. Create an Azure Automation credential.

       b. Create an Azure Automation account.

       c. Create an Azure Automation runbook schedule.

       d. Deploy an Azure Automation hybrid runbook runner.


To automate management tasks by using an Azure Automation runbook, you first need to create an Azure Automation account.

You cannot create a credential or a schedule without first creating an Azure Automation account, and you do not need a hybrid runbook runner.



30) You need to set up a baseline for performance monitoring of an Azure SQL Database.

Which dynamic management view should you query to get the baseline performance data?


       a. sys.dm_db_wait_stats.

       b. sys.dm_exec_query_stats

       c. sys.dm_exec_sessions_wait_stats

       d. sys.dm_os_waiting_tasks


sys.dm_db_wait_stats returns information about all the waits encountered in the database. This allows you to see the baseline performance data.

sys.dm_os_waiting_tasks is related to current connections and sessions. This view does not store any historical waits, so it should not be used to create the performance baseline. sys.dm_exec_sessions_wait_stats is used to find the wait statistics for a particular session. sys.dm_exec_query_stats returns aggregate performance statistics for cached query plans in Microsoft SQL Server.

sys.dm_db_wait_stats (Azure SQL Database) - SQL Server | Microsoft Learn

Establish baseline metrics - Training | Microsoft Learn


31)  You have an Azure SQL Server 2019 instance.

You need to enable Extended Events to monitor deadlocks.

Which T-SQL Statement should you run?


       a. CREATE EVENT SESSION deadlocks ON SERVER ADD EVENT sqlserver.lock_deadlock(ACTION(sqlserver.sql_text)), ADD EVENT sqlserver.lock_deadlock_chain(ACTION(sqlserver.sql_text)) ADD TARGET package0.event_file ( SET filename=C:\traces\deadlocks.xel' ) WITH (MAX_MEMORY=4MB, MAX_DISPATCH_LATENCY = 3 SECONDS); GO.

       b. CREATE EVENT SESSION deadlocks ON SERVER ADD EVENT sqlserver.lock_deadlock(ACTION(sqlserver.sql_text)), ADD EVENT sqlserver.lock_deadlock_chain(ACTION(sqlserver.sql_text)) ADD TARGET package0.event_counter WITH (MAX_MEMORY=4MB, MAX_DISPATCH_LATENCY = 3 SECONDS); GO

       c. CREATE EVENT SESSION deadlocks ON SERVER ADD EVENT sqlserver.lock_deadlock(ACTION(sqlserver.sql_text)), ADD EVENT sqlserver.lock_deadlock_chain(ACTION(sqlserver.sql_text)) ADD TARGET package0.histogram ( SET filtering_event_name=N'sqlserver.lock_deadlock’, source=N'sqlserver.sql_text’ ) WITH (MAX_MEMORY=4MB, MAX_DISPATCH_LATENCY = 3 SECONDS); GO


The event_file target will enable historical troubleshooting.

The event counter target merely counts how many times each specified event occurs and the histogram target counts occurrences of different types of items.

Targets for Extended Events in SQL Server - SQL Server | Microsoft Learn

Explore extended events - Training | Microsoft Learn


32)  You plan to use Query Store in an Azure SQL Managed Instance.

You need to ensure that you can manually force execution plans for regressed queries. The solution must follow the principle of least privilege.

To which database role should you be assigned?


       a. db_owner

       b. db_accessadmin

       c. db_ddladmin

       d. db_securityadmin


As a member of the db_owner fixed database role, you can perform all configuration and maintenance activities on the database, while following the principle of least privilege.

Members of the db_ddladmin role can run any DDL commands for a database. Members of this role can potentially elevate their privileges by manipulating code that may be executed under high privileges, and their actions should be monitored. A member of the db_accessadmin fixed database role can add or remove access to the database for Windows logins, Windows groups, and Microsoft SQL Server logins. Members of the db_securityadmin role can modify role membership for custom roles only and manage permissions.

Database-Level Roles - SQL Server | Microsoft Learn

Configure database authentication and authorization - Training | Microsoft Learn


33)You discover that a stored procedure running on an Azure SQL Database is slow due to a parameter sniffing issue. The procedure contains one SELECT statement.

You need to resolve the issue by using query hints. You do not want to remove query plans after each procedure execution.

Which hint should you use?


       a. FORCESEEK

       b. INDEX

       c. OPTIMIZE FOR


Using the OPTIMIZE FOR hint in the SELECT statement instructs Microsoft SQL Server to use a particular value for a parameter when the query is optimized.

The INDEX hint forces the query optimizer to use only the specified indexes to access the data in the referenced table or view, and the FORCESEEK hint forces the optimizer to use only an index seek operation to access the data in the referenced table or view.

Attach Query Hints to a Plan Guide - SQL Server | Microsoft Learn

Explore query performance optimization - Training | Microsoft Learn


34) You have an Azure SQL Database that uses Query Store.

You notice poor performance for a report caused by the execution plan and the report parameters.

You need to improve the performance of the report. The solution must minimize administrative effort.

What should you do?


       a. Disable parameter sniffing.

       b. Enable snapshot isolation.

       c. Execute the DBCC FREEPROCCACHE command.

       d. Force the most efficient execution plan.


Forcing the plan that is the most efficient for most the executions will improve report performance.

Disabling parameter sniffing will ignore any parameters and not choose the most efficient plan. DBCC FREEPROCCACHE will remove all plans from the cache.

Snapshot isolation is used to enable concurrent execution of transactions.

Evaluate performance improvements - Training | Microsoft Learn

Monitor performance by using the Query Store - SQL Server | Microsoft Learn


35) You have a database in an Azure SQL Managed Instance.

You need to control the MAXDOP configuration at the workload level. The solution must minimize administrative and development effort.

What should you do?


       a. At the database query level, set the MAXDOP hint.

       b. Configure the MAXDOP option in the database by using ALTER DATABASE SCOPED CONFIGURATION.

       c. Execute the sp_configure stored procedure with the max degree of parallelism parameter.

       d. In Resource Governor, set the MAX_DOP workload group configuration.


36) You need to find all indexes that have high fragmentation.

Which two dynamic management views should you query? Each answer presents a part of the solution.


  • sys.dm_db_column_store_row_group_physical_stats
  • sys.dm_db_index_operational_stats
  • sys.dm_db_index_physical_stats
  • sys.dm_db_index_usage_stats


You should query the sys.dm_db_index_physical_stats view, as it returns size and fragmentation information for the data and indexes of the specified table or view in Microsoft SQL Server. For an index, one row is returned for each level of the B-tree in each partition. For a heap, one row is returned for the IN_ROW_DATA allocation unit of each partition. You should also query the sys.dm_db_column_store_row_group_physical_stats view because it provides current rowgroup-level information about all the columnstore indexes in the current database. Based on the information, you can calculate the index fragmentation.

The sys.dm_db_index_usage_stats view returns counts of different types of index operations and the time each type of operation was last performed, and the sys.dm_db_index_operational_stats view returns current lower-level I/O, locking, latching, and access method activity for each partition of a table or index in the database. 


sys.dm_db_index_physical_stats (Transact-SQL) - SQL Server | Microsoft Learn

Configure databases for optimal performance - Training | Microsoft Learn


37) You have an Azure SQL Managed Instance that hosts two databases named db1 and db2.

You need to limit usage of db1 sessions to a maximum of 30 percent of the available CPU.

Which three actions should you perform? Each correct answer presents part of the solution.


  • Configure the Max Degree of Parallelism.
  • Create a resource pool.
  • Create a workload group.
  • Create an Extended Events session.
  • Enable Automatic Database Tuning.
  • Enable Resource Governor.


Resource Governor needs to be enabled, a resource pool needs to be created, and a workload group needs to be created to limit db1 to a maximum of 30 percent.

Automatic Database Tuning is used to notify you whenever a potential performance issue is detected and lets you apply corrective actions. Extended Events is a lightweight performance monitoring system. Max Degree of Parallelism limits the number of processors to use in a parallel plan execution. 

 

38) You have an Azure SQL Managed Instance that contains a database named DB1. The database compatibility level for DB1 is 150.

Queries that use table variables are performing poorly. You identify that the issue is caused by incorrect cardinality estimations.

You need to configure an option to ensure that the database engine defines the cardinality estimate when the query is executed, and the actual row count is known.

Which option should you configure?

 

       a. DEFERRED_COMPILATION_TV

       b. ELEVATE_ONLINE

       c. INTERLEAVED_EXECUTION_TVF

       d. TSQL_SCALAR_UDF_INLINING


You should use the DEFERRED_COMPILATION_TV option because it enables or disables table variable compilation.

The INTERLEAVED_EXECUTION_TVF option enables or disables interleaved execution for multi-statement table-valued functions.

The TSQL_SCALAR_UDF_INLINING option enables or disables the T-SQL Scalar UDF inlining.

The ELEVATE_ONLINE option causes the engine to automatically elevate supported operations online.

ALTER DATABASE SCOPED CONFIGURATION - SQL Server (Transact-SQL) | Microsoft Learn


39) You plan to deploy a SQL Server on an Azure Virtual Machines instance running on a Windows Server operating system.

You need to configure storage for the virtual machine. The solution must ensure the highest performance for the data files.

Which two actions should you perform? Each correct answer presents part of the solution.


  • Set host caching to none.
  • Set host caching to read-only.
  • Set host caching to read/write.
  • Stripe multiple disks by using Storage Spaces.
  • Use Write Accelerator disks.


You should stripe multiple disks, as it will increase IOPS, as well as set host caching to read-only, as data files perform best by using this type of host caching.

Setting host caching to none means that reads will not be cached, setting host caching to read/write will degrade performance and lead to data loss. Write Accelerator Disks should be used for transaction log disks.

Storage: Performance best practices & guidelines - SQL Server on Azure VMs | Microsoft Learn

Optimize database storage - Training | Microsoft Learn


40) You have an Azure SQL Database that uses the General Purpose service tier.

You need to ensure that there are at least two readable copies of the database, and the database is available if a datacenter becomes unavailable.

What should you include in the recommendation?


       a. active geo-replication

       b. automated backups

       c. elastic pools

       d. failover groups


Active geo-replication is a feature that lets you create a continuously synchronized, readable secondary database for a primary database. The readable secondary database can be in the same Azure region as the primary database, or, more commonly, in a different region.

The failover groups allow you to manage the replication and failover of some or all databases on a logical server to another region, but do not allow you to create multiple Azure SQL Database geo-secondary replicas. Automated backups do not let you have two readable copies of the database available, and elastic pools are used for managing and scaling multiple databases that have varying and unpredictable usage demands. The databases in an elastic pool are on a single server and share a set number of resources.

Active geo-replication - Azure SQL Database | Microsoft Learn

Explore IaaS and PaaS solutions for high availability and disaster recovery - Training | Microsoft Learn


41) You have 100 on-premises Microsoft SQL servers.

You plan to migrate the servers to SQL Server on Azure Virtual Machines.

You need to recommend a high-availability solution that will maintain availability if a datacenter fails.

What should you include in the recommendation?


       a. availability zones

       b. availability sets

       c. Azure Backup

       d. Azure Site Recovery


You should recommend availability zones, as they account for datacenter-level failure in Azure.

Availability sets provide uptime against Azure-related maintenance and single points of failure in a single datacenter, Azure Site Recovery replicates workloads running on physical and virtual machines from a primary site to a secondary location, and Azure Backup is used to provide independent and isolated backups to guard against the unintended destruction of the data on your virtual machines.

Describe Azure high availability and disaster recovery features for Azure Virtual Machines - Training | Microsoft Learn


42) You have an on-premises Microsoft SQL Server 2019 server that hosts 10 databases that is up to date with patching. You are required to replicate all of the databases to the cloud.

Which two options could you recommend? Each correct answer presents a complete solution.


  • a SQL Server on Azure Virtual Machines instance
  • an Azure SQL Database
  • an Azure SQL Database elastic pool
  • An Azure SQL Managed Instance link


A SQL Server on Azure Virtual Machines is required for hybrid high-availability and disaster recovery (HA/DR).

Azure SQL Managed Instance link enables near real-time data replication between SQL Server and Azure SQL Managed Instance.

Azure SQL Database, and an Azure SQL Database elastic pool are not the correct options, as they cannot be used with Always On availability groups.

High availability, disaster recovery, business continuity - SQL Server on Azure VMs | Microsoft Learn

Plan and implement an high availability and disaster recovery environment - Training | Microsoft Learn


43) You have an Always On availability group located across multiple datacenters hosting 5 databases that support a web app named App1.

You need to ensure continuity in the event of a failover.

Which two actions should you perform? Each correct answer presents part of the solution.


  • Configure a backup preference.
  • Configure a read write routing URL.
  • Configure Connection Timeout=60 for the connection string of App1.
  • Configure MultiSubnetFailover=True for the connection string of App1.
  • Create an availability group listener.


The connection string needs MultiSubnetFailover=True to be able to connect to IPS in a different subnet, and the listener needs to be created to ensure continuity in the event of a failover.

The connection timeout does not need to be changed, and the backup preference and the read write routing URL do not need to be configured to meet the goal.


High availability, disaster recovery, business continuity - SQL Server on Azure VMs | Microsoft Learn

Plan and implement an high availability and disaster recovery environment - Training | Microsoft Learn


44) You need to perform a manual backup of a database running on an Azure SQL Managed Instance.

Which option should you include in the BACKUP DATABASE statement to perform the backup operation?


       a. WITH COPY_ONLY

       b. WITH FORMAT

       c. WITH INIT

       d. WITH NO_TRUNCATE


The WITH COPY_ONLY option must be included in the BACKUP DATABASE statement. The option is mandatory because Azure SQL Managed Instance has built-in automated backups.

WITH NO_TRUNCATE specifies that the transaction log should not be truncated and causes the SQL Server Database Engine to attempt the backup regardless of the state of the database. Consequently, a backup taken with the NO_TRUNCATE option might have incomplete metadata. WITH INIT specifies that all backup sets should be overwritten, but it preserves the media header. If INIT is specified, any existing backup set on that device is overwritten, if conditions permit. WITH FORMAT specifies that a new media set will be created.




45) You have an Azure SQL Managed Instance that contains a database named db1. You have a valid backup of db1.

You need to restore db1 to the point in time of the backupdb1 over the existing database.

Which two actions should you perform? Each correct answer presents part of the solution.


       a. Drop db1.

       b. Restore db1 from a file.

       c. Restore db1 from a URL.

       d. Set db1 to single-user mode.


You should drop the existing database first because the existing database cannot be overwritten on the SQL managed instance. You should also restore the database db1 from a URL.

Setting db1 to single-user mode is not allowed on the SQL managed instance, and while the SQL managed instance allows you to perform a manual database restore from a URL, it does not allow you to restore the database from a tape or disk.

Restore a database from a backup - Azure SQL Managed Instance | Microsoft Learn

Back up and restore databases - Training | Microsoft Learn


46) You have a SQL Server on Azure Virtual Machines instance.

During a weekly maintenance task, you discover that a database named db1 has consistency errors.

You plan to restore the database from backups.

Which command should you run before you run the RESTORE command?


       a. ALTER DATABASE db1 SET EMERGENCY

       b. ALTER DATABASE db1 SET OFFLINE

       c. ALTER DATABASE db1 SET SINGLE_USER

       d. ALTER DATABASE db1 SET RESTRICTED_USER


You should run the ALTER DATABASE db1 SET SINGLE_USER command, as only one user at a time can access the database. If you specify SINGLE_USER, and another user connects to the database, the ALTER DATABASE command is blocked until all users disconnect from the specified database. This is the command that should be run before the RESTORE command is run.

Running the ALTER DATABASE db1 SET EMERGENCY command would not work because the database is marked as READ_ONLY, logging is disabled, and access is limited to members of the sysadmin fixed server role.

By running ALTER DATABASE db1 SET OFFLINE, the database will shut down, and you cannot perform the restore operation. You cannot modify a database while it is offline.

Running the ALTER DATABASE db1 SET RESTRICTED_USER command allows for only members of the db_owner fixed database role dbcreator, and fixed server roles to connect to the database.

ALTER DATABASE SET Options (Transact-SQL) - SQL Server | Microsoft Learn

Back up and restore databases - Training | Microsoft Learn


47) You have a Microsoft SQL Server 2019 instance.

You are configuring a backup maintenance solution.

You need to ensure that the databases can be restored to any point in time.

Which two types of backups should you include? Each correct answer presents part of the solution.


  • backup copy-only
  • file
  • filegroup
  • full database
  • transaction log


To configure a backup maintenance solution and ensure that the databases can be restored to any point in time, a full database backup and a transaction log backup are required.

A copy-only backup is a SQL Server backup that is independent of the sequence of conventional SQL Server backups. A file backup contains all the data in one or more files, and a filegroup backup contains all the data in one or more filegroups.


48) You have two SQL Server on Azure Virtual Machines instances.

You need to configure log shipping for a database named Sales.

You enable the Sales database as a primary server in the log shipping configuration.

What should you do next?


       a. Add a secondary server to the log shipping configuration.

       b. Configure a monitoring server instance.

       c. Configure the Backup Settings for Sales.

       d. Create the Sales database on a secondary server.


You should first configure the Backup Settings for the Sales database. You need to specify the network location.

You can only add a secondary server to the log shipping configuration after you have configured the Backup Settings on the primary server. Configuring a monitoring server instance is an optional step, and you can do it only after you have configured the Backup Settings on the primary server. You can decide if the database will be created or restored during the secondary server configuration.


Configure Log Shipping (SQL Server) - SQL Server | Microsoft Learn

Back up and restore databases - Training | Microsoft Learn


49) You have an Always On availability group that contains three Microsoft SQL replicas.

You have a business process that runs on each replica. The process runs every hour and must be started only on the primary replica.

Which view should you query to obtain the necessary information about the state of each replica?


       a. sys.availability_groups

       b. sys.availabilty_replicas

       c. sys.dm_hadr_availability_replica_states

       d. sys.dm_hadr_database_replica_cluster_states


The sys.dm_hadr_availability_replica_states view returns a row for each local replica and a row for each remote replica in the same Always On availability group as a local replica. Each row contains information about the state of a given replica. The columns role and role_desc contain information about the description of the replica role.

sys.availability_groups returns a row for each availability group for which the local instance of SQL Server hosts an availability replica. sys.dm_hadr_database_replica_cluster_states returns a row that contains information intended to provide you with insights into the health of the availability databases in the Always On availability groups in each Always On availability group on a Windows Server Failover Cluster (WSFC) cluster. sys.availabilty_replicas returns a row for each availability replica that belongs to any Always On availability group in the WSFC failover cluster.

Monitor availability groups using Transact-SQL (T-SQL) - SQL Server Always On | Microsoft Learn

sys.dm_hadr_availability_replica_states (Transact-SQL) - SQL Server | Microsoft Learn

Explore IaaS and PaaS solutions for high availability and disaster recovery - Training | Microsoft Learn


50) You have two Azure SQL Databases in an active geo-replication configuration.

You need to monitor the geo-replication lag.

Which view should you query?


       a. sys.dm_database_replica_states

       b. sys.dm_geo_replication_links

       c. sys.dm_geo_replication_link_status

       d. sys.dm_operation_status


The sys.dm_geo_replication_link_status view contains a row for each replication link between the primary and secondary databases in a geo-replication partnership. If more than one continuous replication link exists for a given primary database, this tables contain a row for each of the relationships.

The sys.dm_operation_status view returns information about the operations performed on databases on an Azure SQL Database server, the sys.dm_geo_replication_links view contains a row for each replication link between the primary and secondary databases in a geo-replication partnership, and the sys.dm_database_replica_states view returns a row for the database, exposing the state of the local replica.

Active geo-replication - Azure SQL Database | Microsoft Learn

sys.dm_geo_replication_link_status - Azure SQL Database and Azure SQL Managed Instance | Microsoft Learn