@@ -8,29 +8,29 @@ import EEFeature from '@site/src/components/EEFeature';
88
99# 系统历史表
1010
11- Databend 的系统历史表(System History Tables)通过自动跟踪数据库活动 ,提供** 数据治理(Data Governance)** 能力,可用于合规性 、安全监控和性能分析。
11+ Databend 的系统历史表通过自动跟踪数据库活动 ,提供** 数据治理(Data Governance)** 能力,用于合规 、安全监控和性能分析。
1212
1313## 可用表
1414
1515| 表 | 用途 | 主要用例 |
1616| -------| ---------| ---------------|
17- | [ query_history] ( query-history.md ) | 完整的 SQL 执行审计跟踪 | 性能分析、合规性跟踪、使用情况监控 |
18- | [ access_history] ( access-history.md ) | 数据访问和修改日志 | 数据血缘(Data Lineage)、合规性报告 、变更管理 |
17+ | [ query_history] ( query-history.md ) | 完整的 SQL 执行审计跟踪 | 性能分析、合规跟踪、使用监控 |
18+ | [ access_history] ( access-history.md ) | 数据访问与修改日志 | 数据血缘、合规报告 、变更管理 |
1919| [ login_history] ( login-history.md ) | 用户身份验证跟踪 | 安全审计、失败登录监控、访问模式分析 |
20- | [ profile_history] ( profile-history.md ) | 详细的查询执行配置文件 | 性能优化、资源规划、瓶颈识别 |
21- | [ log_history] ( log-history.md ) | 原始系统日志和事件 | 系统故障排查、错误分析、运营监控 |
20+ | [ profile_history] ( profile-history.md ) | 详细查询执行画像 | 性能优化、资源规划、瓶颈识别 |
21+ | [ log_history] ( log-history.md ) | 原始系统日志与事件 | 系统故障排查、错误分析、运维监控 |
2222
2323## 权限
2424
2525** 访问限制:**
26- - 只允许 ` SELECT ` 和 ` DROP ` 操作
27- - 禁止所有用户执行 ` ALTER ` 操作
26+ - 仅允许 ` SELECT ` 和 ` DROP ` 操作
27+ - 禁止所有用户执行 ALTER 操作
2828- 所有权不可转移
2929
3030** 所需权限:**
31- 要查询系统历史表,用户需要以下权限之一 :
31+ 查询系统历史表需具备以下任一权限 :
3232- ` GRANT SELECT ON *.* ` (全局访问)
33- - ` GRANT SELECT ON system_history.* ` (数据库访问 )
33+ - ` GRANT SELECT ON system_history.* ` (数据库级访问 )
3434- ` GRANT SELECT ON system_history.table_name ` (表级访问)
3535
3636** 示例:**
@@ -45,22 +45,22 @@ GRANT ROLE audit_team TO USER compliance_officer;
4545## 配置
4646
4747### Databend Cloud
48- ✅ ** 自动启用** - 所有系统历史表均已准备就绪,无需任何配置 。
48+ ✅ ** 自动启用** - 所有系统历史表开箱即用,无需额外配置 。
4949
5050### 自托管 Databend
5151
5252<details >
53- <summary >📝 **需要手动配置 ** - 点击展开配置详情</summary >
53+ <summary >📝 **需手动配置 ** - 点击展开配置详情</summary >
5454
5555#### 最小配置
56- 要启用系统历史表,必须在 ` databend-query.toml ` 中配置所有 5 个表 :
56+ 启用系统历史表需在 ` databend-query.toml ` 中配置全部 5 张表 :
5757
5858``` toml
5959[log .history ]
6060on = true
6161
62- # 必须配置所有 5 个表才能启用历史记录
63- # retention 为可选参数(默认值: 168 小时 = 7 天)
62+ # 必须配置全部 5 张表才能启用历史记录
63+ # retention 为可选项(默认 168 小时 = 7 天)
6464[[log .history .tables ]]
6565table_name = " query_history"
6666retention = 168 # 可选:7 天(默认)
@@ -83,11 +83,12 @@ retention = 168 # 可选:7 天(默认)
8383```
8484
8585#### 自定义存储(可选)
86- 默认情况下,历史表使用主数据库存储。如需使用独立 S3 存储:
86+ 默认情况下,历史表使用主数据库存储。如需独立 S3 存储:
8787
8888``` toml
8989[log .history ]
9090on = true
91+ storage_on = true
9192
9293[log .history .storage ]
9394type = " s3"
@@ -98,6 +99,19 @@ root = "history_tables"
9899endpoint_url = " https://s3.amazonaws.com"
99100access_key_id = " your-access-key"
100101secret_access_key = " your-secret-key"
102+
103+
104+ [[log .history .tables ]]
105+ table_name = " query_history"
106+
107+ [[log .history .tables ]]
108+ table_name = " profile_history"
109+
110+ [[log .history .tables ]]
111+ table_name = " login_history"
112+
113+ [[log .history .tables ]]
114+ table_name = " access_history"
101115```
102116
103117> ⚠️ ** 注意:** 更改存储配置时,现有历史表将被删除并重新创建。
0 commit comments