官术网_书友最值得收藏!

Accelerated Database Recovery

The described recovery process ensures that every database is in its last known consistent state after SQL Server's startup. The recovery process could take a long time in some cases. A common situation would be when SQL Server is stopped (sometimes unexpectedly) when some long-running transaction is being executed. The recovery process takes almost the same time as executing the transaction. It leads to unacceptable database unavailability. SQL Server 2019 brings a new database-scoped feature that bypasses this issue. The feature is called Accelerated Database Recovery (ADR). ADR basically keeps track of changes in data using internal row versioning. When SQL Server stops working and is restarted, SQL Server does not recover all the transactions from the transaction log, but simply recovers the proper versions of the records from the in-database row version store.

To turn on ADR, we can use the following Data Definition Language (DDL) statement:

ALTER DATABASE AdventureWorks SET ACCELERATED_DATABASE_RECOVERY = ON

(PERSISTENT_VERSION_STORE_FILEGROUP = myPvsFG)

The preceding statement consists of two parts. The first part is just turning ON (or OFF, if needed) ADR. The second part of the statement, enclosed in brackets, is optional. Versions of records that have been changed during transactions are stored on a disk in a filegroup. We can set a filegroup dedicated to row versions (which is a good practice for performance). Row versions are stored in the filegroup called myPvsFG. When this part of the configuration is omitted, row versions are stored in the primary filegroup.

The ADR feature is useful for workloads with long-running transactions or when the transaction log of a certain database grows significantly.

It is important for DBAs to understand write-ahead logging when planning a backup strategy because the restore process finishes with the recovery process as well. When restoring the database, the administrator has to recognize if it's time to run the recovery process or not. Now, let's learn about the different backup options that are available in SQL Server by using a properly configured recovery model.

主站蜘蛛池模板: 宜都市| 高邮市| 繁峙县| 黄龙县| 龙泉市| 河源市| 鄯善县| 天峻县| 衡东县| 庐江县| 静安区| 威远县| 成武县| 客服| 高阳县| 丽江市| 陇西县| 赣州市| 梁平县| 白水县| 龙江县| 桃江县| 体育| 耿马| 永昌县| 和平县| 同仁县| 富锦市| 遂平县| 玉田县| 海盐县| 若尔盖县| 天长市| 友谊县| 天长市| 崇文区| 尼勒克县| 南城县| 江源县| 怀柔区| 宾阳县|