# Stop, start or reboot a database

Stop a database you do not need, start it again, or reboot it; a cluster reboots one machine at a time.

Replace _ewdb-0123456789ab_ with your database's id.

**Important:**
A stopped database is still billed: every started hour of every node counts, stopped ones included.

## Prerequisites

- Permission for `rds:StopDBInstance`, `rds:StartDBInstance` or `rds:RebootDBInstance`. A missing
  grant is named under the buttons.
- The right status: only a `stopped` database can be started, and only an `available` one stopped
  or rebooted. Otherwise the request is refused ("Cannot start a database in status: …" and "Cannot
  stop …" with `400`, "Cannot reboot …" with `409`).
- In the console, also `rds:DescribeDBInstances` to open the database's page (without it the page is
  not found).

## Stop, start or reboot

**Console**
1. Open the database.
2. In the header, choose **Stop**, **Start** or **Reboot**. **Start** runs at once.
3. For **Stop** and **Reboot**, in **Stop _name_?** or **Reboot _name_?**, choose **Stop** or
   **Reboot** to confirm.

**CLI**
```sh
dcloud rds instances stop ewdb-0123456789ab
dcloud rds instances start ewdb-0123456789ab
dcloud rds instances reboot ewdb-0123456789ab
```

**API**
```http
PATCH /rds/api/instances/ewdb-0123456789ab
{ "action": "reboot" }
```

`"stop"` and `"start"` work the same way.

**Terraform:** not available. Power state is an action, not configuration.

## Result

The status moves through `stopping` → `stopped` or `starting` → `available`. A stop shuts the
machines down cleanly; storage, backups and the master password are kept.

**Reboot on a cluster** restarts one machine at a time: the replicas first, each streaming again
before the next, then a switchover, then the old leader. The database stays `available`; clients
see one switchover (a few seconds). Progress is on **Activity** (phase `reboot`).

**Reboot on a single node** starts at once: the database is `rebooting` and unavailable until its
machine is back and PostgreSQL answers again, then `available`.

A reboot also loads a library an extension waits for (see
[Enable an extension](enable-an-extension.md)) and applies parameters that take effect at the next
restart (see [Tune parameters](tune-parameters.md)).

## Related

- [Fail over a cluster](fail-over-a-cluster.md)
- `rds.instances.reboot` · `dcloud rds instances reboot`
