摘 要:研究了在将数据库设置为完整恢复模式后,事务日志备份操作中的内容。给出 SQL Server 事务日志备份的概念,解释了 first_lsn 和 last_lsn 的概念,并给出 SQL Server 确定这两个数值的方法,指出每次事务日志备份的内容是 first_lsn 和last_lsn 之间的重做数据。构造简洁的实验步骤,验证了第一次事务日志备份时,first_lsn 是上一次全库备份的 first_lsn,从第二次事务日志备份开始,first_lsn 是上一次事务日志备份的 last_lsn。
关键词:SQL Server;事务日志备份;完整恢复模式
DOI:10.19850/j.cnki.2096-4706.2021.06.042
中图分类号:TP311 文献标识码:A 文章编号:2096-4706(2021)06-0158-03
Study on the SQL Server Transaction Log Backup Content
Li Aiwu
(Guangdong Vocational College of Post and Telecom,Guangzhou 510630,China)
Abstract:This paper studies the content of transaction log backup operation after the database is set to full recovery mode. Gives the concept of SQL Server transaction log backup,explains the concept of first_lsn and last_lsn,and gives the method for SQL Server to determine these two numerical values,pointing out that the content of each transaction log backup is the redo data between first_lsn and last_lsn. Constructing concise experimental steps to verify that the first_lsn is the first_lsn of the previous full database backup when the first transaction log backups,and the first_lsn is the last_lsn of the previous transaction log backup from the beginning of the second transaction log backup.
Keywords:SQL Server;transaction log backup;full recovery mode
参考文献:
[1] KOROTKEVITCH D. Expert SQL Server Transactions and Locking [M].New York:Apress,2018.
[2] MCGEHEE S. SQL Server Backup and Restore [M].Redgate Publishing,2012.
[3] CARTER P A. Securing SQL Server:DBAs Defending the Database [M].Berkely:Apress,2016.
[4] KOROTKEVITCH D. Pro SQL Server Internals [M].2nd ed.New York:Apress,2016.
[5] 李爱武 .SQLServer 2008 数据库技术内幕 [M]. 北京:中 国铁道出版社,2012.
作者简介:李爱武(1969.07—),男,汉族,河北肃宁人, 副教授,理学硕士,研究方向:数据库技术、数据分析。