Exam DP-300 All QuestionsBrowse all questions from this exam
Question 147

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?

    Correct Answer: D

    To minimize the amount of space used by the data and log files of an Azure SQL database, you should run the DBCC SHRINKFILE command. DBCC SHRINKFILE provides control over shrinking individual data or log files, which can be more efficient and less disruptive compared to the DBCC SHRINKDATABASE command that attempts to shrink all files in the database.

Discussion
Geese_HowardOption: A

Azure SQL database supports: DBCC SHRINKDATABASE (N'db1');

Sr18

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.

yuck

https://docs.microsoft.com/en-us/azure/azure-sql/database/file-space-manage

kkkietOption: D

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.

louisaokOption: A

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.