On this page
Warning:
CockroachDB v20.2 is no longer supported as of May 10, 2022. For more details, refer to the Release Support Policy.
The RESUME JOB
statement lets you resume the following types of jobs:
IMPORT
jobsBACKUP
andRESTORE
jobs- User-created table statistics jobs
- Automatic table statistics jobs
- Changefeeds
- Schema change jobs
- New in v20.2: Scheduled backup jobs
Required privileges
To resume a job, the user must be a member of the admin
role or must have the CONTROLJOB
parameter set.
Synopsis
Parameters
Parameter | Description |
---|---|
job_id |
The ID of the job you want to resume, which can be found with SHOW JOBS . |
select_stmt |
A selection query that returns job_id (s) to resume. |
for_schedules_clause |
New in v20.2: 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 in the statement (FOR SCHEDULES <select_clause> ). See the examples below. |
Examples
Pause a job
> SHOW JOBS;
job_id | job_type | description |...
-----------------+-----------+-------------------------------------------+...
27536791415282 | RESTORE | RESTORE db.* FROM 'azure://backup/db/tbl' |...
> PAUSE JOB 27536791415282;
Resume a single job
> RESUME JOB 27536791415282;
Resume multiple jobs
To resume multiple jobs, nest a SELECT
clause that retrieves job_id
(s) inside the RESUME JOBS
statement:
> RESUME JOBS (SELECT job_id FROM [SHOW JOBS]
WHERE user_name = 'maxroach');
All jobs created by maxroach
will be resumed.
Resume jobs for a schedule
New in v20.2: To resume jobs for a specific backup schedule, use the schedule's id
:
> RESUME JOBS FOR SCHEDULE 590204387299262465;
RESUME JOBS FOR SCHEDULES 1
You can also resume multiple schedules by nesting a SELECT
clause that retrieves id
(s) inside the PAUSE JOBS
statement:
> RESUME JOBS FOR SCHEDULES SELECT id FROM [SHOW SCHEDULES] WHERE label = 'test_schedule';
RESUME JOBS FOR SCHEDULES 2