PrepAway - Latest Free Exam Questions & Answers

What should you recommend?

You have a query that is used by a reporting dashboard.
Users report that the query sometimes takes a long time to run.
You need to recommend a solution to identify what is causing the issue.
What should you recommend?
More than one answer choice may achieve the goal. Select the BEST answer.

PrepAway - Latest Free Exam Questions & Answers

A.
Set the blocked process threshold, and then run SQL Server Profiler.

B.
Set the blocked process threshold, and then create an alert.

C.
Enable trace flag 1204, and then create an alert.

D.
Create a job that queries the sys.dm_os_waiting_tasks dynamic management view.

Explanation:

Step 1: Turn on the blocked process report. This will look for any blocking taking 20 seconds
or longer.
–Make sure you don’t have any pending changes
SELECT *
FROM sys.configurations
WHERE value <> value_in_use;
GO
exec sp_configure ‘show advanced options’, 1;
GO
RECONFIGURE
GO
exec sp_configure ‘blocked process threshold (s)’, 20;
GO

RECONFIGURE
GO
Step 2: Set up a trace to capture the blocked process report. Run it as a server side trace.

12 Comments on “What should you recommend?

  1. adityomagnet@gmail.com says:

    A and B

    Benefits of SQL Server Profiler
    Monitoring an instance of the Database Engine or Analysis Services. You can capture and save data about each event to a file or table to analyze later. For example, you can monitor a production environment to see which stored procedures are affecting performance by executing too slowly. SQL Server Profiler is used for activities such as:
    •Stepping through problem queries to find the cause of the problem.
    •Finding and diagnosing slow-running queries.
    •Capturing the series of Transact-SQL statements that lead to a problem. The saved trace can then be used to replicate the problem on a test server where the problem can be diagnosed.
    •Monitoring the performance of SQL Server to tune workloads. For information about tuning the physical database design for database workloads, see Database Engine Tuning Advisor.
    •Correlating performance counters to diagnose problems.
    SQL Server Profiler also supports auditing the actions performed on instances of SQL Server. Audits record security-related actions for later review by a security administrator.

    Alerts
    Applies To: SQL Server 2016 Preview
    Events are generated by SQL Server and entered into the Microsoft Windows application log. SQL Server Agent reads the application log and compares events written there to alerts that you have defined. When SQL Server Agent finds a match, it fires an alert, which is an automated response to an event. In addition to monitoring SQL Server events, SQL Server Agent can also monitor performance conditions and Windows Management Instrumentation (WMI) events.
    To define an alert, you specify:
    •The name of the alert.
    •The event or performance condition that triggers the alert.
    •The action that SQL Server Agent takes in response to the event or performance condition.




    0



    0
  2. Ricky says:

    It says ‘sometimes’ takes a long time which implies in normal time it’s OK. So you just let the profiler running excessive long time hoping to catch the problem when it happens?

    I would vote for B. Create an Alert, for long running queries, choose Object “MSSQL$InstanceName:Transactions” and Counter: Longest Transaction Running Time. Configure the values, and the alert notification options. When it happens again, you will get email or pager, then you log on to the server to check DMV or whatever to see what causing the problem.




    0



    0
  3. Mick says:

    The question is assuming that blocking is the problem which isn’t always the case. That said I think A) is the correct answer. I don’t think you can use the blocked process report via an alert can you? I just checked… No. You seem to be able to.

    I’m surprised that they don’t offer Extended events. That’s probably a much better way to go.




    0



    0

Leave a Reply