> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 包含 Replicated 数据库相关信息及其状态的系统表。

# system.database_replicas

<div id="description">
  ## 描述
</div>

包含各个 Replicated 数据库副本的信息。

<div id="columns">
  ## 列
</div>

* `database` ([String](/zh/reference/data-types/index)) — 所在 Replicated 数据库的名称。
* `is_readonly` ([UInt8](/zh/reference/data-types/index)) — 数据库副本是否处于只读模式。
* `max_log_ptr` ([Int32](/zh/reference/data-types/index)) — 常规活动日志中的最大条目编号。
* `replica_name` ([String](/zh/reference/data-types/index)) — ClickHouse Keeper 中的副本名称。
* `replica_path` ([String](/zh/reference/data-types/index)) — ClickHouse Keeper 中副本数据的路径。
* `zookeeper_path` ([String](/zh/reference/data-types/index)) — ClickHouse Keeper 中数据库数据的路径。
* `shard_name` ([String](/zh/reference/data-types/index)) — 集群中分片的名称。
* `log_ptr` ([Int32](/zh/reference/data-types/index)) — 副本已复制到其执行队列中的常规活动日志最大条目编号加一。
* `total_replicas` ([UInt32](/zh/reference/data-types/index)) — 此数据库已知副本的总数。
* `zookeeper_exception` ([String](/zh/reference/data-types/index)) — 如果从 ClickHouse Keeper 拉取信息时发生错误，则为最后一条异常消息。
* `is_session_expired` ([UInt8](/zh/reference/data-types/index)) — 与 ClickHouse Keeper 的会话已过期。基本上与 `is_readonly` 相同。

<div id="example">
  ## 示例
</div>

```sql theme={null}
SELECT * FROM system.database_replicas FORMAT Vertical;
```

```text theme={null}
Row 1:
──────
database:            db_2
is_readonly:         0
max_log_ptr:         2
replica_name:        replica1
replica_path:        /test/db_2/replicas/shard1|replica1
zookeeper_path:      /test/db_2
shard_name:          shard1
log_ptr:             2
total_replicas:      1
zookeeper_exception: 
is_session_expired:  0
```
