tailieunhanh - Microsoft SQL Server 2008 R2 Unleashed- P46

Microsoft SQL Server 2008 R2 Unleashed- P46:SQL Server 2005 provided a number of significant new features and enhancements over what was available in SQL Server 2000. This is not too surprising considering there was a five-year gap between these major SQL Server 2008 is not as much of a quantum leap forward from SQL Server 2005 | 394 CHAPTER 14 Database Backup and Restore backup or manual truncation the log can fill to a point where it will use up all the space on your disk. Creating Transaction Log Backups with SSMS The same backup screen utilized for database backups in SSMS can also be used for transaction log backups. Figure shows the Back Up Database window with Transaction Log selected as the backup type. A device must be selected to write the backup to and some additional options on the Options page that relate to the transaction log are enabled. FIGURE Backing up the transaction log in SSMS. Creating Transaction Log Backups with T-SQL When you back up a transaction log by using T-SQL you use the BACKUP LOG command which includes all the previously listed options except the DIFFERENTIAL option. Differential backups do not apply to transaction logs. Several additional options are available for transaction log backups. The following abbreviated syntax for the BACKUP LOG command shows the options used exclusively for backing up transaction logs BACKUP LOG database_name @database_name_var TO backup_device .n MIRROR TO backup_device .n .next-mirror WITH Download from Backing Up the Transaction Log 395 NO_TRUNCATE NORECOVERY STANDBY undo_file_name The options specific to BACKUP LOG are discussed in detail in the following sections. The NO_TRUNCATE Option You use the NO_TRUNCATE option when the log is available but the database is not. This option prevents the truncation of the transaction log after a backup occurs. Under normal circumstances the BACKUP LOG command not only writes to the transaction log but also signals a checkpoint for the database to flush any dirty buffers from memory to the database files. This behavior becomes a problem when the media containing the database is unavailable and you must capture the current contents of a log to a backup file for recovery. If you last did a log backup four hours ago this would mean the loss of all the input .

TỪ KHÓA LIÊN QUAN