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

> System table containing information about and status of replicated database.

# system.database_replicas

<h2 id="description">
  Description
</h2>

Contains information of each Replicated database replicas.

<h2 id="columns">
  Columns
</h2>

* `database` ([String](/reference/data-types)) — The name of the Replicated database is in.
* `is_readonly` ([UInt8](/reference/data-types)) — Whether the database replica is in read-only mode.
* `max_log_ptr` ([Int32](/reference/data-types)) — Maximum entry number in the log of general activity.
* `replica_name` ([String](/reference/data-types)) — Replica name in ClickHouse Keeper.
* `replica_path` ([String](/reference/data-types)) — Path to replica data in ClickHouse Keeper.
* `zookeeper_path` ([String](/reference/data-types)) — Path to database data in ClickHouse Keeper.
* `shard_name` ([String](/reference/data-types)) — The name of the shard in the cluster.
* `log_ptr` ([Int32](/reference/data-types)) — Maximum entry number in the log of general activity that the replica copied to its execution queue, plus one.
* `total_replicas` ([UInt32](/reference/data-types)) — The total number of known replicas of this database.
* `zookeeper_exception` ([String](/reference/data-types)) — The last exception message, got if the error happened when fetching the info from ClickHouse Keeper.
* `is_session_expired` ([UInt8](/reference/data-types)) — The session with ClickHouse Keeper has expired. Basically the same as `is_readonly`.

<h2 id="example">
  Example
</h2>

```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
```
