sql-server - 如何删除 Azure MSSQL 审核日志

标签 sql-server azure audit

看起来我们进行了默认保留期为 0 的 SQL 审核。我注意到 azure 存储帐户的价格上涨了。 Azure 文档称,如果我更改保留期,现有日志不会受到影响/删除。

https://learn.microsoft.com/en-us/azure/sql-database/sql-database-auditing#subheading-2

Important

The default value for retention period is 0 (unlimited retention). You can change this value by moving the Retention (Days) slider in Storage settings when configuring the storage account for auditing.

If you change retention period from 0 (unlimited retention) to any other value, please note that retention will only apply to logs written after retention value was changed (logs written during the period when retention was set to unlimited are preserved, even after retention is enabled)

如何清除超过180天的日志?

最佳答案

我认为您可以手动删除超过 180 天的日志。

通常,审核日志存储在存储中。 enter image description here

审核将创建一个容器来将日志存储在您的存储帐户中: enter image description here

SQL 服务器文件夹:

enter image description here

数据库文件夹:

enter image description here

选择数据库:

enter image description here

根据我的理解(如果我遗漏了什么,请纠正我。):

  • 如果将保留期设置为其他天(非0),则新日志为 存储在文件夹 SqlDbAuditing_Audit 中。
  • 如果保留期为0,则数据库审核日志存储在 SqlDbAuditing_Audit_NoRetention,服务器审核日志存储在 SqlDbAuditing_ServerAudit_NoRetention

您可以清除 SqlDbAuditing_Audit_NoRetentionSqlDbAuditing_ServerAudit_NoRetention 文件夹中超过 180 天的日志。

enter image description here

希望这有帮助。

关于sql-server - 如何删除 Azure MSSQL 审核日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59267011/

相关文章:

SQL Server -- order by 子句依赖于(字段列表,类型)对

SQL : Remove duplicate based on a critera

java - 使用 Hibernate 和 AOP 的审计模式映射

sql - ROLLBACK TRAN 会回滚所有内容吗?

azure - 用于从不同资源组查找资源 ID 的 ARM 模板命令

Azure KQL 正则表达式使用 extract_all() 捕获命名捕获组的句子

azure - 如何在 Azure Functions C# 中获取客户端 IP 地址?

c# - 安全软件许可证使用审计日志

java - 使用 EclipseLink JPA 审计 Oracle

c# - 具有外部源的 Entity Framework 6 同步表