SharePoint stores configuration and site content in SQL Server databases. The main SharePoint database is the configuration database. The configuration database stores configuration settings for all SharePoint servers in a deployment, including virtual servers. It is imperative that all databases residing on SQL Server, especially the configuration database, are backed up regularly to minimize data loss. There are different methods to back up and restore a SharePoint database in SQL Server. It is possible to back up databases with the SharePoint Portal Server Data Backup and Restore utility, SQL Server Enterprise Manager backup utility, or T-SQL scripts fired by SQL Server Query Analyzer. In addition, a third-party backup utility with the appropriate SQL Server backup agent can be used to back up the databases. SharePoint Portal Server Data Backup and Restore utility is a great tool to back up site content and configuration databases. However, it lacks the capability of restoring SQL Server to the point of failure if a disaster occurs. The Data Backup and Restore utility included with SharePoint does not back up vital SQL Server databases such as Master, MSDB, and TempDB, which are used to maintain vital SQL Server configuration settings. Therefore, it is recommended to formulate a SQL Server database backup and recovery strategy that encompasses all SQL Server proprietary and SharePoint databases. Understanding SQL Server Backup MethodsThe backup utility included in SQL Server offers several options for backing up databases. These options include the following:
NOTE Transaction log backups can be conducted only on databases using Full and Bulk Logged recovery models. To perform a full SQL database backup using SQL Server Enterprise Manager, do the following:
Understanding SQL Server Recovery ModelsThree recovery models are associated with a database: Simple, Full, and Bulk Logged. Each model addresses different scenarios on performance, minimization of data loss, and recovery of a database to the point of failure. Simple recovery truncates the transaction log. Therefore, a database can only be recovered up until the last successful full or differential database backup. Data entered into the database after a successful full or differential database backup is lost. Full recovery mode maintains the transaction logs, and, therefore, it is possible to restore a database to the point of failure. Database files and transaction logs should be stored on separate hard disks or RAID sets for performance and recovery. Maintaining a transaction log degrades SQL Server performance as all transactions to the database are logged. Bulk Logged recovery maintains a transaction log; however, transaction logging is turned off automatically to maximize database performance when large amounts of data are inserted into the database, for example, bulk inserts and indexing. Database administrators must identify how much data they are prepared to lose. This decision helps a database administrator identify which recovery model to use on each database. By default, the SharePoint configuration database recovery model is set to Full, but the content databases recovery models are set to Simple. As a result, the configuration database can be restored to the point of failure, whereas the content databases can only be restored to the last successful full or differential backup. To set the recovery model on a SharePoint content database, perform the following steps:
Examining a Real-World SharePoint Database Backup ScenarioSQL Server concepts can be complex, and it sometimes is useful to illustrate an example of a "best practice" implementation. This section presents an example that illustrates the steps of a backup strategy for the SharePoint configuration database used by the fictional CompanyABC. CompanyABC has a service-level agreement that states that the database administrator must be able to restore the company's SharePoint configuration database to the point of failure. To accomplish this, the CompanyABC database administrator performs the following steps:
For this example, CompanyABC has a substantial amount of SharePoint configuration changes and database transactions, which made a case for transaction log backups to be created more frequently. If CompanyABC suffers a disaster at 6:00 a.m. on the configuration database, the database administrator can simply restore the full backup from midnight and replay the transaction logs up until the point of failure. It is also possible to restore a transaction log to a specific time if ever required. To summarize this example, the Full recovery model allows CompanyABC to successfully restore the SharePoint database to the point of failure without suffering any data loss. |