Regular operational processes to protect data integrity are the backbone of your application. Every application requires ongoing maintenance activities, including:
If you are responsible for maintaining your database, you will need to periodically perform a number of database-oriented tasks. For relational databases, this includes clearing the log file, checking the memory and procedure cache peak loads, compressing the file size, and validating the links between tables and index pages. For hierarchical databases, this means checking for broken links by walking the data structure from the top down through all of the child records. For VSAM files, this includes a rebuild with additional preallocated index positions for future expansion based on historical growth trends.
Tip If you're using SQL Server, you can use the Database Consistency Checker (DBCC) to analyze and repair various aspects of a SQL Server installation. For more information, search online for "Database Consistency Checking" in the SQL Server Books Online.
Backups are crucial to your application in case you need to recover data due to corruption or some catastrophic event. You have several backup choices, including:
Dumping copies the data to an external device (such as disk or tape) using a specialized format. Because dumping provides a snapshot of the entire database, changes made subsequent to the dump process are lost (unless you supplement the dump with transaction logs). Dumps are a popular method of handling data recovery. If you use dumps, be sure to do it nightly.
Most relational databases (including SQL Server) provide an alternative to dumping called mirroring. With mirroring, all transactions on one device are continuously copied to the duplicate mirror device. Once mirroring is set up, it is seamless and maintenance free. The benefit of mirroring is that recovery from a crash is virtually instantaneous. Caution is advised, however, because if the network connection to the mirroring machine becomes corrupted, your database will stop. Even with mirroring, you should still use periodic dumps to be safe.
For More Information For more information on how to use mirroring with SQL Server, search online for "Setting Up Mirroring Using Transact-SQL Statements" in MSDN Library Visual Studio 6.0.
Using replication you can copy all or portions of your database to any number of remote machines. Besides providing a means to backup data, replication has other benefits as well: you can distribute your data throughout the network, balancing the workload and minimizing the risk of catastrophic failure. Replication is primarily a tool for keeping data consistent between distributed databases, and is not generally recognized as a way to provide database backups.
For More Information For more information on the features and capabilities of replication, search online for "Replication Concepts" in MSDN Library Visual Studio 6.0.
After your application is installed and running, you must periodically review the security implementation to ensure continued protection of your application's data. Security concerns more than just authorizing user logons. Security is about controlling access to all of your application's architectural components and processes, including:
Regularly scheduled security reviews will help protect your application's data from unauthorized tampering or modification.
For More Information For more information on securing your application's components and processes, see Implementing Enterprise Application Security in Chapter 8 of this book.