Skip to content

Latest commit

 

History

History
82 lines (59 loc) · 3.14 KB

File metadata and controls

82 lines (59 loc) · 3.14 KB
title Add persisted log buffer to a database
ms.custom
ms.date 10/30/2019
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology configuration
ms.topic conceptual
helpviewer_keywords
PMEM
persistent memory
persisted log buffer
add log file
create log buffer
remove log buffer
ms.assetid 8ead516a-1334-4f40-84b2-509d0a8ffa45
author briancarrig
ms.author brcarrig
manager amitban

Add persisted log buffer to a database

[!INCLUDE SQL Server]

This topic describes how to add a persisted log buffer to a database in [!INCLUDEsqlv15] using [!INCLUDEtsql].

Permissions

Requires ALTER permission on the database.

Configure persistent memory device (Linux)

To configure a persistent memory device in Linux.

Configure persistent memory device (Windows)

To configure a persistent memory device in Windows.

Add a persisted log buffer to a database

The following examples adds a persisted log buffer.

ALTER DATABASE <MyDB> 
  ADD LOG FILE 
  (
    NAME = <DAXlog>, 
    FILENAME = '<Filepath to DAX Log File>', 
    SIZE = 20MB
  );

The volume or mount the new log file is placed must be formatted with DAX (NTFS) or mounted with the DAX option (XFS/EXT4).

Remove a persisted log buffer

To safely remove a persisted log buffer, the database must be placed in single user mode in order to drain the persisted log buffer.

The following example places removes a persisted log buffer.

ALTER DATABASE <MyDB> SET SINGLE_USER;
ALTER DATABASE <MyDB> REMOVE FILE <DAXlog>;
ALTER DATABASE <MyDB> SET MULTI_USER;

Limitations

Transparent Data Encryption (TDE) is not compatible with persisted log buffer.

Availability Groups can only use this feature on secondary replicas due to need for normal log writing semantics on the primary. However, the small log file must be created on all nodes (ideally on DAX volumes or mounts).

Backup and restore operations

Normal restore conditions apply. If persisted log buffer is restored to a DAX volume or mount, it will continue to function, otherwise it can be safely removed.

Next steps