Microsoft certification · Exam DP-300

DP-300 Mock Exam Page 2

Administering Relational Databases on Microsoft Azure

Free DP-300 questions on Topic 6: Misc. Questions, each with the answer and an explanation.

20 questions · 33 minutes · free, no sign-up

Topic 6: Misc. Questions questions

11–20 of 85 free
Question 11 Choose 1
Note: This question is part of a series of questions that present the same scenario.
Each question in the series contains a unique solution that might meet the stated
goals. Some question sets might have more than one correct solution, while others
might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.
You have an Azure SQL database named Sales.
You need to implement disaster recovery for Sales to meet the following requirements:
During normal operations, provide at least two readable copies of Sales.
Ensure that Sales remains available if a datacenter fails.
Solution: You deploy an Azure SQL database that uses the General Purpose service tier
and geo-replication.
Does this meet the goal?
Show answerHide answer

Correct answer: B No

Explanation

Explanation:
The General Purpose service tier in Azure SQL Database uses a premium remote storage architecture with one readable primary compute replica. It does not provide multiple readable copies of the database during normal operations. The requirement for "at least two readable copies of Sales" during normal operations implies the need for multiple read-scale replicas, which is a feature of the Business Critical/Premium tier (which provides three readable replicas) or Hyperscale (which provides up to four readable secondary replicas).

While geo-replication does create a readable secondary in another region for disaster recovery, the primary database in the General Purpose tier itself still has only one readable copy (the primary) in the primary region. The secondary is not used during "normal operations" unless manually redirected for read-only workloads. The solution does not meet the requirement for multiple readable copies during normal operations in the primary region.

Correct Option:
B. No

Reference:
Microsoft Docs - High availability for Azure SQL Database
Question 12 Choose 1
Note: This question is part of a series of questions that present the same scenario.
Each question in the series contains a unique solution that might meet the stated
goals. Some question sets might have more than one correct solution, while others
might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a
result, these questions will not appear in the review screen.
You have two Azure SQL Database servers named Server1 and Server2. Each server
contains an Azure SQL database named Database1.
You need to restore Database1 from Server1 to Server2. The solution must replace the
existing Database1 on Server2.
Solution: You restore Database1 from Server1 to the Server2 by using the RESTORE
Transact-SQL command and the REPLACE option.
Does this meet the goal?
Show answerHide answer

Correct answer: A Yes

Explanation

Explanation:
The goal is to restore a database from one server to another and replace the existing database with the same name on the target server. The RESTORE Transact-SQL command can be used to restore a .bacpac, .dacpac, or a backup file (.bak) from one Azure SQL server to another. When using the RESTORE command from a backup file stored in Azure Blob Storage, the REPLACE option is required if a database with the same name already exists on the target server. This option instructs SQL Server to overwrite the existing database, which meets the requirement to "replace the existing Database1 on Server2."

However, it’s important to note that in Azure SQL Database, cross-server restore from backup files requires the backup to be stored in Azure Blob Storage, and appropriate authentication (SAS or managed identity) must be configured. Assuming these prerequisites are satisfied, the RESTORE ... WITH REPLACE solution is valid.

Correct Option:

A. Yes

Reference:
Microsoft Docs - RESTORE (Transact-SQL) - REPLACE Option
Question 13 Choose 1
You have an Azure SQL Database managed instance named SQLMI1. A Microsoft SQL Server Agent job runs on SQLMI1.
You need to ensure that an automatic email notification is sent once the job completes What should you include in the solution?
Show answerHide answer

Correct answer: C From SQL Server Management Studio (SSMS), create a Database Mail profile

Explanation

Explanation:
SQL Server Agent on Azure SQL Managed Instance functions similarly to on-premises SQL Server but runs in a managed PaaS environment. To send email notifications for job completions, you must configure Database Mail within the Managed Instance, as this is the integrated email system for SQL Server. Creating a Database Mail profile and account (using an SMTP server) is a prerequisite before you can set up SQL Server Agent to use email notifications.

Correct Option:

C. From SQL Server Management Studio (SSMS), create a Database Mail profile.
This is the essential first step. You must create and test a Database Mail profile and account within SQLMI1 using T-SQL or SSMS. Once configured, you can then set this profile in SQL Server Agent properties and create job notifications (e.g., "When the job completes") to send emails to designated operators.

Incorrect Options:

A. From SQL Server Configuration Manager (SSMS), enable SQL Server Agent
SQL Server Configuration Manager is a Windows tool for on-premises SQL Server and is not accessible for Azure SQL Managed Instance, which is a fully managed PaaS service. Furthermore, SQL Server Agent is already enabled by default on Managed Instance; it doesn't need to be enabled via this method.

B. From SQL Server Management Studio (SSMS), run sp_set_sqlagent_properties
While sp_set_sqlagent_properties is a valid stored procedure to configure SQL Server Agent settings (like the mail profile), you must first have Database Mail configured. This procedure is a subsequent step, not the primary action to include. The core requirement is to set up the mail infrastructure first.

D. From the Azure portal, create an Azure Monitor action group that has an Email/SMS/Push/Voice action
Azure Monitor action groups are for Azure platform-level alerts (e.g., metric alerts, activity log alerts). They cannot be triggered directly by SQL Server Agent job completions, which are internal SQL Server events. SQL Agent notifications require Database Mail integration.

Question 14
You have an Azure SQL Database managed instance named sqldbmi1 that contains a
database name Sales
You need to initiate a backup of Sales.
How should you complete the Transact-SQL statement? To answer, select the appropriate
options in the answer area.
NOTE: Each correct selection is worth one point
Show answerHide answer

Explanation



Explanation:
For an Azure SQL Database Managed Instance, the BACKUP DATABASE command is supported, but it must write to Azure Blob Storage (URL). Managed Instance does not support backing up to local disk (DISK =) or a local tape/device (TO 'device_name'). The backup URL must point to an Azure Storage blob container with appropriate SAS tokens or managed identity access configured.

Correct Selections:

TO URL = 'https://storage1.blob.core.windows.net/blob1/Sales.bak'
This is the only supported backup destination for Azure SQL Managed Instance. The backup file must be stored in an Azure Blob Storage container. The URL format must specify the full path to the .bak file within the container.

WITH COPY_ONLY;
A COPY_ONLY backup does not break the log backup chain and is ideal for taking ad-hoc backups for migration, testing, or other purposes without affecting regular backup schedules. Since this is a one-time "initiate a backup" request (not part of a scheduled sequence), COPY_ONLY is a safe and recommended option.

Incorrect Options:

Backup Destination (TO DISK, TO 'Sales_Backup'):
TO DISK = ...: Managed Instance cannot access on-premises or local network file shares (\\BackupSystem\...) or local drives (X:\BAK\...). Backups must go to Azure Blob Storage.

TO 'Sales_Backup': This syntax refers to a logical backup device predefined on the SQL Server instance. Managed Instance does not support creating or using logical backup devices for BACKUP commands.

WITH Options:
WITH ENCRYPTION: While Managed Instance can create encrypted backups, encryption requires specifying an encryption algorithm and encryptor (certificate or asymmetric key) in the WITH clause. Using ENCRYPTION alone without these specifics is invalid.

WITH FILE_SNAPSHOT: This option is used for Azure SQL Database (single database) automated backups when performing geo-replication/restore operations, not for Managed Instance BACKUP DATABASE commands.

WITH NO_TRUNCATE: This is used with BACKUP LOG to back up the tail of the log without truncating it, typically during a disaster recovery scenario. It is not applicable to a full database backup command.

Reference:Microsoft Docs - Backup to URL for SQL Server Managed Instance
Question 15 Choose 1
You have an Azure SQL database.
You discover that the plan cache is full of compiled plans that were used only once.
You run the select * from sys.database_scoped_configurations Transact-SQL command
and receive the results shown in the following table
You need relieve the memory pressure.
What should you configure?
Show answerHide answer

Correct answer: C OPTIMIZE_FOR_AD_HOC_WORKLOADS

Explanation

Explanation:
When the plan cache is filled with compiled plans used only once (a common symptom of ad-hoc workloads), it causes memory pressure because these single-use plans consume cache space without providing reuse benefits. The specific database-scoped configuration designed to mitigate this is OPTIMIZE_FOR_AD_HOC_WORKLOADS.

Correct Option:

C. OPTIMIZE_FOR_AD_HOC_WORKLOADS
Enabling this setting (value = 1) changes the caching behavior for single-use ad-hoc queries. Instead of storing the full compiled plan, SQL Server stores a smaller plan stub in the cache on the first compilation. Only if the same query is compiled again will the full plan be cached. This significantly reduces the memory footprint of the plan cache for ad-hoc workloads, directly relieving memory pressure.

Incorrect Options:

A. LEGACY_CARDINALITY_ESTIMATION
This setting controls whether the database uses the older SQL Server 2012 cardinality estimator (value = 1) or the newer, default estimator (value = 0). It affects query optimization and performance but does not address the caching behavior of single-use plans.

B. QUERY_OPTIMIZER_HOTFIXES
This setting determines whether the latest query optimizer hotfixes (trace flag 4199 behavior) are enabled at the database level. It influences plan generation but does not impact how or when plans are cached for ad-hoc queries.

D. ACCELERATED_PLAN_FORCING
This setting improves the performance of automatic plan forcing (Query Store forced plans) by caching a helper structure. It is related to Query Store plan forcing efficiency, not to reducing plan cache bloat from single-use ad-hoc queries.

Reference:
Microsoft Docs - optimize for ad hoc workloads Server Configuration Option
Question 16 Choose 2
You are planning disaster recovery for the failover group of an Azure SQL Database
managed instance.
Your company’s SLA requires that the database in the failover group become available as
quickly as possible if a major outage occurs.
You set the Read/Write failover policy to Automatic.
What are two results of the configuration? Each correct answer presents a complete
solution.
NOTE: Each correct selection is worth one point.
Show answerHide answer

Correct answer: A, E In the event of a datacenter or Azure regional outage, the databases will fail over automatically. In the event of an outage, the minimum delay for the databases to fail over in the primary instance will be one hour.

Explanation

Explanation:
For an Azure SQL Database Managed Instance failover group with the Read/Write failover policy set to Automatic, failover is managed at the instance level (all databases together) and is triggered by Azure's health detection of a major outage. The configuration includes a built-in grace period to avoid unnecessary failovers for transient issues.

Correct Options:

A. In the event of a datacenter or Azure regional outage, the databases will fail over automatically.
This is the primary purpose of setting the failover policy to Automatic. Azure monitors the health of the primary Managed Instance. If a severe, persistent outage (like a datacenter or regional failure) is detected, Azure automatically initiates a failover of the entire instance (all databases in the failover group) to the secondary region after the grace period expires.

E. In the event of an outage, the minimum delay for the databases to fail over in the primary instance will be one hour.
The Automatic failover policy for Managed Instance failover groups has a fixed grace period of 1 hour. This means that even if an outage is detected, the automatic failover will not occur until at least one hour has passed. This prevents unnecessary failovers for short-lived transient issues.

Incorrect Options:

B. In the event of an outage, the databases in the primary instance will fail over immediately.
This is false because of the 1-hour grace period. Failover is not immediate; it is delayed by at least one hour to allow transient issues to resolve.

C. In the event of an outage, you can selectively fail over individual databases.
Failover groups for Managed Instance operate at the instance level. All databases within the instance fail over together as a single unit. You cannot selectively fail over individual databases.

D. In the event of an outage, you can set a different grace period to fail over each database.
The grace period is fixed at 1 hour for Managed Instance failover groups with Automatic policy and cannot be configured. Furthermore, failover is instance-wide, not per-database.

Reference:
Microsoft Docs - Auto-failover groups - Managed Instance - Failover policy
Question 17 Choose 1
You are building a database backup solution for a SQL Server database hosted on an Azure virtual machine.
In the event of an Azure regional outage, you need to be able to restore the database backups. The solution must minimize costs.
Which type of storage accounts should you use for the backups?
Show answerHide answer

Correct answer: B read-access geo-redundant storage (RA-GRS)

Explanation

>Explanation:
The requirement is to be able to restore database backups in the event of an Azure regional outage while minimizing costs. This means backups must be stored with geo-redundancy so a copy exists in a paired region if the primary region fails. Among geo-redundant options, Read-Access Geo-Redundant Storage (RA-GRS) provides the necessary regional resiliency at a lower cost than GRS because it offers read-only access to the secondary region.

Correct Option:

B. Read-access geo-redundant storage (RA-GRS)
RA-GRS replicates data to a secondary region and allows read access to the replicated data in that secondary region. This means if the primary region is down, you can still read and restore the backup files from the secondary region's endpoint. It is less expensive than Geo-Redundant Storage (GRS)? Actually, GRS does not allow read access to the secondary; you would need to wait for a Microsoft-initiated failover. RA-GRS provides immediate read access for disaster recovery at a slightly higher cost than GRS, but it's the most cost-effective choice for ensuring restorability without manual failover.

Incorrect Options:

A. Locally-redundant storage (LRS):
LRS only replicates within a single datacenter. It provides no protection against a regional outage, so backups would be unavailable.

C. Zone-redundant storage (ZRS):
ZRS replicates across availability zones within a single region. It protects against zone-level failures but not against a regional outage.

D. Geo-redundant storage (GRS):
GRS replicates to a secondary region, but the data in the secondary region is not readable unless Microsoft triggers a storage account failover (which is not customer-initiated for standard GRS). This means you cannot directly restore from the secondary region during an outage without a failover event, making it less suitable for immediate recovery.

Reference:
Microsoft Docs - Azure Storage redundancy
Question 18
You have an Azure SQL database that contains a table named Customer. Customer has
the columns shown in the following table.
Show answerHide answer

Explanation

Question 19
You have a Microsoft SQL Server database named DB1 that contains a table named
Table1.
The database role membership for a user named User1 is shown in the following exhibit
Show answerHide answer

Explanation

Question 20
You have a resource group named App1Dev that contains an Azure SQL Database server
named DevServer1. DevServer1 contains an Azure SQL database named DB1. The
schema and permissions for DB1 are saved in a Microsoft SQL Server Data Tools (SSDT)
database project
You need to populate a new resource group named App1Test with the DB1 database and
an Azure SQL Server named TestServer1. The resources in App1Test must have the same
configurations as the resources in App1Dev.
Which four actions should you perform in sequence? To answer, move the appropriate
actions from the list of actions to the answer area and arrange them in the correct order.
Show answerHide answer

Explanation

Full mock exam

Sit the DP-300 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real DP-300 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full DP-300 mock exam
  • 65questions per mock
  • 105 mintime limit
  • 334questions in the bank
  • Newmock on every attempt