SlideShare une entreprise Scribd logo
1  sur  49
Anil Desai
http://AnilDesai.net
Austin CodeCamp 2010
 Anil Desai
◦ Independent consultant (Austin, TX)
◦ Author of numerous IT books
◦ Instructor, “Implementing and Managing SQL Server 2005”
(Keystone Learning)
◦ Info: http://AnilDesai.net or Anil@AnilDesai.net
I. Performance Monitoring Overview
II. Monitoring Database Servers
III. Using SQL Profiler
IV. Using the Database Engine Tuning Advisor
V. Application Design Tips
VI. Managing Processes, Locking, and Deadlocks
Developing processes and approaches for
performance optimization
 Best Practices:
◦ Optimize for
real-world
workloads
◦ Monitor/review
performance
regularly
◦ Focus on specific
issues
Establish a
baseline
Identify
bottlenecks
Make one
change at a time
Measure
performance
Repeat
(if desired)
System/OS
Windows Performance
Monitor
Alerts (Performance-
Based)
SQL Server
Activity Monitor
SQL Profiler / SQL Trace
Database Engine
Tuning Advisor
Dynamic Management
Views (DMVs)
Query-
Level
Database Engine
Tuning Advisor
Query Execution Plans
Server-Level
Issues
• Users are reporting database timeouts
• Intermittent transaction timeouts
• “The server/application seem sluggish”
Application-
Specific
Issues
• “Application A is running more slowly
than usual”
• “The End-of-Month report is taking too
long to run.”
Other Issues
• Ad-hoc reports are running slowly
• CPU, memory, disk, or network alerts
are being generated
Using SQL Server tools and features
to monitor database activity
 Available in all current versions of Windows
 Statistics are organized into:
◦ Objects
◦ Counters
◦ Instances
 Data Collector Sets
◦ Windows Vista / Windows 7 / Windows Server 2008
◦ Used to report on performance data that is collected over
time
◦ Includes built-in System Diagnostics and System Performance
collectors and reports
 Backup Device
◦ Device throughput Bytes/sec
 Buffer Manager
◦ Buffer cache hit ratio
◦ Page reads / sec
 Buffer Partition
◦ Free Pages
 Cache Manager
◦ Cache Hit Ratio
 Databases
◦ Active Transactions
◦ Data File Size
◦ Log Growths
◦ Percent Log Used
◦ Transactions / sec
Anil Desai 10
 General Statistics
◦ Logins | logouts / sec
◦ User Connections
 Latches
◦ Latch waits / sec
 Locks
◦ Lock requests / sec
◦ Lock waits / sec
 Memory Manager
◦ Everything!
 Replication
◦ Depends on configuration
 SQL Statistics
◦ Batch requests / sec
◦ SQL compilations / sec
 SQL Server Activity Monitor
◦ Provides a quick overview of database server activity
◦ CPU, Processes, Resource Waits and Disk I/O
◦ “Recent Expensive Queries”
 SQL Server Management Studio Reports
◦ Quick overview of SQL Server usage
◦ Can export to Excel or PDF
Server-Level Reports Database-Level Reports
 Server Dashboard
 Memory Consumption
 Activity – All Block
Transactions
 Activity – Top Sessions
 Performance – Batch
Execution Statistics
 Performance – Top Queries
by Average CPU
 Object Execution Statistics
 Disk Usage
 All Transactions
 All Blocking Transactions
 Index Usage Statistics
 Top Transactions by Age
 Schema Changes History
 Windows Event Logs / Event Viewer
◦ Application and System Event Logs
 SQL Server Management Studio
◦ SQL Server Logs
 Can configure max. # of log files
◦ SQL Server Agent Error logs
 Can configure logging levels (Errors, Warnings, Information)
 Using the Log File Viewer
◦ Can Export / Load log information
◦ Can search for specific errors/messages
 Purpose:
◦ Monitoring and troubleshooting
◦ View server state and performance details
◦ Returns relational result sets (use standard SELECT statements)
 Full list can be viewed in “Views  System Views” section
of the properties of the database
 Scopes:
◦ Server level
◦ Database level
•sys.dm_exec_requests
Query Execution / Processes
•sys.DM_DB_File_Space_Usage
Storage Engine
•sys.DM_DB_Index_Operational_Stats
•sys.DM_DB_Index_Physical_Stats
Indexes
•sys.DM_IO_Pending_IO_Requests
•sys.DM_IO_Virtual_File_Stats
Disk I/O
•Schema information | Common Language Runtime (CLR)
•Database Mirror / Clustering | Replication
Other Categories
 Data Collected:
◦ System Information (MSINFO)
◦ Windows Event Logs
◦ SQL Server configuration
 Command-Line Utility (SQLDiag.exe)
◦ Stores output to files
◦ Configuration file: SQLDiag.xml
◦ Can run as a service (/R)
◦ Can run in continuous mode
Monitoring SQL Server Activity
 Purpose / Features:
◦ GUI for managing SQL Trace
◦ Monitor important events
◦ Capture performance data / resource usage
◦ Replaying of workloads / transactions
◦ Identifying performance bottlenecks
◦ Correlation of data with System Monitor
◦ Workloads for Database Tuning Advisor
 Examples:
◦ Generate a list of the 100 slowest queries
◦ Monitor all failed logins (Security)
 SQL Profiler Terminology
◦ Trace Definitions
◦ Events
◦ Columns
◦ Filters
 Creating and Managing SQL Traces
◦ SQL Profiler (GUI)
◦ System Stored Procedures (Transact-SQL)
 Trace Templates (Built-In)
◦ Standard (Default), SP_Counts
◦ TSQL, TSQL_Duration, TSQL_Grouped,TSQL_Replay, TSQL_SPs
◦ Tuning
Anil Desai20
 Trace
◦ A set of events, data columns and filters that specify what data should be
collected
◦ Data can be saved to a file or a database table
 Trace File
◦ Trace data that is saved to a binary file
◦ Default extension is “.trc”
 Trace Table
◦ A SQL Server database table in which trace information is stored
◦ Profiler will automatically create the structure of this table when you start
running a new trace
 Trace Template
◦ Saved specifications that can be used as the basis for new traces
◦ E.g., an environment may have a “Security Monitoring template”, a “CRM
Application Performance”, etc.
◦ Default extension is “.tdf”
 Groupings:
◦ Event Categories
◦ Event Classes
◦ Events
 Examples:
◦ TSQL
◦ Stored Procedures
◦ Performance
◦ Errors and Warnings
◦ Security auditing
Event
Categories
Event Classes
Events
 Specifies the details to be monitored/recorded
 Configuring columns
◦ Columns can be ordered and grouped
◦ Values can be filtered
 Examples of Columns:
◦ StartTime / EndTime
◦ TextData
◦ Duration
◦ Resource Usage (CPU, Reads, Writes)
◦ Information: User, Database, App. Names
 Interactive
◦ Good for “live” monitoring of small sets of data
 Trace Files (*.trc)
◦ Can enable file rollover based on size
◦ “Server processes trace data” option
 Trace table
◦ Will automatically create the table
◦ Can set maximum number of rows
 Scheduling of traces (stop time)
 Launching SQL Profiler
 Connecting to a database instance
 Configuring output options
 Create a trace definition
 Specifying events, columns, and filters
 Running and viewing a trace
 Creating new templates using SQL Profiler
 Scripting trace definitions
◦ sp_trace_create
◦ sp_trace_setfilter
◦ sp_trace_GenerateEvent
◦ sp_trace_SetEvent
◦ sp_trace_SetStatus
 Extracting SQL Server Events
◦ Transact-SQL Events
◦ ShowPlan Events
◦ Deadlock Events
 Purpose / Goal:
◦ Correlate server performance with database performance
 Process:
◦ Define and start a counter log
◦ Define and start a SQL Profiler trace
◦ Import Performance Data in SQL Profiler
 Required Trace properties
◦ StartTime
◦ EndTime
Analyzing workloads to optimize
physical database structures
 Reviews sample workloads and makes performance
recommendations
 Evaluates Physical Design Structures (PDS)
◦ Indexes (clustered, non-clustered)
◦ Indexed Views
◦ Partitions
 Numerous analysis options
 Output
◦ Generates modification scripts
◦ Generates Reports for later analysis
 Files
◦ Transact-SQL Files
◦ XML Files
◦ Should represent commonly-used queries
 SQL Profiler Trace Files / Tables
◦ Use Tuning built-in trace template
◦ Events:
 Transact-SQL Batch
 Remote Procedure Call (RPC)
◦ Columns: Event Class and Text Data
 Limit tuning time
 Tuning Options
◦ Allowed Physical Design Structures (PDS)
◦ Keep all/specific existing objects
◦ Maximum storage space
◦ Online or offline recommendations
◦ Partitioning
 Reports can be exported to XML files
 Report Examples:
Workload
analysis
Column access Table access
View-Table
Relations
Statement cost Event frequency
Index Usage
(current /
recommended)
 Process:
◦ Generate a workload (file or table)
◦ Select tuning options
◦ Run the analysis
◦ View reports
◦ Save and/or apply recommendations
 Running the DTA:
◦ Database Engine Tuning Advisor Application (GUI)
◦ Dta.exe command-line utility
Practical ways to improve database
application performance
 Create an abstraction layer between the database and
the presentation code
◦ Separates presentation and logic (esp. in Web Apps)
◦ Example: ADO.NET Datasets
 Database design:
◦ Understand typical use-cases before designing the database
◦ Create and enforce naming conventions
◦ Balance write (OLTP) and read (reporting) performance
requirements
◦ Use strategic denormalization
Anil Desai34
 Never include actions that require user input within a
transaction
 Use connection pooling, whenever possible
◦ Open connections late and close them early
◦ Avoid unnecessary server round-trips
 Use client-side caching whenever possible
◦ Optimistic concurrency
◦ Pessimistic concurrency
 Distribute processing
◦ Some operations are more efficient on the DB server (e.g.,
aggregations, sorting, etc.)
Troubleshooting common SQL
Server performance problems
 Processes
◦ Interactive users
 SQL Server Management Studio
◦ Applications (Connection Pooling)
 SQL Profiler
 Database Engine Tuning Advisor
 Replication
 Service Broker
 Process IDs < 50 are system-related
 SQL Server Activity Monitor
◦ Processes (connected users)
◦ Locks (by Process / by Object)
◦ Filtering options
◦ Auto-refresh option
 System Stored Procedures / Views
◦ Sys.DM_Exec_Sessions
◦ Sys.DM_Exec_Requests
◦ Sys.SysProcesses
◦ sp_who / sp_who2
 Process Information
◦ Current Process ID: @@SPID
◦ Session Options: DBCC USEROPTIONS
 Killing Processes
◦ KILL ProcessID [WITH STATUSONLY]
 Viewing Last Activity
◦ DBCC INPUTBUFFER(ProcessID)
◦ DBCC OUTPUTBUFFER(ProcessID)
 Coordinates multiple accesses to the same data
 Ensures ACID Properties for transactions (Atomic,
Consistent, Independent, Durable)
 Contention can reduce performance
 Locking granularity:
◦ Row-Level, Page-Level, Table-Level, etc.
 Lock Modes:
◦ Shared, Exclusive, etc.
 Lock escalation
 Blocking
◦ When transaction(s) must wait for a lock on a resource
◦ LOCK_TIMEOUT setting (default = wait forever)
 Locking Models:
◦ Pessimistic
◦ Optimistic
 Balance of concurrency (performance) vs. consistency
◦ Affects SELECT queries
◦ SET TRANSACTION ISOLATION LEVEL
 Transaction Isolation Levels
◦ READ UNCOMMITTED
◦ READ COMMITTED (default)
◦ REPEATABLE READ
◦ SERIALIZABLE
◦ SNAPSHOT
 Row-Versioning:
◦ ALLOW_SNAPSHOT_ISOLATION
◦ READ_COMMITTED_SNAPSHOT
 Activity Monitor
 SQL Profiler
◦ Locks Event Category
 System Monitor:
◦ SQL Server  Locks Object
 System Views
◦ Sys.DM_Tran_Locks
◦ Sys.DM_Exec_Requests
 System Stored Procedures
◦ sp_Lock
 Deadlocks:
◦ Two or more tasks permanently block each other based on
resource locks
◦ Default resolution is within 5 seconds
 Deadlock victim
◦ Transaction is rolled-back
◦ Process receives a 1205 error
 Example:
◦ Process 1 locks the Customers table and requires access to
the Orders Table
◦ Process 2 locks the Orders table and requires access to the
Customers Table
 Minimize transaction times
◦ Commit / Rollback transactions as quickly as possibly
◦ Avoid user-related time within a transaction
 Access objects in a consistent order
 Change the transaction isolation level
◦ Use a lower level isolation level, if appropriate
◦ Use snapshot-based isolation levels
 Deadlock priorities:
◦ SET DEADLOCK_PRIORITY (LOW, NORMAL, HIGH,
integer)
 Deadlock resolution:
◦ Lower priority is killed first
◦ If equal priorities, least expensive transaction becomes the
victim
◦ Application or user should attempt to re-run the transaction
 SQL Server Error Log
 SQL Profiler
◦ Locks Event Category
 Lock:Deadlock Chain
 Lock:Deadlock
 Deadlock Graph
◦ Events Extraction Trace Property
◦ Export deadlock XML (.xdl) file
 Viewing Deadlock Files
◦ SQL Server Management Studio (File  Open  SQL
Deadlock Files (*.xdl)
For more information:
http://AnilDesai.net
Anil@AnilDesai.net

Contenu connexe

Tendances

SQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First TimeSQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First TimeDean Richards
 
Sql server performance tuning and optimization
Sql server performance tuning and optimizationSql server performance tuning and optimization
Sql server performance tuning and optimizationManish Rawat
 
Why & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryWhy & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryAntonios Chatzipavlis
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuningYogiji Creations
 
Schema migration in agile environmnets
Schema migration in agile environmnetsSchema migration in agile environmnets
Schema migration in agile environmnetsVivek Dhayalan
 
ORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAININGORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAININGtraining3
 
Sql architecture
Sql architectureSql architecture
Sql architecturerchakra
 
Liquibase - Open Source version control for your database
Liquibase - Open Source version control for your databaseLiquibase - Open Source version control for your database
Liquibase - Open Source version control for your databaseBlaine Carter
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architectureSoumya Das
 
SQL Server 2016 new features
SQL Server 2016 new featuresSQL Server 2016 new features
SQL Server 2016 new featuresSpanishPASSVC
 
Performance Management in Oracle 12c
Performance Management in Oracle 12cPerformance Management in Oracle 12c
Performance Management in Oracle 12cAlfredo Krieg
 
Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?IDERA Software
 
Sql server performance tuning
Sql server performance tuningSql server performance tuning
Sql server performance tuningngupt28
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowKevin Kline
 

Tendances (19)

SQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First TimeSQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First Time
 
Sql server performance tuning and optimization
Sql server performance tuning and optimizationSql server performance tuning and optimization
Sql server performance tuning and optimization
 
A to z for sql azure databases
A to z for sql azure databasesA to z for sql azure databases
A to z for sql azure databases
 
Why & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryWhy & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to query
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
 
Oracle 10g Introduction 1
Oracle 10g Introduction 1Oracle 10g Introduction 1
Oracle 10g Introduction 1
 
Schema migration in agile environmnets
Schema migration in agile environmnetsSchema migration in agile environmnets
Schema migration in agile environmnets
 
ORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAININGORACLE CORE DBA ONLINE TRAINING
ORACLE CORE DBA ONLINE TRAINING
 
Sql architecture
Sql architectureSql architecture
Sql architecture
 
Lecture12
Lecture12Lecture12
Lecture12
 
ora_sothea
ora_sotheaora_sothea
ora_sothea
 
Liquibase - Open Source version control for your database
Liquibase - Open Source version control for your databaseLiquibase - Open Source version control for your database
Liquibase - Open Source version control for your database
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 
SQL Server 2016 new features
SQL Server 2016 new featuresSQL Server 2016 new features
SQL Server 2016 new features
 
Performance Management in Oracle 12c
Performance Management in Oracle 12cPerformance Management in Oracle 12c
Performance Management in Oracle 12c
 
Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?
 
Sql server performance tuning
Sql server performance tuningSql server performance tuning
Sql server performance tuning
 
SQL server Backup Restore Revealed
SQL server Backup Restore RevealedSQL server Backup Restore Revealed
SQL server Backup Restore Revealed
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 

Similaire à Sql server-performance-hafi

SQL Reporting Services
SQL Reporting ServicesSQL Reporting Services
SQL Reporting Servicesneha mittal
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1sqlserver.co.il
 
Best Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and DeltaBest Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and DeltaDatabricks
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance TuningBala Subra
 
R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07zeesniper
 
Netvu test slideshow
Netvu test slideshowNetvu test slideshow
Netvu test slideshowRyan Deeds
 
Expert summit SQL Server 2016
Expert summit   SQL Server 2016Expert summit   SQL Server 2016
Expert summit SQL Server 2016Łukasz Grala
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12Ala Qunaibi
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12Ala Qunaibi
 
Saying goodbye to SQL Server 2000
Saying goodbye to SQL Server 2000Saying goodbye to SQL Server 2000
Saying goodbye to SQL Server 2000ukdpe
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availabilityPeter Gfader
 
Practical SQL query monitoring and optimization
Practical SQL query monitoring and optimizationPractical SQL query monitoring and optimization
Practical SQL query monitoring and optimizationIvo Andreev
 
Rock Solid SQL Server Management
Rock Solid SQL Server ManagementRock Solid SQL Server Management
Rock Solid SQL Server ManagementTony Bain
 
Introduction to sql database on azure
Introduction to sql database on azureIntroduction to sql database on azure
Introduction to sql database on azureAntonios Chatzipavlis
 
SQL Server and System Center Advisor
SQL Server and System Center AdvisorSQL Server and System Center Advisor
SQL Server and System Center AdvisorEduardo Castro
 
Getting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suiteGetting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suiteaioughydchapter
 

Similaire à Sql server-performance-hafi (20)

SQL Reporting Services
SQL Reporting ServicesSQL Reporting Services
SQL Reporting Services
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
Sql server basics
Sql server basicsSql server basics
Sql server basics
 
Best Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and DeltaBest Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and Delta
 
Monitor database essentials with Applications Manager
Monitor database essentials with Applications ManagerMonitor database essentials with Applications Manager
Monitor database essentials with Applications Manager
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
 
MS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTUREMS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTURE
 
R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07
 
Netvu test slideshow
Netvu test slideshowNetvu test slideshow
Netvu test slideshow
 
Expert summit SQL Server 2016
Expert summit   SQL Server 2016Expert summit   SQL Server 2016
Expert summit SQL Server 2016
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12
 
Sql server lesson12
Sql server lesson12Sql server lesson12
Sql server lesson12
 
Saying goodbye to SQL Server 2000
Saying goodbye to SQL Server 2000Saying goodbye to SQL Server 2000
Saying goodbye to SQL Server 2000
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
Practical SQL query monitoring and optimization
Practical SQL query monitoring and optimizationPractical SQL query monitoring and optimization
Practical SQL query monitoring and optimization
 
Rock Solid SQL Server Management
Rock Solid SQL Server ManagementRock Solid SQL Server Management
Rock Solid SQL Server Management
 
Introduction to sql database on azure
Introduction to sql database on azureIntroduction to sql database on azure
Introduction to sql database on azure
 
SQL Server and System Center Advisor
SQL Server and System Center AdvisorSQL Server and System Center Advisor
SQL Server and System Center Advisor
 
Auditing Data Access in SQL Server
Auditing Data Access in SQL ServerAuditing Data Access in SQL Server
Auditing Data Access in SQL Server
 
Getting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suiteGetting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suite
 

Dernier

How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityEric T. Tung
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxWorkforce Group
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...rajveerescorts2022
 
Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noidadlhescort
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptxnandhinijagan9867
 
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al MizharAl Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizharallensay1
 
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Sheetaleventcompany
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...amitlee9823
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...amitlee9823
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLkapoorjyoti4444
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwaitdaisycvs
 
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...Falcon Invoice Discounting
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Adnet Communications
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture conceptP&CO
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756dollysharma2066
 

Dernier (20)

How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al MizharAl Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
Call Girls Kengeri Satellite Town Just Call 👗 7737669865 👗 Top Class Call Gir...
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
Unveiling Falcon Invoice Discounting: Leading the Way as India's Premier Bill...
 
Falcon Invoice Discounting platform in india
Falcon Invoice Discounting platform in indiaFalcon Invoice Discounting platform in india
Falcon Invoice Discounting platform in india
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture concept
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
 

Sql server-performance-hafi

  • 2.  Anil Desai ◦ Independent consultant (Austin, TX) ◦ Author of numerous IT books ◦ Instructor, “Implementing and Managing SQL Server 2005” (Keystone Learning) ◦ Info: http://AnilDesai.net or Anil@AnilDesai.net
  • 3. I. Performance Monitoring Overview II. Monitoring Database Servers III. Using SQL Profiler IV. Using the Database Engine Tuning Advisor V. Application Design Tips VI. Managing Processes, Locking, and Deadlocks
  • 4. Developing processes and approaches for performance optimization
  • 5.  Best Practices: ◦ Optimize for real-world workloads ◦ Monitor/review performance regularly ◦ Focus on specific issues Establish a baseline Identify bottlenecks Make one change at a time Measure performance Repeat (if desired)
  • 6. System/OS Windows Performance Monitor Alerts (Performance- Based) SQL Server Activity Monitor SQL Profiler / SQL Trace Database Engine Tuning Advisor Dynamic Management Views (DMVs) Query- Level Database Engine Tuning Advisor Query Execution Plans
  • 7. Server-Level Issues • Users are reporting database timeouts • Intermittent transaction timeouts • “The server/application seem sluggish” Application- Specific Issues • “Application A is running more slowly than usual” • “The End-of-Month report is taking too long to run.” Other Issues • Ad-hoc reports are running slowly • CPU, memory, disk, or network alerts are being generated
  • 8. Using SQL Server tools and features to monitor database activity
  • 9.  Available in all current versions of Windows  Statistics are organized into: ◦ Objects ◦ Counters ◦ Instances  Data Collector Sets ◦ Windows Vista / Windows 7 / Windows Server 2008 ◦ Used to report on performance data that is collected over time ◦ Includes built-in System Diagnostics and System Performance collectors and reports
  • 10.  Backup Device ◦ Device throughput Bytes/sec  Buffer Manager ◦ Buffer cache hit ratio ◦ Page reads / sec  Buffer Partition ◦ Free Pages  Cache Manager ◦ Cache Hit Ratio  Databases ◦ Active Transactions ◦ Data File Size ◦ Log Growths ◦ Percent Log Used ◦ Transactions / sec Anil Desai 10  General Statistics ◦ Logins | logouts / sec ◦ User Connections  Latches ◦ Latch waits / sec  Locks ◦ Lock requests / sec ◦ Lock waits / sec  Memory Manager ◦ Everything!  Replication ◦ Depends on configuration  SQL Statistics ◦ Batch requests / sec ◦ SQL compilations / sec
  • 11.  SQL Server Activity Monitor ◦ Provides a quick overview of database server activity ◦ CPU, Processes, Resource Waits and Disk I/O ◦ “Recent Expensive Queries”  SQL Server Management Studio Reports ◦ Quick overview of SQL Server usage ◦ Can export to Excel or PDF
  • 12. Server-Level Reports Database-Level Reports  Server Dashboard  Memory Consumption  Activity – All Block Transactions  Activity – Top Sessions  Performance – Batch Execution Statistics  Performance – Top Queries by Average CPU  Object Execution Statistics  Disk Usage  All Transactions  All Blocking Transactions  Index Usage Statistics  Top Transactions by Age  Schema Changes History
  • 13.  Windows Event Logs / Event Viewer ◦ Application and System Event Logs  SQL Server Management Studio ◦ SQL Server Logs  Can configure max. # of log files ◦ SQL Server Agent Error logs  Can configure logging levels (Errors, Warnings, Information)  Using the Log File Viewer ◦ Can Export / Load log information ◦ Can search for specific errors/messages
  • 14.  Purpose: ◦ Monitoring and troubleshooting ◦ View server state and performance details ◦ Returns relational result sets (use standard SELECT statements)  Full list can be viewed in “Views  System Views” section of the properties of the database  Scopes: ◦ Server level ◦ Database level
  • 15. •sys.dm_exec_requests Query Execution / Processes •sys.DM_DB_File_Space_Usage Storage Engine •sys.DM_DB_Index_Operational_Stats •sys.DM_DB_Index_Physical_Stats Indexes •sys.DM_IO_Pending_IO_Requests •sys.DM_IO_Virtual_File_Stats Disk I/O •Schema information | Common Language Runtime (CLR) •Database Mirror / Clustering | Replication Other Categories
  • 16.  Data Collected: ◦ System Information (MSINFO) ◦ Windows Event Logs ◦ SQL Server configuration  Command-Line Utility (SQLDiag.exe) ◦ Stores output to files ◦ Configuration file: SQLDiag.xml ◦ Can run as a service (/R) ◦ Can run in continuous mode
  • 18.  Purpose / Features: ◦ GUI for managing SQL Trace ◦ Monitor important events ◦ Capture performance data / resource usage ◦ Replaying of workloads / transactions ◦ Identifying performance bottlenecks ◦ Correlation of data with System Monitor ◦ Workloads for Database Tuning Advisor  Examples: ◦ Generate a list of the 100 slowest queries ◦ Monitor all failed logins (Security)
  • 19.  SQL Profiler Terminology ◦ Trace Definitions ◦ Events ◦ Columns ◦ Filters  Creating and Managing SQL Traces ◦ SQL Profiler (GUI) ◦ System Stored Procedures (Transact-SQL)  Trace Templates (Built-In) ◦ Standard (Default), SP_Counts ◦ TSQL, TSQL_Duration, TSQL_Grouped,TSQL_Replay, TSQL_SPs ◦ Tuning
  • 20. Anil Desai20  Trace ◦ A set of events, data columns and filters that specify what data should be collected ◦ Data can be saved to a file or a database table  Trace File ◦ Trace data that is saved to a binary file ◦ Default extension is “.trc”  Trace Table ◦ A SQL Server database table in which trace information is stored ◦ Profiler will automatically create the structure of this table when you start running a new trace  Trace Template ◦ Saved specifications that can be used as the basis for new traces ◦ E.g., an environment may have a “Security Monitoring template”, a “CRM Application Performance”, etc. ◦ Default extension is “.tdf”
  • 21.  Groupings: ◦ Event Categories ◦ Event Classes ◦ Events  Examples: ◦ TSQL ◦ Stored Procedures ◦ Performance ◦ Errors and Warnings ◦ Security auditing Event Categories Event Classes Events
  • 22.  Specifies the details to be monitored/recorded  Configuring columns ◦ Columns can be ordered and grouped ◦ Values can be filtered  Examples of Columns: ◦ StartTime / EndTime ◦ TextData ◦ Duration ◦ Resource Usage (CPU, Reads, Writes) ◦ Information: User, Database, App. Names
  • 23.  Interactive ◦ Good for “live” monitoring of small sets of data  Trace Files (*.trc) ◦ Can enable file rollover based on size ◦ “Server processes trace data” option  Trace table ◦ Will automatically create the table ◦ Can set maximum number of rows  Scheduling of traces (stop time)
  • 24.  Launching SQL Profiler  Connecting to a database instance  Configuring output options  Create a trace definition  Specifying events, columns, and filters  Running and viewing a trace
  • 25.  Creating new templates using SQL Profiler  Scripting trace definitions ◦ sp_trace_create ◦ sp_trace_setfilter ◦ sp_trace_GenerateEvent ◦ sp_trace_SetEvent ◦ sp_trace_SetStatus  Extracting SQL Server Events ◦ Transact-SQL Events ◦ ShowPlan Events ◦ Deadlock Events
  • 26.  Purpose / Goal: ◦ Correlate server performance with database performance  Process: ◦ Define and start a counter log ◦ Define and start a SQL Profiler trace ◦ Import Performance Data in SQL Profiler  Required Trace properties ◦ StartTime ◦ EndTime
  • 27. Analyzing workloads to optimize physical database structures
  • 28.  Reviews sample workloads and makes performance recommendations  Evaluates Physical Design Structures (PDS) ◦ Indexes (clustered, non-clustered) ◦ Indexed Views ◦ Partitions  Numerous analysis options  Output ◦ Generates modification scripts ◦ Generates Reports for later analysis
  • 29.  Files ◦ Transact-SQL Files ◦ XML Files ◦ Should represent commonly-used queries  SQL Profiler Trace Files / Tables ◦ Use Tuning built-in trace template ◦ Events:  Transact-SQL Batch  Remote Procedure Call (RPC) ◦ Columns: Event Class and Text Data
  • 30.  Limit tuning time  Tuning Options ◦ Allowed Physical Design Structures (PDS) ◦ Keep all/specific existing objects ◦ Maximum storage space ◦ Online or offline recommendations ◦ Partitioning
  • 31.  Reports can be exported to XML files  Report Examples: Workload analysis Column access Table access View-Table Relations Statement cost Event frequency Index Usage (current / recommended)
  • 32.  Process: ◦ Generate a workload (file or table) ◦ Select tuning options ◦ Run the analysis ◦ View reports ◦ Save and/or apply recommendations  Running the DTA: ◦ Database Engine Tuning Advisor Application (GUI) ◦ Dta.exe command-line utility
  • 33. Practical ways to improve database application performance
  • 34.  Create an abstraction layer between the database and the presentation code ◦ Separates presentation and logic (esp. in Web Apps) ◦ Example: ADO.NET Datasets  Database design: ◦ Understand typical use-cases before designing the database ◦ Create and enforce naming conventions ◦ Balance write (OLTP) and read (reporting) performance requirements ◦ Use strategic denormalization Anil Desai34
  • 35.  Never include actions that require user input within a transaction  Use connection pooling, whenever possible ◦ Open connections late and close them early ◦ Avoid unnecessary server round-trips  Use client-side caching whenever possible ◦ Optimistic concurrency ◦ Pessimistic concurrency  Distribute processing ◦ Some operations are more efficient on the DB server (e.g., aggregations, sorting, etc.)
  • 36. Troubleshooting common SQL Server performance problems
  • 37.  Processes ◦ Interactive users  SQL Server Management Studio ◦ Applications (Connection Pooling)  SQL Profiler  Database Engine Tuning Advisor  Replication  Service Broker  Process IDs < 50 are system-related
  • 38.  SQL Server Activity Monitor ◦ Processes (connected users) ◦ Locks (by Process / by Object) ◦ Filtering options ◦ Auto-refresh option  System Stored Procedures / Views ◦ Sys.DM_Exec_Sessions ◦ Sys.DM_Exec_Requests ◦ Sys.SysProcesses ◦ sp_who / sp_who2
  • 39.  Process Information ◦ Current Process ID: @@SPID ◦ Session Options: DBCC USEROPTIONS  Killing Processes ◦ KILL ProcessID [WITH STATUSONLY]  Viewing Last Activity ◦ DBCC INPUTBUFFER(ProcessID) ◦ DBCC OUTPUTBUFFER(ProcessID)
  • 40.  Coordinates multiple accesses to the same data  Ensures ACID Properties for transactions (Atomic, Consistent, Independent, Durable)  Contention can reduce performance  Locking granularity: ◦ Row-Level, Page-Level, Table-Level, etc.  Lock Modes: ◦ Shared, Exclusive, etc.  Lock escalation
  • 41.  Blocking ◦ When transaction(s) must wait for a lock on a resource ◦ LOCK_TIMEOUT setting (default = wait forever)  Locking Models: ◦ Pessimistic ◦ Optimistic
  • 42.  Balance of concurrency (performance) vs. consistency ◦ Affects SELECT queries ◦ SET TRANSACTION ISOLATION LEVEL  Transaction Isolation Levels ◦ READ UNCOMMITTED ◦ READ COMMITTED (default) ◦ REPEATABLE READ ◦ SERIALIZABLE ◦ SNAPSHOT  Row-Versioning: ◦ ALLOW_SNAPSHOT_ISOLATION ◦ READ_COMMITTED_SNAPSHOT
  • 43.  Activity Monitor  SQL Profiler ◦ Locks Event Category  System Monitor: ◦ SQL Server  Locks Object  System Views ◦ Sys.DM_Tran_Locks ◦ Sys.DM_Exec_Requests  System Stored Procedures ◦ sp_Lock
  • 44.  Deadlocks: ◦ Two or more tasks permanently block each other based on resource locks ◦ Default resolution is within 5 seconds  Deadlock victim ◦ Transaction is rolled-back ◦ Process receives a 1205 error  Example: ◦ Process 1 locks the Customers table and requires access to the Orders Table ◦ Process 2 locks the Orders table and requires access to the Customers Table
  • 45.  Minimize transaction times ◦ Commit / Rollback transactions as quickly as possibly ◦ Avoid user-related time within a transaction  Access objects in a consistent order  Change the transaction isolation level ◦ Use a lower level isolation level, if appropriate ◦ Use snapshot-based isolation levels
  • 46.  Deadlock priorities: ◦ SET DEADLOCK_PRIORITY (LOW, NORMAL, HIGH, integer)  Deadlock resolution: ◦ Lower priority is killed first ◦ If equal priorities, least expensive transaction becomes the victim ◦ Application or user should attempt to re-run the transaction
  • 47.  SQL Server Error Log  SQL Profiler ◦ Locks Event Category  Lock:Deadlock Chain  Lock:Deadlock  Deadlock Graph ◦ Events Extraction Trace Property ◦ Export deadlock XML (.xdl) file  Viewing Deadlock Files ◦ SQL Server Management Studio (File  Open  SQL Deadlock Files (*.xdl)
  • 48.