2
2
title : 系统历史表
3
3
---
4
4
5
+ import FunctionDescription from '@site/src /components/FunctionDescription';
6
+
7
+ <FunctionDescription description =" 引入或更新于:v1.2.752 " />
8
+
5
9
# 系统历史表
6
10
7
- 系统历史表在 ` system_history ` schema 中持久化存储数据 ,用于审计、故障排查和合规目的。这些表跟踪查询执行、用户登录和系统日志信息,可通过标准 SQL 进行查询。
11
+ 系统历史表 (System History Tables) 在 ` system_history ` 模式中存储持久化数据 ,用于审计、故障排查和合规性目的。它们跟踪查询执行、用户登录和系统日志,可使用标准 SQL 进行查询。
8
12
9
13
## 可用的系统历史表
10
14
11
15
| 表 | 描述 |
12
- | --------------------------------------------------| ---------------------------------------------------------|
13
- | [ system_history.log_history] ( log-history.md ) | 存储来自各系统组件的原始日志条目 |
14
- | [ system_history.query_history] ( query-history.md ) | 存储查询执行的结构化详情 |
15
- | [ system_history.profile_history] ( profile-history.md ) | 存储详细的查询执行详情和统计信息 |
16
- | [ system_history.login_history] ( login-history.md ) | 记录用户登录事件 |
16
+ | ----------------------------------------------------- | -------- ---------------------------------------------------------|
17
+ | [ system_history.log_history] ( log-history.md ) | 存储来自不同系统组件的原始日志条目 |
18
+ | [ system_history.query_history] ( query-history.md ) | 存储查询执行的结构化详细信息 |
19
+ | [ system_history.profile_history] ( profile-history.md ) | 存储详细的查询执行剖析数据和统计信息 |
20
+ | [ system_history.login_history] ( login-history.md ) | 记录用户登录事件的相关信息 |
17
21
18
22
## 启用系统历史表
19
23
20
- > ** 注意** : 在 ** Databend Cloud** 中,系统历史表会自动启用且无需配置。以下内容仅适用于 ** 自托管 Databend** 。
24
+ > ** 注意: ** 在 ** Databend Cloud** 中,系统历史表自动启用且无需配置即可使用。以下部分仅适用于 ** 自托管 Databend** 。
21
25
22
- 在自托管 Databend 中,系统历史表默认禁用。需在 ` databend-query.toml ` 文件中配置 ` [log.history] ` 部分来启用 。
26
+ 在自托管 Databend 中,系统历史表默认禁用。需在 ` databend-query.toml ` 文件中配置 ` [log.history] ` 部分以启用 。
23
27
24
- <details >
25
- <summary >配置示例</summary >
28
+ 配置示例:
26
29
27
30
``` toml
28
31
[log .history ]
29
- # 开启历史表功能
32
+ # 启用历史表
30
33
on = true
31
34
level = " INFO"
32
35
33
- # 配置各表的保留策略
36
+ # 为各表配置保留策略
34
37
[[log .history .tables ]]
35
38
table_name = " log_history"
36
- retention = 168 # 7 天(单位:小时 )
39
+ retention = 168 # 7 天(以小时计 )
37
40
38
41
[[log .history .tables ]]
39
42
table_name = " query_history"
@@ -48,8 +51,6 @@ table_name = "login_history"
48
51
retention = 168
49
52
```
50
53
51
- > ** 注意** :开启历史日志功能时,` log_history ` 表默认启用。
52
-
53
- </details >
54
+ > ** 注意:** 启用历史日志记录时,` log_history ` 表默认激活。
54
55
55
- 完整配置选项详见 [ 查询配置:[ log.history] 部分] ( /guides/deploy/references/node-config/query-config#loghistory-section ) 。
56
+ 有关配置选项的完整说明,请参阅 [ 查询配置:[ log.history] 部分] ( /guides/deploy/references/node-config/query-config#loghistory-section ) 。
0 commit comments