看起来我们进行了默认保留期为 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 天的日志。
SQL 服务器文件夹:
数据库文件夹:
选择数据库:
根据我的理解(如果我遗漏了什么,请纠正我。):
- 如果将保留期设置为其他天(非0),则新日志为
存储在文件夹
SqlDbAuditing_Audit
中。 - 如果保留期为0,则数据库审核日志存储在
SqlDbAuditing_Audit_NoRetention
,服务器审核日志存储在SqlDbAuditing_ServerAudit_NoRetention
。
您可以清除 SqlDbAuditing_Audit_NoRetention
或 SqlDbAuditing_ServerAudit_NoRetention
文件夹中超过 180 天的日志。
希望这有帮助。
关于sql-server - 如何删除 Azure MSSQL 审核日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59267011/