> ## 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.

# ALTER JOB

The `ALTER JOB` statement transfers ownership of a [job](/docs/stable/show-jobs.md) between [users](/docs/stable/create-user.md) or [roles](/docs/stable/create-role.md).

## Required privileges

To alter job ownership, the user must be one of the following:

* The current job owner.
* A member of the role that is the current owner.
* An `admin`.

Unless the user is an `admin`, they can only transfer ownership of a job to themselves or to a role of which they are a member.

To add a user to a role, refer to the [`GRANT`](/docs/stable/grant) statement.

## Synopsis

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

### Parameters

| Parameter | Description |
| - | - |
| `a_expr` | The job ID to modify. |
| `role_spec` | The role or user. |

## Example

To transfer job ownership from the user who created the job to a role they're a member of:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
ALTER JOB job_id OWNER TO role_name;
```

## See also

* [`SHOW JOBS`](/docs/stable/show-jobs)
* [`PAUSE JOB`](/docs/stable/pause-job)
* [`RESUME JOB`](/docs/stable/resume-job)
* [`CANCEL JOB`](/docs/stable/cancel-job)
