SQL Server Questions and Answers – Profiling

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Profiling”.

1. Which of the following is the benefit of SQL Server Profiler?
a) Capturing the series of Transact-SQL statements that lead to a problem
b) Finding and diagnosing slow-running queries
c) Correlating performance counters to diagnose problems
d) All of the mentioned
View Answer

Answer: d
Explanation: Microsoft SQL Server Profiler is a graphical user interface to SQL Trace for monitoring an instance of the Database Engine or Analysis Services.

2. Point out the correct statement.
a) SQL Server Profiler also supports auditing the actions performed on instances of SQL Server
b) A profiler class is a type of event that can be traced
c) A profile category defines the way events are grouped within SQL Server Profiler
d) None of the mentioned
View Answer

Answer: a
Explanation: SQL Server Profiler is a rich interface to create and manage traces and analyze and replay trace results.

3. Which of the following is an event class?
a) SQL:BatchCompleted
b) Audit Password
c) Lock:Blocked
d) All of the mentioned
View Answer

Answer: a
Explanation: The event class contains all of the data that can be reported by an event.

advertisement
advertisement

4. Which of the following stored procedure will stop the trace?
a) sp_trace_create.
b) sp_trace_setfilter
c) sp_trace_setstatus
d) sp_stop_status
View Answer

Answer: c
Explanation: Stop and Close the the trace with sp_trace_setstatus.

5. Point out the wrong statement.
a) If a filter is set, all events of the selected event classes are returned in the trace output
b) A trace captures data based on selected event classes, data columns, and filters. For example, you can create a trace to monitor exception errors
c) A data column is an attribute of event classes captured in the trace
d) All of the mentioned
View Answer

Answer: a
Explanation: When you create a trace or template, you can define criteria to filter the data collected by the event. To keep traces from becoming too large, you can filter them so that only a subset of the event data is collected.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. Which of the following is syntax for sp_trace_setevent?
a)

sp_trace_setevent [ @traceid = ] trace_id  
          , [ @eventid = ] event_id 
          , [ @columnid = ] column_id 
          , [ @ON = ] ON

b)

advertisement
sp_trace_setevent  [ @traceid = ] trace_id OUTPUT 
          , [ @options = ] option_value  
          , [ @tracefile = ] 'trace_file' 
     [ , [ @maxfilesize = ] max_file_size ]
     [ , [ @stoptime = ] 'stop_time' ]
     [ , [ @filecount = ] 'max_rollover_files' ]

c)

advertisement
sp_trace_setevent [ @traceid = ] trace_id ,
   [ @STATUS = ] STATUS

d) None of the mentioned
View Answer

Answer: a
Explanation: Adds or removes an event or event column to a trace. sp_trace_setevent may be executed only on existing traces that are stopped.

7. Which of the following argument has option value 2 in sp_trace_create procedure?
a) TRACE_PRODUCE_BLACKBOX
b) SHUTDOWN_ON_ERROR
c) TRACE_FILE_ROLLOVER
d) All of the mentioned
View Answer

Answer: c
Explanation: As more rollover trace files are created, the integer value appended to the file name increases sequentially.

8. Which of the following events and their columns are contained in the trace?
a) Attention
b) Batch starting
c) Exception
d) All of the mentioned
View Answer

Answer: d
Explanation: Events or columns cannot be added or removed from this trace.

9. TRACE_PRODUCE_BLACKBOX file can be saved in the following location?
a) N’%SQLDIR%\MSSQL\DATA\blackbox.trc
b) N’%SQLDIR%\MSSQL\DATA\black.trc
c) N’%SQLDIR%\MSSQL\DATA\box.trc
d) None of the mentioned
View Answer

Answer: a
Explanation: The default file_count is 2 but can be overridden by the user using filecount option.

10. Which of the following event has event number 15 in the trace?
a) DTCTransaction
b) ErrorLog
c) SQL:BatchStarting
d) Lock:Cancel
View Answer

Answer: c
Explanation: SQL:BatchStarting occurs when a Transact-SQL batch has started.

Sanfoundry Global Education & Learning Series – SQL Server.

To practice all areas of SQL Server, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.