Skip to content

Latest commit

 

History

History
69 lines (59 loc) · 5.03 KB

sys-dm-server-audit-status-transact-sql.md

File metadata and controls

69 lines (59 loc) · 5.03 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sys.dm_server_audit_status (Transact-SQL)
sys.dm_server_audit_status (Transact-SQL)
sravanisaluru
srsaluru
randolphwest
03/09/2023
sql
system-objects
reference
dm_server_audit_status_TSQL
sys.dm_server_audit_status
dm_server_audit_status
sys.dm_server_audit_status_TSQL
sys.dm_server_audit_status dynamic management view
TSQL

sys.dm_server_audit_status (Transact-SQL)

[!INCLUDE sql-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 column in the sys.audits catalog view.
name sysname Name of the audit. Same as the name column 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 address column in the sys.dm_xe_sessions 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

Next steps