Skip to content

Latest commit

 

History

History
65 lines (58 loc) · 5.39 KB

File metadata and controls

65 lines (58 loc) · 5.39 KB
title sys.dm_server_audit_status (Transact-SQL)
description sys.dm_server_audit_status (Transact-SQL)
author sravanisaluru
ms.author srsaluru
ms.date 03/23/2022
ms.service sql
ms.subservice system-objects
ms.topic reference
f1_keywords
dm_server_audit_status_TSQL
sys.dm_server_audit_status
dm_server_audit_status
sys.dm_server_audit_status_TSQL
helpviewer_keywords
sys.dm_server_audit_status dynamic management view
dev_langs
TSQL
ms.assetid 4aa32d54-2ae1-437e-bbaa-7f1df1404b44

sys.dm_server_audit_status (Transact-SQL)

[!INCLUDE SQL Server - ASDBMI]

Returns a row for each server audit indicating the current state of the audit. For more information, see SQL Server Audit (Database Engine).

Column name Data type Description
audit_id int ID of the audit. Maps to the audit_id field in the sys.audits catalog view.
name sysname Name of the audit. Same as the name field in the sys.server_audits catalog view.
status smallint Numeric status of the server audit:

0 = Not Started

1 =
Started

2 =
Runtime Fail

3 = Target Create Fail

4 = Shutting Down
status_desc nvarchar(256) String that shows the status of the server audit:

NOT_STARTED

STARTED

RUNTIME_FAIL

TARGET_CREATION_FAILED

SHUTTING_DOWN
status_time datetime2 Timestamp in UTC of the last status change for the audit.
event_session_address varbinary(8) Address of the Extended Events session associated with the audit. Related to the sys.dm_xe_sessions.address catalog view.
audit_file_path nvarchar(256) Full path and file name of the audit file target that is currently being used. Only populated for file audits.
audit_file_size bigint Approximate size of the audit file, in bytes. Only populated for file audits.

Permissions

Principals must have the VIEW SERVER SECURITY STATE permission.

[!INCLUDEssCatViewPerm] For more information, see Metadata Visibility Configuration.

See Also

CREATE SERVER AUDIT (Transact-SQL)
ALTER SERVER AUDIT (Transact-SQL)
DROP SERVER AUDIT (Transact-SQL)
CREATE SERVER AUDIT SPECIFICATION (Transact-SQL)
ALTER SERVER AUDIT SPECIFICATION (Transact-SQL)
DROP SERVER AUDIT SPECIFICATION (Transact-SQL)
CREATE DATABASE AUDIT SPECIFICATION (Transact-SQL)
ALTER DATABASE AUDIT SPECIFICATION (Transact-SQL)
DROP DATABASE AUDIT SPECIFICATION (Transact-SQL)
ALTER AUTHORIZATION (Transact-SQL)
sys.fn_get_audit_file (Transact-SQL)
sys.server_audits (Transact-SQL)
sys.server_file_audits (Transact-SQL)
sys.server_audit_specifications (Transact-SQL)
sys.server_audit_specification_details (Transact-SQL)
sys.database_audit_specifications (Transact-SQL)
sys.database_audit_specification_details (Transact-SQL)
sys.dm_server_audit_status
sys.dm_audit_actions (Transact-SQL)
sys.dm_audit_class_type_map (Transact-SQL)
Create a Server Audit and Server Audit Specification