exam questions

Exam DP-300 All Questions

View all questions & answers for the DP-300 exam

Exam DP-300 topic 4 question 2 discussion

Actual exam question from Microsoft's DP-300
Question #: 2
Topic #: 4
[All DP-300 Questions]

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.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: SET QUERY_STORE = ON (OPERATION MODE = READ_WRITE);
Must enable the Query Store.
Incorrect:
If the server may be Azure SQL or Managed Instance then the response should be SET AUTOMATIC_TUNNIG=AUTO, but as it is a SQL server the Query store needs to be first enabled.
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/sql/relational-databases/automatic-tuning/automatic-tuning https://docs.microsoft.com/en-us/azure/azure-sql/database/automatic-tuning-enable

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Tomi1234
Highly Voted 3 years, 3 months ago
SET QUERY_STORE = ON (OPERATION_MODE = READ_WRITE); https://docs.microsoft.com/en-us/sql/relational-databases/performance/monitoring-performance-by-using-the-query-store?view=sql-server-ver15 SET AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = ON ); https://docs.microsoft.com/en-us/sql/relational-databases/automatic-tuning/automatic-tuning?view=sql-server-ver15
upvoted 55 times
...
[Removed]
Highly Voted 3 years, 2 months ago
The right answer is as Tomi1234 say because is a VM SQL Server: Box1 - SET QUERY_STORE = ON (OPERATION MODE = READ_WRITE); Box2 - SET AUTOMATIC_TUNNING (FORCE_LAST_GOOD_PLAN = ON); https://www.sqlshack.com/understanding-automatic-tuning-in-sql-server-2017/ If the server may be Azure SQL or Managed Instance then the response should be: Box1. SET AUTOMATIC_TUNNIG=AUTO Box2. SET AUTOMATIC_TUNNING (FORCE_LAST_GOOD_PLAN = ON) and other options are SET AUTOMATIC_TUNING (FORCE_LAST_GOOD_PLAN = ON, CREATE_INDEX = ON, DROP_INDEX = OFF) https://docs.microsoft.com/es-es/azure/azure-sql/database/automatic-tuning-enable
upvoted 32 times
...
OneplusOne
Most Recent 10 months, 1 week ago
The option SET AUTOMATICS TUNING = AUTO does not exist so it seems. For <automatic_tuning_option> ::= { AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = { DEFAULT | ON | OFF } ) } https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-set-options?view=sql-server-ver16
upvoted 1 times
...
prashantjoge
2 years, 6 months ago
In case of error messages that automated recommendation management has been disabled, or simply disabled by system, the most common causes are: Query Store is not enabled, or Query Store is in read-only mode for a specified database, or Query Store stopped running because it used the allocated storage space.
upvoted 1 times
...
karateKid
2 years, 6 months ago
Answers in green (in example) are correct. https://docs.microsoft.com/en-us/azure/azure-sql/database/automatic-tuning-enable
upvoted 4 times
ramelas
1 year, 10 months ago
this a VM not an azure sql database
upvoted 2 times
...
...
vicky007_87
2 years, 9 months ago
Correct Answer: SET QUERY_STORE = ON (OPERATION MODE = READ_WRITE); SET AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = ON ); Reason: As this is SQL Server hosted on Azure VM and not Azure SQL DB / MI, Query store needs to be first enabled and then automatic plan needs to be applied.
upvoted 5 times
...
JohnCrawford
2 years, 9 months ago
And the proof. Find a database w/o Query Store enabled and run the following query. You will get an error telling you Query Store must be enabled to turn on automatic tuning. ALTER DATABASE CURRENT SET AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = ON );
upvoted 4 times
Pranava_GCP
6 months, 1 week ago
When doing this, ALTER DATABASE Sales SET AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = ON ); Got this , Msg 15705, Level 16, State 1, Line 4 Automatic Tuning option FORCE_LAST_GOOD_PLAN cannot be enabled, because Query Store is not turned on. Msg 5069, Level 16, State 1, Line 4 ALTER DATABASE statement failed.
upvoted 1 times
...
...
JohnCrawford
2 years, 9 months ago
In reviewing this another rationale occurs to me. From the documentation Force_Last_Good_Plan_On should be correct (https://docs.microsoft.com/en-us/sql/relational-databases/automatic-tuning/automatic-tuning?view=sql-server-ver15) The aha moment is that the cache only keeps one execution plan at a time. (Technically 2. 1 for serial execution and 1 for any parallel execution). To be able to force last good plan SQL Server needs a way to determine what the last good plan was. The only place it will get that information from is the Query Store so that HAS to be enabled first.
upvoted 1 times
...
JohnCrawford
2 years, 9 months ago
If this question was about an Azure SQL database, I'd agree. The first part is redundant, but doesn't cause any issue. The problem is that the question states that this is SQL Server on a VM. In other words, not an Azure SQL DB. In that case, for automatic tuning to work Query Store must first be enabled. https://docs.microsoft.com/en-us/sql/relational-databases/automatic-tuning/automatic-tuning?view=sql-server-ver15 Because of that I actually think the answer should be to turn on query store and then turn on automatic tuning.
upvoted 3 times
...
Colbrin
3 years, 1 month ago
The reference is wrong as it applies only to SQL Database and SQL managed instance. Tomi1234 provided the right answer
upvoted 5 times
...
rickyp
3 years, 2 months ago
As a pre-requisite, Query Store must be turned on. Then, to enable automatic tuning, you will use this command: ALTER DATABASE <DBNAME> SET AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = ON ); https://blog.pythian.com/sql-server-2017-automatic-tuning/
upvoted 3 times
...
MagnusFA
3 years, 3 months ago
enable query store to read write then auto tuning = AUTO, check https://docs.microsoft.com/en-us/azure/azure-sql/database/automatic-tuning-enable#disabled-by-the-system
upvoted 2 times
...
Tomi1234
3 years, 3 months ago
You're right. What I mentioned regards to on-prem env.
upvoted 1 times
...
Bharat
3 years, 3 months ago
The answer is correct. If you follow the link given, there is clear explanation supporting the selected answers.
upvoted 5 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago