doctl Verified current stable Not installed? Cloud Infrastructure

Doctl / Update Database Maintenance Window Common

Update Database Maintenance Window Common

Update the maintenance window for a specified database.

$
Terminal
doctl d mw u <database_id> --day <day_of_the_week> --hour <hour_in_24_hours_format>

When To Use

During a scheduled maintenance period requiring downtime adjustments.

Pro Tip

Use `--force` to bypass timezone checks if you need to update without confirmation.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
doctl d mw u <database_id> --day <day_of_the_week> --hour <hour_in_24_hours_format>

Anatomy of Output

Understanding the result

Updating maintenance window... Operation Status

Indicates the initiation of the update process.

Database ID: 123456 Database ID

Unique identifier for the database being updated.

Scheduled Day: Monday, Hour: 02 Schedule Confirmation

Confirms the scheduled maintenance settings.

Power User Variants

Optimized versions

doctl databases maintenance-window update 123456 --day Friday --hour 03 --force

Force update without timezone checks.

doctl databases maintenance-window update 123456 --day Wednesday --hour 01

Update maintenance to early morning hours.

Troubleshooting

Common pitfalls

Error: Maintenance window update failed - Invalid database ID.

Solution: Ensure the database ID corresponds to an existing database.

Error: Invalid day specified. Must be a valid weekday.

Solution: Confirm the day of the week used (e.g., Monday).

Error: Maintenance window hour must be between 0 and 23.

Solution: Check hour input to adhere to 24-hour format.

Command Breakdown

What each part is doing

doctl
Base Command
The executable that performs this operation. Here it runs Doctl before the shell applies any redirect operators.
d
d|databases
The value supplied for d|databases.
mw
mw|maintenance window
The value supplied for mw|maintenance window.
u
u|update
The value supplied for u|update.
<database_id>
database id
The value supplied for database id.
<day_of_the_week>
day of the week
The value supplied for day of the week.
<hour_in_24_hours_format>
hour in 24 hours format
The value supplied for hour in 24 hours format.
--day
Command Option
Tool-specific option used by this command invocation.
--hour
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.