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
performtransaction 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 andarrange them in the correct order.

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
performtransaction 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 andarrange them in the correct order.

Answer:

Explanation:

http://technet.microsoft.com/en-us/library/ms190757.aspx
http://technet.microsoft.com/en-us/library/ms189493.aspx
http://technet.microsoft.com/en-us/library/ms365418.aspx
http://technet.microsoft.com/en-us/library/ms189272.aspx
http://technet.microsoft.com/en-us/library/ms179478.aspx



Leave a Reply 8

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


HR_OS_B

HR_OS_B

Simple recovery
DBCC SHRINKFILE
Full recovery

Mido

Mido

1- Use database1
2-simple recovery
3-DBCC
4-Full recovery

WK

WK

1- Use database1
2-simple recovery
3-DBCC
4-Full recovery

Marek

Marek

If the transaction log is that big it means the recovery model is already full. It should be enough to:
1 – BACKUP LOG Database1 TO Database1_Log_Backup
2 – USE Database1;
3 – DBCC SHRINKFILE (Database1_Log);

Vladimir

Vladimir

Database1_Log.ldf is 1.5 terabytes. It is not good idea to backup it.
So:
1- Use database1
2- simple recovery
3- DBCC SHRINKFILE(Database1_log)
4- Full recovery

ryahan

ryahan

B. Shrinking a log file to a specified target size
The following example shrinks the log file in the AdventureWorks2008R2 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 AdventureWorks2008R2;
GO
— Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE AdventureWorks2008R2
SET RECOVERY SIMPLE;
GO
— Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (AdventureWorks2008R2_Log, 1);
GO
— Reset the database recovery model.
ALTER DATABASE AdventureWorks2008R2
SET RECOVERY FULL;
GO

Nat

Nat

agree with Vladimir’s answer