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

PrepAway - Latest Free Exam Questions & Answers

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

8 Comments on “Which code segment should you execute?

  1. Marek says:

    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);




    0



    0
  2. ryahan says:

    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




    0



    0

Leave a Reply