PrepAway - Latest Free Exam Questions & Answers

Which code segment should you execute?

DRAG DROP
You have a SQL Server 2012 database named Database1. Database1 has a data file named
database1_data.mdf and a transaction log file named database1_Log.ldf. Database1_Data.mdf is 1.5 GB.
Database1_Log.ldf is 1.5 terabytes. A full backup of Database1 is performed every day.
You need to reduce the size of the log file. The solution must ensure that you can perform transaction log
backups in the future. Which code segment should you execute? To answer, move the appropriate code
segments from the list of code segments to the answer area and arrange them in the correct order.
Select and Place:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
Shrinking a log file to a specified target size
The following example shrinks the log file in the AdventureWorks database to 1 MB. To allow the DBCC
SHRINKFILE command to shrink the file, the file is first truncated by setting the database recovery model to
SIMPLE.
Transact-SQL
USE AdventureWorks2012;
GO
— Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE AdventureWorks2012
SET RECOVERY SIMPLE;
GO
— Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (AdventureWorks2012_Log, 1);
GO
— Reset the database recovery model.
ALTER DATABASE AdventureWorks2012
SET RECOVERY FULL;
GO
http://msdn.microsoft.com/en-gb/library/ms189493.aspx

One Comment on “Which code segment should you execute?


Leave a Reply