log backup chain被打断后是不是需要从一个完整备份重新开始?
般我们的理解是logbackupchain被打破后一定需要一个完整备份然后才能开始新的日志备份,其实不一定需要完整备份,差异备份也是可以的。首先我们先做个测试:创建
般我们的理解是logbackup chain被打破后一定需要一个完整备份然后才能开始新的日志备份,其实不一定需要完整备份,香港虚拟主机,香港服务器,差异备份也是可以的。
首先我们先做个测试:创建数据库做完整备份和日志备份,然后将恢复模式变成简单恢复模式。
CREATEDATABASE LogChainTest;
GO
ALTER DATABASE LogChainTest SET RECOVERY FULL;
GO
BACKUP DATABASE LogChainTest TO DISK = 'D:\MSSQL\LogChainTest.bck' WITH INIT;
GO
BACKUP LOG LogChainTest TO DISK = 'D:\MSSQL\LogChainTest_log1.bck' WITH INIT;
GO
ALTER DATABASE LogChainTest SET RECOVERY SIMPLE;
GO
ALTER DATABASE LogChainTest SET RECOVERY FULL;
GO
然后再开始一个新的Log备份就会出现下面的错误:
BACKUP LOGLogChainTest TO DISK = 'D:\MSSQL\LogChainTest_log2.bck' WITH INIT;
GO
Msg 4214,Level 16, State 1, Line 1
BACKUP LOG cannot be performed because there is no current database backup.
Msg 3013, Level 16, State 1, Line 1
BACKUP LOG is terminating abnormally.
我们都知道,数据库日志备份包含的是从上次日志备份以来发生的交易。当我们将数据库模式更改为简单以后,SQL Server就会认为这次的日志备份不会包含所有的日志交易,所以日志备份无法完成。
现在我们做一个差异备份然后再开始做日志备份就会成功了:
BACKUPDATABASE LogChainTest TO DISK = 'D:\MSSQL\LogChainTest_Diff1.bck' WITH INIT,DIFFERENTIAL;
GO
BACKUP LOG LogChainTest TO DISK = 'D:\MSSQL\LogChainTest_log2.bck' WITH INIT;
GO
做完日志备份之后我做了恢复测试完全没有问题。
这个功能针对大数据库是非常有用的,如果Logbackup chain被打破后,就可以直接选择差异备份,而不需要执行一次完整备份,香港空间,这样可以节省很多时间和资源。
本文出自 “关注SQL Server技术” 博客,请务必保留此出处

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Use the math.Log2 function to calculate the base 2 logarithm of a specified number. In mathematics, the logarithm is an important concept that describes the exponential relationship of one number to another number (the so-called base). Among them, the base 2 logarithm is particularly common and is frequently used in the fields of computer science and information technology. In the Python programming language, we can calculate the base 2 logarithm of a number using the log2 function from the math library. Here is a simple code example: importmathdef

Implementing backup and recovery strategies for PHP applications using DockerCompose, Nginx and MariaDB Introduction: In modern software development, backup and recovery strategies are a crucial part. When designing a backup and recovery strategy for PHP applications, we can use a combination of DockerCompose, Nginx, and MariaDB to achieve a reliable and flexible solution. This article will provide detailed steps and code examples to help readers get started quickly. 1. Create

MySQL connection problem: How to optimize the backup and recovery speed of the database? In the process of using MySQL database, backup and recovery are very important operations. They can ensure the security of data and support the stable operation of the system. However, in large or highly loaded database systems, the speed of backup and recovery may become a challenge because they involve a large number of data interactions and network connections. This article will discuss how to optimize the backup and recovery speed of MySQL database. First, choosing an appropriate backup and recovery strategy is

If you need to restart the WindowsServerBackup service, just follow the steps below. You can use a method to start and stop the Windows Server Backup service in almost all versions of Windows Server. Here we will discuss the entire process so that you can easily follow it if needed. How to restart the Windows Server Backup service This process consists of two main stages. First, you should be familiar with how to start the Windows Server Backup service. Next, you can learn the steps on how to stop the service. If the service is already running in the background, you can use another method to kill the process.

In Laravel development, database backup is a very important step. Whether to avoid data loss or to back up data to a production environment, backing up your database is necessary. LaravelBackup provides a fast, reliable, and flexible way to back up and restore databases. In this article, we will introduce how to use LaravelBackup to backup your database. Install LaravelBackup Before using LaravelBackup, you first need to install it

Use the math.Log10 function to calculate the base 10 logarithm of a specified number. Logarithms are a common concept in mathematics and computer science. We often use logarithms to describe the size or proportion of numbers. In computer programming, the commonly used logarithmic function is the logarithmic function with base 10. In the Python language, you can use the log10 function in the math library to calculate the base 10 logarithm of a specified number. Below we will demonstrate the use of this function through a simple code example. First, we need

All backup files cannot be deleted. In computers, backup files usually refer to files with the extension .bak or .bak.dat. These files are files used to protect important data from accidental loss. Backup files are Automatically created by the operating system or application for recovery if the original file is lost or corrupted. If you determine that your backup files are no longer needed and can withstand the impact of their deletion, you can delete them. However, careful consideration and evaluation is recommended before proceeding with deletion.

Title: Use the log.Println function in Golang to print log information. Logs are very important in software development. They can help us track various information during program running, such as errors, warnings, debugging information, etc. In Golang, there is a built-in log package, which provides many functions to handle log output. One of the commonly used functions is log.Println, which prints log information to standard output. Below is a simple example code showing how to use log.Print
