Which three code segments should you execute?

Your network contains a server named Server1 that runs SQL Server 2012. Server1 contains an instance
named Instance1. Instance1 contains a database named ContentDatabase.
ContentDatabase uses transaction log backups.
The recovery model of ContentDatabase is set to FULL.
You need to shrink the ContentDatabase_Log log file to 10 MB. The solution must ensure that you can continue
to back up the transaction log.
Which three code segments 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:

Your network contains a server named Server1 that runs SQL Server 2012. Server1 contains an instance
named Instance1. Instance1 contains a database named ContentDatabase.
ContentDatabase uses transaction log backups.
The recovery model of ContentDatabase is set to FULL.
You need to shrink the ContentDatabase_Log log file to 10 MB. The solution must ensure that you can continue
to back up the transaction log.
Which three code segments 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:

Answer:

Explanation:
Note:
* 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
* If the log file does not shrink (after dbcc shrinkfile) Typically it is the log file that appears not to shrink. This is
usually the result of a log file that has notbeen truncated. You can truncate the log by setting the database
recovery model to SIMPLE, or bybacking up the log and then running the DBCC SHRINKFILE operation again.
* DBCC SHRINKFILEShrinks the size of the specified data or log file for the current database, or empties a fileby moving thedata from the specified file to other files in the same filegroup, allowing the file to be removed
from thedatabase.
Arguments include:
target_size
Is the size for the file in megabytes, expressed as an integer.



Leave a Reply 0

Your email address will not be published. Required fields are marked *