Which three code segments should you execute?

DRAG DROP
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 7 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.

DRAG DROP
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 7 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.

Answer: See the explanation.

Explanation:

Box 1:

Box 2:

Box 3:

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 modelto 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 file by 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 3

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


malakosa

malakosa

..
set recovery simple;

dbcc shrinkfile(…, 7168) NOT 10
….
set recovery full;

malakosa

malakosa

Target_size of shrinkfile command – is the size for the file in megabytes, expressed as an integer, number 7168 means 7GB.

I guess this is a mistake and they are asking for 7GB.

ryahan

ryahan

agreed and if the question says 10 MB then yes that s the correct answer