Troubleshooting SQL Databases is an operation that supposes multiple actions. They are described below. Optimizing Database PerformanceDatabase performance is an important part of administering a SQL Server 2000 environment. There are many ways that performance can be increased including indexing, locking and recompiling. Indexing Establishing indexes can dramatically increase query performance, but can also adversely affect data modification performance. Any changes to an indexed table have to be reflected in the indexes to that table, and all changes are logged. These factors combine to produce a slowdown in data modification tasks. Locking To ensure that data changed by one user does not unexpectedly affect another user’s operations, SQL Server 2000 uses locks. Locking holds data that is in use by another process. The extent of the hold depends on the options that have been configured on the lock. Locks can decrease system performance if over-implemented. There are four transaction isolation levels that are enforced through locking:
Recompiling When a SQL statement is compiled, it is also optimized for the database object that it is working on. Optimization of a SQL statement is based on the information available at the time. Since data or structures may change over time, it may be necessary to recompile SQL statements to maintain performance. Statistics Statistics contain information on how key values are distributed in a table. Statistics are useful in increasing query response time as they give the query engine a better idea on where to begin a search for a particular value in a table. As data changes in a table, statistics should be updated to reflect the changes. Tables can be configured to automatically create and automatically update statistics. Optimizing Data StorageOptimizing Filegroups There are situations when certain systems can improve performance by controlling the placement of data and indexes onto specific disk drives. can aid this process by specifying the drives on which files will reside. The system administrator can create filegroups for each disk drive and assign specific tables or indexes from a table to specific filegroups. Managing Database Fragmentation There are two types of fragmentation in a SQL database, internal and external fragmentation. Internal fragmentation occurs when indexes are inefficiently using space. External fragmentation occurs when the physical order of pages does not match the logical order. The best way to rid your database of fragmentation is to use the DBCC INDEXDEFRAG command. This command will defragment the index while still allowing access to the table the index refers to. Disaster RecoveryBackup Operations There are three different kinds of backups that can be performed on a SQL 2000 Server database:
Recovery Methods Setting the recovery method determines how quickly you can restore transaction log backups in the case of hardware failure. Recovery method also dictates the size of the resulting transaction log backup and the degree to which the database is secure from losing committed transactions upon restoration. SIMPLE Model The simple recovery model requires the lowest amount of system resources. The system often truncates the transaction log which means that only full and differential backups are allowed. BULK_LOGGED Model The recovery model allows you to completely restore your database in case of hardware failure. Operations are fully, but only minimally, logged. This leads to a middle ground compromise between disk space utilization, speed, and safety. FULL Recovery Model A transaction log that operates using the full recovery model is has the least risk of losing transactions. All events are fully logged. This logging is useful for restoration but it can lead to massive transaction log sizes and disk space complications. Log ShippingLog shipping is a feature that backs up transaction logs and transmits those backups to a fallback server that is to be used in case of failure of the primary server. Log shipping automates these backups at a user-specified interval and automatically restores them on the backup server. To implement log shipping the logon IDs for both the original server and the fallback server must be synchronized to enable users to log into the server in case of original server failure. The SIMPLE recovery mode cannot be used in log shipping as it does not allow transaction log backups. Integrity checksDatabase Consistency Checker (DBCC) The DBCC is a collection of utilities that are used to check the integrity of a database. These utilities can be used to detect and repair problems in a database. Commands that are included in the Database Consistency Checker are preceded with DBCC. Consistency checking commands in the DBCC include the following:
Database Maintenance Plan Wizard The Database Maintenance Plan Wizard is a utility that aids in creating a maintenance plan for a SQL Server 2000 database. You can use the Database Maintenance Plan Wizard to create and schedule a backup scheme that will backup on a designated schedule or will backup based on a defined level of database activity. As part of the backup process, the Database Maintenance Plan Wizard can configure log shipping. The Database Maintenance Plan Wizard can also be used to automatically run maintenance scripts on a predefined schedule. Troubleshooting TransactionsSQL Profiler The SQL Profiler is a program that captures events from a server. The captured events are saved in a trace file that can later be analyzed or used to replay a specific series of steps when trying to diagnose a problem. The SQL Profiler is used for activities such as:
SQL Server Enterprise Manager SQL Server Enterprise Manager is the primary administrative tool for SQL Server and provides an MMCcompliant user interface that allows users to:
|
|||||||||||||
Disclaimer
1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us or use the "Report this article" button on this page to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. |
|||||||||||||