Identify and Resolve Database Performance Problems
Identify and Resolve Database Performance Problems
MODULE CONTENTS:
MODULE CONTENTS:
LO1. Diagnose problems
1.1 Identify Diagnose Tool based on organizational database requirements
1.1.1 Obtain Diagnose Tool
1.1.2 run diagnostic tools
1.1.2.1 Identify latch contentions
1.1.2.2 Identify events causing waits and record outcomes
1.2 determining and recording inappropriate use of database
1.4 Fixing The Database based on diagnostic results
Latches are low level serialization mechanisms used to protect shared data structures system global area.
The implementation of latches is operating system dependent, particularly in regard to whether a process will wait
for a latch and for how long.
A latch is a type of a lock that can be used to prevent more than one process from executing the same piece of code
at a given time.
1.1.2.3 Identify events causing waits and record outcomes
SQL Server Extended Events (Extended Events) is a general event-handling system for server systems.
The Extended Events infrastructure supports the correlation of data from SQL Server, and under certain conditions,
the correlation of data from the operating system and database applications. In the latter case, Extended Events
output must be directed to Event Tracing for Windows (ETW) in order to correlate the event data with operating
system or application event data.
1.1 Determining and recording inappropriate use of database
1.4 Fixing The Database based on diagnostic results
When problems occur with a system, it is important to perform accurate and timely diagnosis of the problem before
making any changes to a system. Often a database administrator (DBA) simply looks at the symptoms and
immediately starts changing the system to fix those symptoms. However, long-time experience has shown that an
initial accurate diagnosis of the actual problem significantly increases the probability of success in resolving the
problem.
Automatic Database Diagnostic Monitor
The types of problems that ADDM considers include:
CPU bottlenecks
Undersized Memory Structures
I/O capacity issues
Database configuration issues
Concurrency issues
In addition to problem diagnostics, ADDM recommends possible solutions. When appropriate, ADDM recommends
multiple solutions for the DBA to choose from.
The recommendations include:
Hardware changes - Adding CPUs or changing the I/O subsystem configuration
Schema changes
Application changes
Secure Backup
Passwords are not required to perform backup operations, but they provide an added level of security. You can use
them in addition to using SQL Server security roles. The use of password protection helps guard against
unauthorized or unintentional actions such as:
Restoration of databases
Backup type
SQL Server has different types of backups
-
- Full Backup
- Incremental Backup
. Transaction Log backup
. Differential backup
. File and file group backup
Difference between: Full, Differential, and Incremental Backup
Type Definition Benefits Drawbacks
Restoration is fast, since The backing up process is
Full A complete backup of everything you want
you only need one set of slow.
Backup to backup.
backup data. High storage requirements.
Faster to create than a full
Restoration is slower than
The backup software looks at which files backup.
using a full backup.
have changed since you last did a full
Differential backup. Restoration is faster than
Creating a differential
Backup: For restoring all the data, you will only need using incremental backup.
backup is slower than
the last full backup, and the last differential
creating an incremental
backup. Not as much storage
backup.
needed as in a full backup.
The backup software creates copies of all
This method is the fastest Restoring from
the files, or parts of files that have changed
when creating a backup. incremental backups is the
Incrementa since previous backups of any type (full,
slowest because to restore
l Backup differential or incremental).
The least storage space is the data would require you
needed. to process the full backup
Note: The database must have full back up in order to take a differential backup, it only backups the changes since
last full backup.
Full/Differential/Transaction Log Backup using SQL Server Management Studio
. Right click on the database name
. Select Tasks > Backup
. Select backup type either "Full" or "Differential" or” Transaction Logl”
. Select the appropriate Backup Destination and click "OK"
File or File Groups Backup using SQL Server Management Studio
o Right click on the database name
o Select Tasks > Backup
o Select backup type either "Full" or "Differential"
o Select Backup component as "Files and file groups"
o Select the appropriate file group
Backup Mode
Offline
Offline backup is a way to store files from a network so that they will be accessible even when the user is not
connected to the network they are stored on.
Online
Online backup, also known as remote backup, is a method of offsite data storage in which files, folders, or the entire
contents of a hard drive are regularly backed up on a remote server or computer with a network connection.
Online backup means to back up data from your hard drive to a remote server or computer using a network
connection.
Configuring and testing database performance
You need to configure the SQL server database to work with the application properly.
You can improve performance by considering the following items when configuring the database and log files.
1. Pre-allocating the space required for database files and log files will improve performance.
2. Allowing the log files to grow automatically is required to ensure that unexpected errors do not occur.
3. Placing the data files and log files on separate physical disk drives will improve performance substantially.
Make sure that these physical disk drives have enough free space to allow for database growth.
4. The database must be backed up regularly, and other database maintenance tasks must be performed from
time to time.
Database maintenance
After the application has been successfully installed, a database maintenance plan must be established.
Use the 'Maintenance Plan Wizard' to create the plan and schedule it. In the wizard, select these options:
Check database integrity
Shrink the database
Reorganize the index
Update statistics
Do a full backup of the database
Tune memory
Each process running on a computer requires a certain amount of memory to temporarily store its machine code and
data. Database management systems (DBMS) also employ shared memory to store data used by many client
applications. Memory tuning involves the allocation of the memory resource to the various components of the
database management system.
Memory management is all about allocation of objects. A correctly tuned memory management system minimizes
the overhead inflicted by garbage collection and makes object allocation fast.
Note: - Contentions are detected, identified and resolved that may arise in the real-time operation of the database.
- Database must be reconfigured according to organizational specifications