Question No: 181 DRAG DROP – (Topic 13)

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.

Answer:

Explanation:

Box 1:

Box 2:

Box 3:

Box 4:

Shrinking a log file to a specified target sizeThe 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

Question No: 182 DRAG DROP – (Topic 13)

You administer a SQL Server 2014 instance.

You have been assigned to determine the cause of frequent long-running transactions that have been tracked to the dbo.Account table, where there are many cases of blocking and deadlocks. The dbo.Account table contains more than one million rows.

Users and processes frequently search for and update data by using the AccountId column, and less frequently the AccountNumber and GovernmentId columns, all of which contain only unique values. Users frequently get lists of AccountNumber values by searching on Last Name and then First Name.

You need to modify the structure of the dbo.Account table to alleviate the issues.

How should you complete the table definition to reduce contention on the table structure? To answer, drag the appropriate code snippets to the correct locations in the CREATE TABLE statement. Each code snippet may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

Answer:

Explanation:

C:\Users\Kamran\Desktop\image.jpg Note:

Users and processes frequently search for and update data by using the AccountId column (Primary Key Clustered) , and less frequently the AccountNumber (Unique Clustered) and GovernmentId(Unique Clustered) columns, all of which contain only unique values. Users frequently get lists of AccountNumber values by searching on Last Name and then First Name (LastName, Firstname) INCLUDE (AccountNumber).

Question No: 183 DRAG DROP – (Topic 13)

You have a SQL Server 2012 database named DB1. DB1 contains four filegroups named

FG1, FG2, FG3, and FG4. You execute the following code:

Two million rows are added to dbo.Sales.

You need to move the data from the first partition to a new table named SalesHistory and, starting on December 31, 2012, repartition dbo.Sales to support new sales data for three months.

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.

Answer:

Explanation:

Box 1:

Box 2:

Box 3:

Box 4:

Box 5:

Box 6:

Note:

* Box 1 – Box 2:

/ You need to move the data from the first partition to a new table named SalesHistory.

/ First create the new table, then move the contents of the first partition.

*( Box 3 Box 4) Drop the partition scheme and then the partition function and the recreate them (box 5-box6). First recreate the partition function.

/You need, starting on December 31, 2012, repartition dbo.Sales to support new sales data for three months.

/ A partition function can be dropped only if there are no partition schemes currently using the partition function. If there are partition schemes using the partition function, DROP

PARTITION FUNCTION returns an error.

Question No: 184 DRAG DROP – (Topic 13)

You have a database named database1. Each table in database1 has one index per column.

Users often report that creating items takes a long time. You need to perform the following maintenance tasks:

->Identify unused indexes.

->Identify indexes that need to be defragmented.

What should you use?

To answer, drag the appropriate function to the correct management task in the answer area. (Answer choices may be used once, more than once, or not at all.)

Answer:

Explanation:

Note:

sys.dm_db_index_usage_stats

Returns counts of different types of index operations and the time each type of operation was last performed.

sys.dm_db_index_physical_stats

Returns size and fragmentation information for the data and indexes of the specified table or view.

Question No: 185 DRAG DROP – (Topic 13)

You have a database that contains three tables. The tables are configured as shown in the following table.

You have the following query:

The execution plan for the query is shown in the exhibit. (Click the Exhibit button.)

You need to create one index to minimize the amount of time it takes to execute the query. What should you do?

To answer, drag the appropriate columns to the correct locations in the answer area. (Answer choices may be used once, more than once, or not at all.)

Answer:

Explanation:

Box 1:

Box 2:

Box 3:

Note:

Covering index: A type of index that includes all the columns that are needed to process a particular query. For example, your query might retrieve the FirstName and LastName columns from a table, based on a value in the ContactID column. You can create a covering index that includes all three columns.

Question No: 186 – (Topic 13)

You have a database that uses the following management views:

->Sys.dm_os_volume_stats

->Sys.dm_db_partition_stats

->Sys.dm_db_file_space_usage

->Sys.fulltext_indexes

You plan to migrate the database to Microsoft SQL Azure. You need to identify which view can be used in SQL Azure. Which view should you identify?

sys.fulltext_indexes

sys.dm_db_file_space_usage

sys.dm_os_volume_stats

sys.dm_db_partition_stats

Answer: D

Question No: 187 – (Topic 13)

You have a SQL Server 2012 database named DB1 that is accessed by 650 concurrent

users.

You need to log all of the queries to DB1 that become deadlocked. The solution must meet the following requirements:

Question No: 188 – (Topic 13)

You have a database for a mission-critical web application. The database is stored on a SQL Server 2012 instance and is the only database on the instance.

The application generates all T-SQL statements dynamically and does not use stored procedures.

You need to maximize the amount of memory available for data caching. Which advanced server option should you modify?

Optimize for Ad hoc Workloads

Enable Contained Databases

Allow Triggers to Fire Others

Scan for Startup Procs

Answer: A

Question No: 189 – (Topic 13)

You administer an instance of SQL Server 2014.

You are tasked with tuning a common set of queries. You have the results of several test executions, along with query plans. The schema and the data for all database object(s) used remain unchanged between executions. The QueryTime column is defined as a computed column that uses the GETDATE() system function. The query plans and results are shown below:

You need to make an initial diagnosis of the situation, based solely on this input

Which two statements can you make about the performance characteristics of this query? Each correct answer presents a complete solution. Choose two.

The queries would perform better if the index named AccountNumber included the Name and QueryTime column.

The queries would perform worse if the index named AccountNumber included the NameColumn.

The queries would perform better if the index named AccountNumber included the Name column.

The object Account is a table, with an index having a leading column of AccountNumber and a Clustered Index named PKAccount.

The object Account is an indexed view, with an index having a leading column of AccountNumber and a Clustered Index named PKAccount.

The object Account is a view, joining the Account-AccountNumber and Account.PKAccount objects together.

Answer: B,D

Question No: 190 DRAG DROP – (Topic 13)

You are planning two stored procedures named SProc1 and SProc2.

You identify the following requirements:

->SProc1 must return a table.

->SProc2 must return a scalar value.

You need to identify which option must be implemented for each stored procedure to return the desired data.

Which options should you identify?

To answer, drag the appropriate option to the correct requirement in the answer area. (Answer choices may be used once, more than once, or not at all.)