ExamGecko
Home Home / Microsoft / DP-300

Microsoft DP-300 Practice Test - Questions Answers, Page 3

Question list
Search
Search

List of questions

Search

Related questions











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?

A.
LEGACY_CARDINALITY_ESTIMATION
A.
LEGACY_CARDINALITY_ESTIMATION
Answers
B.
QUERY_OPTIMIZER_HOTFIXES
B.
QUERY_OPTIMIZER_HOTFIXES
Answers
C.
OPTIMIZE_FOR_AD_HOC_WORKLOADS
C.
OPTIMIZE_FOR_AD_HOC_WORKLOADS
Answers
D.
ACCELERATED_PLAN_FORCING
D.
ACCELERATED_PLAN_FORCING
Answers
Suggested answer: C

Explanation:

OPTIMIZE_FOR_AD_HOC_WORKLOADS = { ON | OFF }

Enables or disables a compiled plan stub to be stored in cache when a batch is compiled for the first time. The default is OFF. Once the database scoped configuration OPTIMIZE_FOR_AD_HOC_WORKLOADS is enabled for a database, a compiled plan stub will be stored in cache when a batch is compiled for the first time. Plan stubs have a smaller memory footprint compared to the size of the full compiled plan.

Incorrect Answers:

A: LEGACY_CARDINALITY_ESTIMATION = { ON | OFF | PRIMARY }

Enables you to set the query optimizer cardinality estimation model to the SQL Server 2012 and earlier version independent of the compatibility level of the database. The default is OFF, which sets the query optimizer cardinality estimation model based on the compatibility level of the database.

B: QUERY_OPTIMIZER_HOTFIXES = { ON | OFF | PRIMARY }

Enables or disables query optimization hotfixes regardless of the compatibility level of the database. The default is OFF, which disables query optimization hotfixes that were released after the highest available compatibility level was introduced for a specific version (post-RTM).

Reference:

https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-scoped-configuration-transact-sql

You have SQL Server on an Azure virtual machine that contains a database named DB1.

You view a plan summary that shows the duration in milliseconds of each execution of query 1178902 as shown in the following exhibit:

What should you do to ensure that the query uses the execution plan which executes in the least amount of time?

A.
Force the query execution plan for plan 1221065.
A.
Force the query execution plan for plan 1221065.
Answers
B.
Run the DBCC FREEPROCCACHE command.
B.
Run the DBCC FREEPROCCACHE command.
Answers
C.
Force the query execution plan for plan 1220917.
C.
Force the query execution plan for plan 1220917.
Answers
D.
Disable parameter sniffing.
D.
Disable parameter sniffing.
Answers
Suggested answer: C

Explanation:

Reference: https://docs.microsoft.com/en-us/sql/relational-databases/performance/query-store-usage-scenarios

You have an Azure SQL database named DB1. You run a query while connected to DB1.

You review the actual execution plan for the query, and you add an index to a table referenced by the query. You need to compare the previous actual execution plan for the query to the Live Query Statistics. What should you do first in Microsoft SQL Server Management Studio (SSMS)?

A.
For DB1, set QUERY_CAPTURE_MODE of Query Store to All.
A.
For DB1, set QUERY_CAPTURE_MODE of Query Store to All.
Answers
B.
Run the SET SHOWPLAN_ALL Transact-SQL statement.
B.
Run the SET SHOWPLAN_ALL Transact-SQL statement.
Answers
C.
Save the actual execution plan.
C.
Save the actual execution plan.
Answers
D.
Enable Query Store for DB1.
D.
Enable Query Store for DB1.
Answers
Suggested answer: C

Explanation:

The Plan Comparison menu option allows side-by-side comparison of two different execution plans, for easier identification of similarities and changes that explain the different behaviors for all the reasons stated above. This option can compare between:

Two previously saved execution plan files (.sqlplan extension).

One active execution plan and one previously saved query execution plan. Two selected query plans in Query Store.

You have an Azure SQL database.

Users report that the executions of a stored procedure are slower than usual. You suspect that a regressed query is causing the performance issue. You need to view the query execution plan to verify whether a regressed query is causing the issue. The solution must minimize effort. What should you use?

A.
Performance Recommendations in the Azure portal
A.
Performance Recommendations in the Azure portal
Answers
B.
Extended Events in Microsoft SQL Server Management Studio (SSMS)
B.
Extended Events in Microsoft SQL Server Management Studio (SSMS)
Answers
C.
Query Store in Microsoft SQL Server Management Studio (SSMS)
C.
Query Store in Microsoft SQL Server Management Studio (SSMS)
Answers
D.
Query Performance Insight in the Azure portal
D.
Query Performance Insight in the Azure portal
Answers
Suggested answer: C

Explanation:

Use the Query Store Page in SQL Server Management Studio.

Query performance regressions caused by execution plan changes can be non-trivial and time consuming to resolve. Since the Query Store retains multiple execution plans per query, it can enforce policies to direct the Query Processor to use a specific execution plan for a query. This is referred to as plan forcing. Plan forcing in Query Store is provided by using a mechanism similar to the USE PLAN query hint, but it does not require any change in user applications. Plan forcing can resolve a query performance regression caused by a plan change in a very short period of time.

Reference:

https://docs.microsoft.com/en-us/sql/relational-databases/performance/monitoring-performance-by-using-the-query-store

You have an Azure SQL database. The database contains a table that uses a columnstore index and is accessed infrequently. You enable columnstore archival compression.

What are two possible results of the configuration? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

A.
Queries that use the index will consume more disk I/O.
A.
Queries that use the index will consume more disk I/O.
Answers
B.
Queries that use the index will retrieve fewer data pages.
B.
Queries that use the index will retrieve fewer data pages.
Answers
C.
The index will consume more disk space.
C.
The index will consume more disk space.
Answers
D.
The index will consume more memory.
D.
The index will consume more memory.
Answers
E.
Queries that use the index will consume more CPU resources.
E.
Queries that use the index will consume more CPU resources.
Answers
Suggested answer: B, E

Explanation:

For rowstore tables and indexes, use the data compression feature to help reduce the size of the database. In addition to saving space, data compression can help improve performance of I/O intensive workloads because the data is stored in fewer pages and queries need to read fewer pages from disk.

Use columnstore archival compression to further reduce the data size for situations when you can afford extra time and CPU resources to store and retrieve the data.

HOTSPOT

You have SQL Server on an Azure virtual machine.

You review the query plan shown in the following exhibit.

For each of the following statements, select yes if the statement is true. Otherwise, select no.

NOTE: Each correct selection is worth one point.


Question 26
Correct answer: Question 26

Explanation:

Reference:

https://docs.microsoft.com/en-us/sql/relational-databases/performance/monitoring-performance-by-using-the-query-store

HOTSPOT

You have SQL Server on an Azure virtual machine that contains a database named Db1.

You need to enable automatic tuning for Db1.

How should you complete the statements? To answer, select the appropriate answer in the answer area.

NOTE: Each correct selection is worth one point.


Question 27
Correct answer: Question 27

Explanation:

Box 1: SET AUTOMATIC_TUNING = AUTO

To enable automatic tuning on a single database via T-SQL, connect to the database and execute the following query:

ALTER DATABASE current SET AUTOMATIC_TUNING = AUTO

Setting automatic tuning to AUTO will apply Azure Defaults.

Box 2: SET AUTOMATIC_TUNING (FORCE_LAST_GOOD_PLAN = ON)

To configure individual automatic tuning options via T-SQL, connect to the database and execute the query such as this one:

ALTER DATABASE current SET AUTOMATIC_TUNING (FORCE_LAST_GOOD_PLAN = ON)

Setting the individual tuning option to ON will override any setting that database inherited and enable the tuning option. Setting it to OFF will also override any setting that database inherited and disable the tuning option.

Reference:

https://docs.microsoft.com/en-us/azure/azure-sql/database/automatic-tuning-enable

HOTSPOT

You have an Azure SQL database named DB1. The automatic tuning options for DB1 are configured as shown in the following exhibit.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

NOTE: Each correct selection is worth one point.


Question 28
Correct answer: Question 28

Explanation:

Box 1: Yes

We see: Tuning option: Create index ON

CREATE INDEX - Identifies indexes that may improve performance of your workload, creates indexes, and automatically verifies that performance of queries has improved.

Box 2: No

Box 3: Yes

FORCE LAST GOOD PLAN (automatic plan correction) - Identifies Azure SQL queries using an execution plan that is slower than the previous good plan, and queries using the last known good plan instead of the regressed plan.

You are designing a dimension table in an Azure Synapse Analytics dedicated SQL pool.

You need to create a surrogate key for the table. The solution must provide the fastest query performance. What should you use for the surrogate key?

A.
an IDENTITY column
A.
an IDENTITY column
Answers
B.
a GUID column
B.
a GUID column
Answers
C.
a sequence object
C.
a sequence object
Answers
Suggested answer: A

Explanation:

Dedicated SQL pool supports many, but not all, of the table features offered by other databases. Surrogate keys are not supported. Implement it with an Identity column.

Reference: https://docs.microsoft.com/en-us/azure/synapse-analytics/sql-data-warehouse/sql-data-warehouse-tables-overview

You are designing a star schema for a dataset that contains records of online orders. Each record includes an order date, an order due date, and an order ship date. You need to ensure that the design provides the fastest query times of the records when querying for arbitrary date ranges and aggregating by fiscal calendar attributes. Which two actions should you perform? Each correct answer presents part of the solution.

NOTE: Each correct selection is worth one point.

A.
Create a date dimension table that has a DateTime key.
A.
Create a date dimension table that has a DateTime key.
Answers
B.
Create a date dimension table that has an integer key in the format of YYYYMMDD.
B.
Create a date dimension table that has an integer key in the format of YYYYMMDD.
Answers
C.
Use built-in SQL functions to extract date attributes.
C.
Use built-in SQL functions to extract date attributes.
Answers
D.
Use integer columns for the date fields.
D.
Use integer columns for the date fields.
Answers
E.
Use DateTime columns for the date fields.
E.
Use DateTime columns for the date fields.
Answers
Suggested answer: B, D

Explanation:

Reference: https://community.idera.com/database-tools/blog/b/community_blog/posts/why-use-a-date-dimension-table-in-a-data-warehouse

Total 338 questions
Go to page: of 34