VB Programing support Access Database Microsoft Office VB.Net & SQL Server nev@NevVB.com.au Sydney, Australia (612) 9453-0456 Contact Details 23/02/2012
Maintenance and optimisation of a Microsoft Access database is simple: Do a Compress and Compare once a week. Monitor Table file sizes and monitor response times. Things are very much different when using a full-blown relational database such as Microsoft SQL Server. Regular maintenance tasks and monitoring are needed to ensure that the SQL Server database performs efficiently and high availability is maintained. SQL Server Database maintenance and tuninng is a never ending chore. As much as possible should be automated. The Maintenance Plan Wizard can be used to create basic database maintenance procedures. Care must be taken – the Maintenance Plan Wizard does not perform all necessary maintenance tasks and it can impair performance. Here is a checklist of the Database Maintenance and Tuning Tasks:
SQL Server does its best to minimise file fragmentation, but …
MDF and LDF files should be located on their own disks, separate from the Operating System. This will reduce I/O contention, improve performance, and reduce fragmentation. For best SQL Server performance, use a dedicated Server and lots of memory.
Set Autogrowth to use a fixed amount large enough to avoid growth spikes. If TEMPDB is very active, locate it on its own disk.
The MSDB database can grow large storing data like Backup and Restore history, SQL Server Agent Job history, Maintenance Plan history. This database should be regularly cleaned out.
SQL Server performance greatly depends on the optimisation of the Indexes. Use the Index Tuning Wizard to get recommendations on Indexing. Note that the Indexing requirements may change over time, as volumes and the mix change.
The tasks are:
SQL Server maintains statistics on indexes which are used by the query optimiser to produce query plans. These statistics must be up-to-date, to ensure that the query optimiser produces the a query plan based on the best information.
To identify data corruption, ensure that "checksum" is turned on for the database. Run DBCC CHECKDB as often as practical.
It is essential to have a fully tested Disaster Recovery plan in place.
Production databases should use the Full Recovery model. Use RESTORE WITH VERIFYONLY to help verify backup integrity. Perform Full Backups daily on all system and user production databases.
Restore backups frequently to verify that they can be restored. Enforce an appropriate data retention policy. Store backups securely off-site.
Transact-SQL code has a great potential for impinging on performance.