> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RESUME JOB

The `RESUME JOB` [statement](https://docs.cockroachlabs.com/docs/v24.2/sql-statements) lets you resume the following types of jobs:

* [`IMPORT`](https://docs.cockroachlabs.com/docs/v24.2/import-into) jobs
* [`BACKUP`](https://docs.cockroachlabs.com/docs/v24.2/backup) and [`RESTORE`](https://docs.cockroachlabs.com/docs/v24.2/restore) jobs
* [User-created table statistics](https://docs.cockroachlabs.com/docs/v24.2/create-statistics) jobs
* [Automatic table statistics](https://docs.cockroachlabs.com/docs/v24.2/cost-based-optimizer#table-statistics) jobs
* [Changefeeds](https://docs.cockroachlabs.com/docs/v24.2/create-changefeed)
* [Schema change](https://docs.cockroachlabs.com/docs/v24.2/online-schema-changes) jobs
* [Scheduled backup](https://docs.cockroachlabs.com/docs/v24.2/manage-a-backup-schedule) jobs

## Required privileges

To resume a job, the user must be a member of the `admin` role or must have the [`CONTROLJOB`](https://docs.cockroachlabs.com/docs/v24.2/create-user#create-a-user-that-can-pause-resume-and-cancel-non-admin-jobs) [role option](https://docs.cockroachlabs.com/docs/v24.2/security-reference/authorization) set. Non-admin users cannot resume admin users' jobs.

For changefeeds, users with the [`CHANGEFEED`](https://docs.cockroachlabs.com/docs/v24.2/create-changefeed#required-privileges) privilege on a set of tables can resume changefeed jobs running on those tables.

## Synopsis

![resume\_job syntax diagram](https://mintcdn.com/cockroachlabs/UZNSFbmU2EwEm6G5/images/sql-diagrams/common/resume_job.svg?fit=max\&auto=format\&n=UZNSFbmU2EwEm6G5\&q=85\&s=f3e04285967da7b556e876e020dfe0e1)

### Resume all jobs by type

![resume\_all\_jobs syntax diagram](https://mintcdn.com/cockroachlabs/O8LdfYQ-dz7oGPVh/images/sql-diagrams/v24.2/resume_all_jobs.svg?fit=max\&auto=format\&n=O8LdfYQ-dz7oGPVh\&q=85\&s=79712fb7f401c41df10a658038bdce61)

## Parameters

| Parameter | Description |
| - | - |
| `job_id` | The ID of the job you want to resume, which can be found with [`SHOW JOBS`](https://docs.cockroachlabs.com/docs/v24.2/show-jobs). |
| `select_stmt` | A [selection query](https://docs.cockroachlabs.com/docs/v24.2/selection-queries) that returns `job_id`(s) to resume. |
| `for_schedules_clause` | The schedule you want to resume jobs for. You can resume jobs for a specific schedule (`FOR SCHEDULE id`) or resume jobs for multiple schedules by nesting a [`SELECT` clause](https://docs.cockroachlabs.com/docs/v24.2/select-clause) in the statement (`FOR SCHEDULES <select_clause>`). See the [examples](#resume-jobs-for-a-schedule) below. |
| `BACKUP`, `CHANGEFEED`, `RESTORE`, `IMPORT` | The job type to resume. |

## Examples

### Pause a job

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW JOBS;
```

```
      job_id     |  job_type |               description                      |...
-----------------+-----------+------------------------------------------------+...
  27536791415282 |  RESTORE  | RESTORE db.* FROM 'azure-blob://backup/db/tbl' |...
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> PAUSE JOB 27536791415282;
```

### Resume a single job

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> RESUME JOB 27536791415282;
```

### Resume multiple jobs

To resume multiple jobs, nest a [`SELECT` clause](https://docs.cockroachlabs.com/docs/v24.2/select-clause) that retrieves `job_id`(s) inside the `RESUME JOBS` statement:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> RESUME JOBS (WITH x AS (SHOW JOBS) SELECT job_id FROM x
      WHERE user_name = 'maxroach');
```

All jobs created by `maxroach` will be resumed.

### Resume by job type

To resume all jobs by the type of job, use the `RESUME ALL {job} JOBS` statement. You can resume all `BACKUP`, `RESTORE`, `CHANGEFEED`, `IMPORT` jobs using this statement, for example:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
RESUME ALL BACKUP JOBS;
```

### Resume jobs for a schedule

To resume jobs for a specific [backup schedule](https://docs.cockroachlabs.com/docs/v24.2/create-schedule-for-backup), use the schedule's `id`:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> RESUME JOBS FOR SCHEDULE 590204387299262465;
```

```
RESUME JOBS FOR SCHEDULES 1
```

You can also resume multiple schedules by nesting a [`SELECT` clause](https://docs.cockroachlabs.com/docs/v24.2/select-clause) that retrieves `id`(s) inside the `PAUSE JOBS` statement:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> RESUME JOBS FOR SCHEDULES WITH x AS (SHOW SCHEDULES) SELECT id FROM x WHERE label = 'test_schedule';
```

```
RESUME JOBS FOR SCHEDULES 2
```

## See also

* [`PAUSE JOB`](https://docs.cockroachlabs.com/docs/v24.2/pause-job)
* [`SHOW JOBS`](https://docs.cockroachlabs.com/docs/v24.2/show-jobs)
* [`CANCEL JOB`](https://docs.cockroachlabs.com/docs/v24.2/cancel-job)
* [`BACKUP`](https://docs.cockroachlabs.com/docs/v24.2/backup)
* [`RESTORE`](https://docs.cockroachlabs.com/docs/v24.2/restore)
* [`IMPORT INTO`](https://docs.cockroachlabs.com/docs/v24.2/import-into)
* [`CREATE CHANGEFEED`](https://docs.cockroachlabs.com/docs/v24.2/create-changefeed)
