exam questions

Exam DP-300 All Questions

View all questions & answers for the DP-300 exam

Exam DP-300 topic 3 question 33 discussion

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

You have an Azure SQL database named sqldb1.
You need to minimize the amount of space by the data and log files of sqldb1.
What should you run?

  • A. DBCC SHRINKDATABASE
  • B. sp_clean_db_free_space
  • C. sp_clean_db_file_free_space
  • D. DBCC SHRINKFILE
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
DBCC SHRINKDATABASE shrinks the size of the data and log files in the specified database.
Incorrect Answers:
D: To shrink one data or log file at a time for a specific database, execute the DBCC SHRINKFILE command.
Reference:
https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-shrinkdatabase-transact-sql

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
Geese_Howard
Highly Voted 4 years, 2 months ago
Azure SQL database supports: DBCC SHRINKDATABASE (N'db1');
upvoted 18 times
Sr18
10 months, 1 week ago
I agree on this, because SHRINKFILE provides more control, but here question asks for Data and Logs files not a single or set of files. So Better to use SHRINKDATABASE, run and prepare coffee and enjoy the wait.
upvoted 1 times
...
...
yuck
Highly Voted 4 years, 2 months ago
https://docs.microsoft.com/en-us/azure/azure-sql/database/file-space-manage
upvoted 6 times
...
kkkiet
Most Recent 2 years, 2 months ago
For an Azure SQL database, it's generally not recommended to use DBCC SHRINKDATABASE (option A) as it can cause performance issues and should only be used as a last resort. Instead, DBCC SHRINKFILE (option D) is the preferred option to minimize the amount of space used by the data and log files of an Azure SQL database.
upvoted 3 times
...
louisaok
2 years, 3 months ago
DBCC SHRINKDATABASE shrinks all data and log files in a database using a single command. The command shrinks one data file at a time, which can take a long time for larger databases. It also shrinks the log file, which is usually unnecessary because Azure SQL Database shrinks log files automatically as needed.
upvoted 1 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