From c8067d1becb4233c7060479447c4f624ae5cad2c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 3 Jul 2025 09:16:00 +0000 Subject: [PATCH 1/2] [INIT] Start translation to Simplified-Chinese --- .translation-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.translation-init b/.translation-init index 60fd7e90f1..a0ecc4c9ad 100644 --- a/.translation-init +++ b/.translation-init @@ -1 +1 @@ -Translation initialization: 2025-07-02T03:45:36.737007 +Translation initialization: 2025-07-03T09:16:00.461236 From ea965c1a9f87020133fbe615f94b59875497c518 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 3 Jul 2025 09:18:21 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8C=90=20Translate=20index.md=20to=20?= =?UTF-8?q?Simplified-Chinese?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../32-system-history-tables/index.md | 46 ++++++++++++++----- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/docs/cn/sql-reference/00-sql-reference/32-system-history-tables/index.md b/docs/cn/sql-reference/00-sql-reference/32-system-history-tables/index.md index 22678b64be..0a0e59d115 100644 --- a/docs/cn/sql-reference/00-sql-reference/32-system-history-tables/index.md +++ b/docs/cn/sql-reference/00-sql-reference/32-system-history-tables/index.md @@ -8,37 +8,59 @@ import EEFeature from '@site/src/components/EEFeature'; # 系统历史表 -Databend 的系统历史表通过自动跟踪数据库活动,提供**数据治理 (Data Governance)**能力,以满足合规性、安全监控和性能分析的需求。 +Databend 的系统历史表(System History Tables)通过自动跟踪数据库活动,提供**数据治理(Data Governance)**能力,可用于合规性、安全监控和性能分析。 ## 可用表 | 表 | 用途 | 主要用例 | |-------|---------|---------------| -| [query_history](query-history.md) | 完整的 SQL 执行审计追踪 | 性能分析、合规性跟踪、使用情况监控 | -| [access_history](access-history.md) | 数据访问和修改日志 | 数据血缘 (Data Lineage)、合规性报告、变更管理 | +| [query_history](query-history.md) | 完整的 SQL 执行审计跟踪 | 性能分析、合规性跟踪、使用情况监控 | +| [access_history](access-history.md) | 数据访问和修改日志 | 数据血缘(Data Lineage)、合规性报告、变更管理 | | [login_history](login-history.md) | 用户身份验证跟踪 | 安全审计、失败登录监控、访问模式分析 | | [profile_history](profile-history.md) | 详细的查询执行配置文件 | 性能优化、资源规划、瓶颈识别 | -| [log_history](log-history.md) | 原始系统日志和事件 | 系统故障排查、错误分析、操作监控 | +| [log_history](log-history.md) | 原始系统日志和事件 | 系统故障排查、错误分析、运营监控 | + +## 权限 + +**访问限制:** +- 只允许 `SELECT` 和 `DROP` 操作 +- 禁止所有用户执行 `ALTER` 操作 +- 所有权不可转移 + +**所需权限:** +要查询系统历史表,用户需要以下权限之一: +- `GRANT SELECT ON *.*`(全局访问) +- `GRANT SELECT ON system_history.*`(数据库访问) +- `GRANT SELECT ON system_history.table_name`(表级访问) + +**示例:** +```sql +-- 为合规团队创建审计角色 +CREATE ROLE audit_team; +GRANT SELECT ON system_history.* TO ROLE audit_team; +CREATE USER compliance_officer IDENTIFIED BY 'secure_password' WITH DEFAULT_ROLE='audit_team'; +GRANT ROLE audit_team TO USER compliance_officer; +``` ## 配置 ### Databend Cloud -✅ **自动启用** - 所有系统历史表无需任何配置即可使用。 +✅ **自动启用** - 所有系统历史表均已准备就绪,无需任何配置。 ### 自托管 Databend
📝 **需要手动配置** - 点击展开配置详情 -#### 最小化配置 -要启用系统历史表,你必须在 `databend-query.toml` 中配置所有 5 个表: +#### 最小配置 +要启用系统历史表,必须在 `databend-query.toml` 中配置所有 5 个表: ```toml [log.history] on = true -# 必须配置所有 5 个表才能启用历史日志记录 -# retention 是可选的(默认为 168 小时 = 7 天) +# 必须配置所有 5 个表才能启用历史记录 +# retention 为可选参数(默认值:168 小时 = 7 天) [[log.history.tables]] table_name = "query_history" retention = 168 # 可选:7 天(默认) @@ -61,7 +83,7 @@ retention = 168 # 可选:7 天(默认) ``` #### 自定义存储(可选) -默认情况下,历史表使用主数据库存储。要使用独立的 S3 存储: +默认情况下,历史表使用主数据库存储。如需使用独立 S3 存储: ```toml [log.history] @@ -78,8 +100,8 @@ access_key_id = "your-access-key" secret_access_key = "your-secret-key" ``` -> ⚠️ **注意:** 更改存储配置时,现有的历史表将被删除并重新创建。 +> ⚠️ **注意:** 更改存储配置时,现有历史表将被删除并重新创建。
-有关完整的配置选项,请参阅[查询配置:[log.history] 部分](/guides/deploy/references/node-config/query-config#loghistory-section)。 \ No newline at end of file +完整配置选项请参阅[查询配置:[log.history] 部分](/guides/deploy/references/node-config/query-config#loghistory-section)。 \ No newline at end of file