0% found this document useful (0 votes)
74 views

You Have A Database That Is Experiencing Deadlock Issues When Users Run Queries

You have a database experiencing deadlock issues when users run queries. To record all deadlocks in XML format, enable trace flag 1222 in the SQL Server startup options. Trace flag 1222 formats deadlock information in an XML-like format.

Uploaded by

bharat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

You Have A Database That Is Experiencing Deadlock Issues When Users Run Queries

You have a database experiencing deadlock issues when users run queries. To record all deadlocks in XML format, enable trace flag 1222 in the SQL Server startup options. Trace flag 1222 formats deadlock information in an XML-like format.

Uploaded by

bharat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

You have a database that is experiencing deadlock issues when users run queries.

You need to ensure that all deadlocks are recorded in XML format.
What should you do?

 A. Create a Microsoft SQL Server Integration Services package that uses


sys.dm_tran_locks.
 B. Enable trace flag 1224 by using the Database Cpmsistency Checker(BDCC).
 C. Enable trace flag 1222 in the startup options for Microsoft SQL Server.
 D. Use the Microsoft SQL Server Profiler Lock:Deadlock event class.

Correct Answer: C
When deadlocks occur, trace flag 1204 and trace flag 1222 return information that is
capturedin the SQL Server error log. Trace flag 1204 reports deadlock information
formatted by each node involved in the deadlock. Trace flag 1222 formats deadlock
information, first by processes and then by resources.
The output format for Trace Flag 1222 only returns information in an XML-like
format.

The READ_COMMITTED_SNAPSHOT database option is set to OFF, and auto-content is


set to ON. Within the stored procedures, no explicit transactions are defined.
If JobB starts before JobA, it can finish in seconds. If JobA starts first, JobB takes a long
time to complete.
You need to use Microsoft SQL Server Profiler to determine whether the blocking that you
observe in JobB is caused by locks acquired by JobA.
Which trace event class in the Locks event category should you use?

 A. LockAcquired
 B. LockCancel
 C. LockDeadlock
 D. LockEscalation

Correct Answer: A
The Lock:Acquiredevent class indicates that acquisition of a lock on a resource, such
asa data page, has been achieved.
The Lock:Acquired and Lock:Released event classes can be used to monitor when
objects are being locked, the type of locks taken, and for how long the locks were
retained. Locks retained for long periods of time may cause contention issues and
should be investigated.
Module 1: Interpreted stored procedure.

Module 2: natively compiled stored procedure.

You have a reporting database that includes a non-partitioned fact table named Fact_Sales.
The table is persisted on disk.
Users report that their queries take a long time to complete. The system administrator
reports that the table takes too much space in the database. You observe that there are no
indexes defined on the table, and many columns have repeating values.
You need to create the most efficient index on the table, minimize disk storage and improve
reporting query performance.
What should you do?

The columnstore index is the standard for storing and querying largedata warehousing fact
tables. It uses column-based data storage and query processing to achieve up to 10x query
performance gains in your data warehouse over traditional row-oriented storage, and up to
10x data compression over the uncompressed data size.
A clustered columnstore index is the physical storage for the entire table.

Users frequently run the same query with different values for the local variable @lastName.
The table named Person is persisted on disk.You need to create an index on the
Person.Person table that meets the following requirements:
1. All users must be able to benefit from the index.
2. FirstName must be added to the index as an included column.
What should you do?

By including nonkey columns, you can create nonclustered indexes that cover more queries.
This is because the nonkeycolumns have the following benefits:
They can be data types not allowed as index key columns.
They are not considered by the Database Engine when calculating the number of index key
columns or index key size.

Users report that the following query takes a long time to complete.

You need to create an index that:


- improves the query performance
- does not impact the existing index
- minimizes storage size of the table (inclusive of index pages).
What should you do?
Create a nonclustered filtered index on the table.

A filtered index is an optimized nonclustered index, especially suited to cover queries that
select from a well-defined subset of data. It uses a filter predicate to index a portion of rows
in the table. A well-designed filtered index can improve query performance, reduce index
maintenance costs, and reduce index storage costs compared with full-table indexes.

You need to add the most efficient index to support the new OLTP workload, while not
deteriorating the existing Reporting query performance.
What should you do?

 C. Create a nonclustered filtered index on the table.

A filtered index is an optimized nonclustered index, especially suited to cover queries that
select from a well-defined subset of data. It uses a filter predicate to index a portion of rows
in the table. A well-designed filtered index can improve query performance, reduce index
maintenance costs, and reduce index storage costs compared with full-table indexes.

You might also like