This page describes how to manage Goldengate deployments in Google Cloud.

## Before you begin

- Make sure that you have the required Identity and Access Management (IAM) roles and
  permissions to perform the tasks described in this page:

  - `roles/oracledatabase.goldenGateDeploymentAdmin`
  - `roles/oracledatabase.goldenGateDeploymentViewer`

  For information on how to assign roles, see
  [Apply IAM roles](https://docs.cloud.google.com/oracle/database/docs/iam-roles.md.txt).

## View deployment details

To view information about your Goldengate deployments, do the following:

### Console

1. Go to the **Goldengate** page.

   [Go to Goldengate](https://console.cloud.google.com/oracle/golden-gate/)
2. Select the **Deployments** tab.

   The **Deployment** section shows you the list of deployments.
3. To view details of a deployment, click the name of the deployment.

### gcloud

- **List deployments**

  Use the `gcloud oracle-database goldengate-deployments list` command to
  list deployments.

      gcloud oracle-database goldengate-deployments list \
          --project=PROJECT_ID \
          --location=REGION

  Replace the following:
  - <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project. If you're using a Shared VPC, then this is the ID of your host project.
  - <var translate="no">REGION</var>: the region where you want to view the deployments.
- **View deployment details**

  Use the `gcloud oracle-database goldengate-deployments describe` command to
  view details of a deployment.

      gcloud oracle-database goldengate-deployments describe DEPLOYMENT_ID \
          --project=PROJECT_ID \
          --location=REGION

  Replace the following:
  - <var translate="no">DEPLOYMENT_ID</var>: the ID of the deployment.
  - <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project. If you're using a Shared VPC, then this is the ID of your host project.
  - <var translate="no">REGION</var>: the region where your deployment is located.

### API

- **List Goldengate deployments**

  To list deployments, run the following `curl` command:

  ```
  curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  "https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/goldengateDeployments"
  ```

  Replace the following:
  - <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project. If you're using a Shared VPC, then this project ID is the ID of your host project.
  - <var translate="no">REGION</var>: the region where you want to view the deployments.
- **View Goldengate deployment details**

  To view details of a deployment, run the following `curl` command:

  ```
  curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  "https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/goldengateDeployments/DEPLOYMENT_ID"
  ```

  Replace <var translate="no">DEPLOYMENT_ID</var> with the ID of your deployment.

## Start a deployment

Starting an instance allows connections and operations.

To start a Goldengate deployment instance, do the following:

### gcloud

Use the `gcloud oracle-database goldengate-deployments start`
command to start a deployment instance.

    gcloud oracle-database goldengate-deployments start DEPLOYMENT_ID \
        --project=PROJECT_ID \
        --location=REGION \

Replace the following:

- <var translate="no">DEPLOYMENT_ID</var>: the ID of your deployment
- <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project
- <var translate="no">REGION</var>: the region where your deployment is located

### API

To start a Goldengate deployment instance, run the following `curl` command:

```
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/goldengateDeployments/DEPLOYMENT_ID:start"
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project.
- <var translate="no">REGION</var>: the region where your deployment is located.
- <var translate="no">DEPLOYMENT_ID</var>: the ID of your deployment.

A deployment instance continues to run until you stop it.

## Stop a deployment

Stopping a deployment shuts down the deployment instance, along with its
connections, open files, and running operations. It remains stopped until you
restart it.

To stop a Goldengate deployment, do the following:

### gcloud

Use the `gcloud oracle-database goldengate-deployments stop`
command to stop a deployment instance.

    gcloud oracle-database goldengate-deployments stop DEPLOYMENT_ID \
        --project=PROJECT_ID \
        --location=REGION \

Replace the following:

- <var translate="no">DEPLOYMENT_ID</var>: the ID of your deployment
- <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project
- <var translate="no">REGION</var>: the region where your deployment is located

### API

To stop a Goldengate deployment, run the following `curl` command:

```
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/goldengateDeployments/DEPLOYMENT_ID:stop"
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project which contains your deployment
- <var translate="no">REGION</var>: the region where your deployment is located
- <var translate="no">DEPLOYMENT_ID</var>: the ID of your deployment

## Modify a deployment

You can modify your Goldengate deployment in the OCI console. To modify a
deployment in the OCI console, do the following:

1. Go to the **Goldengate** page.

   [Go to Goldengate](https://console.cloud.google.com/oracle/golden-gate/)
2. Select the **Deployments** tab.

   The **Deployment** section shows you the list of deployments.
3. For the deployment which you want to modify, click
   **View actions** ,
   and then click **Manage in OCI**.

You're redirected to the OCI page to modify your Goldengate deployment.

## Delete a deployment

Deleting a deployment also deletes its connection assignment.

To delete a deployment, do the following:

### Console

1. Go to the **Goldengate** page.

   [Go to Goldengate](https://console.cloud.google.com/oracle/golden-gate/)
2. Select the **Deployments** tab.

3. For the deployment which you want to delete,
   click **View actions** ,
   and then click **Delete**.

4. In the **Delete deployment?** dialog, type the deployment
   ID to confirm the deletion of your deployment.

5. Click **Confirm**.

### gcloud

Use the `gcloud oracle-database goldengate-deployments delete` command to
delete a deployment.

    gcloud oracle-database goldengate-deployments delete DEPLOYMENT_ID \
        --project=PROJECT_ID \
        --location=REGION

Replace the following:

- <var translate="no">DEPLOYMENT_ID</var>: the ID of the deployment.
- <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project. If you're using a Shared VPC, then this is the ID of your host project.
- <var translate="no">REGION</var>: the region where your deployment is located.

### API

To delete a Goldengate deployment, run the following `curl` command:

```
curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/goldengateDeployments/DEPLOYMENT_ID"
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project which contains the deployment to be deleted. If you're using a Shared VPC, then this is the ID of your host project.
- <var translate="no">REGION</var>: the region where your deployment is located.
- <var translate="no">DEPLOYMENT_ID</var>: the ID of your deployment.