Create and manage instances

This page describes how to create, list, edit, and delete Spanner instances.

Create an instance

You can create an instance with the Google Cloud console, the Google Cloud CLI, or client libraries. You can also create an instance with a custom instance configuration by adding optional read-only replicas.

Console

  1. In the Google Cloud console, go to the Spanner Instances page.

  2. Click Create instance.

    Go to Create instance

  3. In the Select an edition section, select a Spanner edition.

    If you want to compare the specifications between the different editions, then click Compare editions. For more information, see the Spanner editions overview.

  4. Click Continue.

  5. In the Name your instance section, enter an Instance name to display in the Google Cloud console. The instance name must be unique within your Google Cloud project.

  6. Enter an Instance ID to permanently identify your instance. The instance ID must also be unique within your Google Cloud project. You can't change the instance ID later.

  7. Click Continue.

  8. In the Configure your instance section, under Choose a configuration, select Regional, Dual-region, or Multi-region.

  9. Select a configuration location from the drop-down.

  10. Optional: To add a read-only replica to a Spanner base configuration, first create a custom instance configuration using the Google Cloud CLI. Adding optional read-only replicas to a base configuration is available in the Enterprise edition and Enterprise Plus edition.

  11. Click Continue.

  12. In the Allocate compute capacity section, under Select unit, click one of the following:

    • Nodes for large instances. A node is 1000 processing units.
    • Processing units for small instances.

    For more information, see Compute capacity, nodes and processing units.

  13. Under Choose a scaling mode, click one of the following:

    • Manual allocation if you want to manually set compute capacity for fixed compute resources and costs.

      • Quantity indicates the number of processing units or nodes to use for this instance.
    • Autoscaling to let Spanner automatically add and remove compute capacity. Managed autoscaler is available in the Spanner Enterprise edition and Enterprise Plus edition. For more information about the managed autoscaler, see Managed autoscaler for Spanner. Configure the following managed autoscaler options:

      • Minimum indicates the minimum limit to scale down to, depending on the measurement unit that you choose for Compute capacity. For more information, see Determine the minimum limit.
      • Maximum indicates the maximum limit to scale up to, depending on the measurement unit that you choose for Compute capacity. For more information, see Determine the maximum limit.
      • High priority CPU utilization target indicates the target percentage of high priority CPU to use. For more information, see Determine the CPU utilization target.
      • Storage utilization target indicates the target percentage of storage to use. For more information, see Determine the Storage Utilization Target.
  14. Optional: If you select Autoscaling as the scaling mode, you can click the Show asymmetric autoscaling options dropdown to autoscale your read-only replicas independently from other replicas. For more information, see Asymmetric read-only autoscaling.

    1. Select the read-only replica you want to asymmetrically autoscale.

    2. Configure the following asymmetric autoscaler options:

      • Minimum indicates the minimum limit to scale down to, depending on the measurement unit that you choose for Compute capacity. For more information, see Determine the minimum limit.
      • Maximum indicates the maximum limit to scale up to, depending on the measurement unit that you choose for Compute capacity. For more information, see Determine the maximum limit.
      • High priority CPU utilization target indicates the target percentage of high priority CPU to use. For more information, see Determine the CPU utilization target.
  15. Under Backups, the Enable default backup schedules checkbox is checked by default. To disable default backup schedules, uncheck the checkbox. When enabled, all new databases in the instance have full backups created every 24 hours. These backups are retained for 7 days. You can edit or delete the default backup schedules at any time. For more information, see Default backup schedules.

  16. Click Create to create the instance.

gcloud

Use the gcloud spanner instances create command to create an instance. Specify the compute capacity as the number of nodes or processing units that you want on the instance.

gcloud spanner instances create INSTANCE_ID \
--edition=EDITION \
--config=INSTANCE_CONFIG \
--description=INSTANCE_DESCRIPTION \
--default-backup-schedule-type=DEFAULT_BACKUP_SCHEDULE_TYPE \
--nodes=NODE_COUNT

or

gcloud spanner instances create INSTANCE_ID \
--edition=EDITION \
--config=INSTANCE_CONFIG \
--description=INSTANCE_DESCRIPTION \
--default-backup-schedule-type=DEFAULT_BACKUP_SCHEDULE_TYPE \
--processing-units=PROCESSING_UNIT_COUNT

Replace the following:

  • INSTANCE-ID: a permanent identifier that is unique within your Google Cloud project. You can't change the instance ID later.
  • INSTANCE-CONFIG: a permanent identifier of your instance configuration, which defines the geographic location of the instance and affects how data is replicated. For custom instance configurations, it starts with custom-. For more information, see instance configurations.
  • INSTANCE_DESCRIPTION: the name to display for the instance in the Google Cloud console. The instance name must be unique within your Google Cloud project.
  • DEFAULT_BACKUP_SCHEDULE_TYPE: the default backup schedule type that is used in the instance. Must be one of the following values:

    • AUTOMATIC: a default backup schedule is created automatically when a new database is created in the instance. The default backup schedule creates a full backup every 24 hours. These full backups are retained for 7 days. You can edit or delete the default backup schedule once it's created.
    • NONE: a default backup schedule isn't created automatically when a new database is created in the instance.
  • NODE-COUNT: the compute capacity of the instance, expressed as a number of nodes. Each node equals 1000 processing units.

  • PROCESSING_UNIT_COUNT: the compute capacity of the instance, expressed as a number of processing units. Enter quantities up to 1000 in multiples of 100 (100, 200, 300 and so on) and enter greater quantities in multiples of 1000 (1000, 2000, 3000 and so on). Note: Don't use this parameter if you're creating an instance that you intend to enable with the managed autoscaler later.

Add managed autoscaling

You can also create Enterprise edition and Enterprise Plus edition instances to use managed autoscaling with the gcloud spanner instances create command. For more information, see Managed autoscaler for Spanner.

Use the following command to create an instance with managed autoscaler.

  gcloud spanner instances create INSTANCE_ID \
    --edition=EDITION \
    --config=INSTANCE_CONFIG \
    --description=INSTANCE_DESCRIPTION \
    --autoscaling-min-processing-units=MINIMUM_PROCESSING_UNITS \
    --autoscaling-max-processing-units=MAXIMUM_PROCESSING_UNITS \
    --autoscaling-high-priority-cpu-target=CPU_PERCENTAGE \
    --autoscaling-storage-target=STORAGE_PERCENTAGE \
    [--asymmetric-autoscaling-option \
       location=ASYMMETRIC_AUTOSCALING_LOCATION,min_nodes=ASYMMETRIC_AUTOSCALING_MIN,\
       max_nodes=ASYMMETRIC_AUTOSCALING_MAX,high_priority_cpu_target=ASYMMETRIC_CPU_TARGET]

or

  gcloud spanner instances create INSTANCE_ID \
    --edition=EDITION \
    --config=INSTANCE_CONFIG \
    --description=INSTANCE_DESCRIPTION \
    --autoscaling-min-nodes=MINIMUM_NODES \
    --autoscaling-max-nodes=MAXIMUM_NODES \
    --autoscaling-high-priority-cpu-target=CPU_PERCENTAGE \
    --autoscaling-storage-target=STORAGE_PERCENTAGE \
    [--asymmetric-autoscaling-option \
       location=ASYMMETRIC_AUTOSCALING_LOCATION,min_nodes=ASYMMETRIC_AUTOSCALING_MIN,\
       max_nodes=ASYMMETRIC_AUTOSCALING_MAX,high_priority_cpu_target=ASYMMETRIC_CPU_TARGET]

Replace the following:

  • INSTANCE-ID: a permanent identifier that is unique within your Google Cloud project. You can't change the instance ID later.
  • INSTANCE-CONFIG: a permanent identifier of your instance configuration, which defines the geographic location of the instance and affects how data is replicated. For custom instance configurations, it starts with custom-. For more information, see instance configurations.
  • INSTANCE-DESCRIPTION: the name to display for the instance in the Google Cloud console. The instance name must be unique within your Google Cloud project.
  • MINIMUM_PROCESSING_UNITS, MINIMUM_NODES: the minimum number of processing units or nodes when scaling down. For more information, see Determine the minimum limit.
  • MAXIMUM_PROCESSING_UNITS, MAXIMUM_NODES: the maximum number of processing units or nodes when scaling up. For more information, see Determine the maximum limit.
  • CPU_PERCENTAGE: the target percentage of high priority CPU to use, from 10 to 90%. If you're optimizing for cost, then use a higher percentage. For more information, see Determine the CPU utilization target.
  • STORAGE_PERCENTAGE: the target percentage of storage to use, from 10 to 99%. For more information, see Determine the storage utilization target.

Optional flags:

  • --asymmetric-autoscaling-option: use this flag to enable asymmetric autoscaling. Replace the following parameters:

    • ASYMMETRIC_AUTOSCALING_LOCATION: if the flag is used, then this parameter is required. The location of the read-only region that you want to scale asymmetrically.
    • ASYMMETRIC_AUTOSCALING_MIN: optional parameter. The minimum number of nodes when scaling down.
    • ASYMMETRIC_AUTOSCALING_MAX: optional parameter. The maximum number of nodes when scaling up.
    • ASYMMETRIC_CPU_TARGET: optional parameter. The target percentage of high priority CPU to use, from 10 to 90%. If you're optimizing for cost, then use a higher percentage.

Examples for using custom configurations

To create an instance test-instance in the base regional instance configuration us-central1, run:

gcloud spanner instances create test-instance --edition=STANDARD --config=regional-us-central1 \
  --description="Test Instance" --nodes=1

To create an instance custom-eur6-instance in the custom multi-region instance configuration custom-eur6, first create a custom instance configuration.

Then, run:

  gcloud spanner instances create custom-eur6-instance --edition=ENTERPRISE_PLUS --config=custom-eur6 \
      --description="Instance with custom read-only" --nodes=1

You should see a message similar to the following example after running either one of the previous commands:

Creating instance...done.

C++

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

C#

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Create an instance without a default backup schedule

Go

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Create an instance with managed autoscaling using Go

Create an instance with asymmetric read-only autoscaling using Go

Create an instance without a default backup schedule

Java

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Create an instance with managed autoscaling using Java

Create an instance with asymmetric read-only autoscaling using Java

Create an instance without a default backup schedule

Node.js

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Create an instance with managed autoscaling using Node.js

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Create an instance without a default backup schedule

PHP

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Python

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Create an instance with managed autoscaling using Python

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Create an instance without a default backup schedule

Ruby

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

List instances

You can show a list of your Spanner instances.

Console

Go to the Spanner Instances page in the Google Cloud console.

Go to the Instances page

The Google Cloud console shows a list of your Spanner instances, along with each instance's ID, display name, configuration, and compute capacity expressed in both processing units and in nodes.

gcloud

Use the gcloud spanner instances list command:

gcloud spanner instances list

The gcloud CLI prints a list of your Spanner instances, along with each instance's ID, display name, configuration, and compute capacity.

Edit an instance

The following sections explain how to upgrade the edition of your instance, and change an instance's display name, compute capacity, and default backup schedule type. You can't change the instance ID or instance configuration (however, you can move your instance).

Upgrade the edition

You can upgrade your Standard edition instances to a higher-tier edition. Standard edition instances can be upgraded to the Enterprise edition or Enterprise Plus edition. Enterprise edition instances can be upgraded to the Enterprise Plus edition. The edition upgrade takes approximately 10 minutes to complete with zero downtime.

Console

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Click the name of the instance that you want to upgrade.

  3. Click Upgrade next to the edition type.

  4. In the Edition instance page, and under Update edition, select the new higher-tier edition for your instance.

  5. Click Save.

gcloud

Use the gcloud spanner instances update command to upgrade your instance's edition:

gcloud spanner instances update INSTANCE_ID --edition=EDITION \
[--async]

Replace the following:

  • INSTANCE_ID: the permanent identifier for the instance.
  • EDITION: specify the new higher-tier edition for your instance. For more information, see the Spanner editions overview.

Optional flags:

  • --async: Use this flag if you want your request to return immediately, without waiting for the operation in progress to complete. You can check the status of your request by running gcloud spanner operations describe.

Go

Java

Node.js

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Python

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Downgrade the edition

You can downgrade your Spanner instances to a lower-tier edition. You must stop using the higher-tier edition features in order to downgrade. Enterprise edition instances can be downgraded to the Standard edition. Enterprise Plus edition instances can be downgraded to the Enterprise edition or Standard edition. The edition downgrade takes approximately 10 minutes to complete with zero downtime.

gcloud

Use the gcloud spanner instances update command to downgrade your instance's edition:

gcloud spanner instances update INSTANCE_ID --edition=EDITION

Replace the following:

  • INSTANCE_ID: the permanent identifier for the instance.
  • EDITION: specify the new lower-tier edition for your instance. For more information, see the Spanner editions overview.

Change the display name

Console

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Click the name of the instance that you want to rename.

  3. Click Edit instance.

  4. Enter a new instance name. This name must be unique within the Google Cloud project.

  5. Click Save.

gcloud

Use the gcloud spanner instances update command:

gcloud spanner instances update INSTANCE_ID --description=INSTANCE_NAME

Replace the following:

  • INSTANCE_ID: the permanent identifier for the instance.
  • INSTANCE_NAME: the name to display for the instance in the Google Cloud console. The instance name must be unique within your Google Cloud project.

Change the compute capacity

You must provision enough compute capacity to keep CPU utilization and storage utilization below the recommended maximums. For more information, see the quotas and limits for Spanner.

You can reduce the compute capacity of a Spanner instance except in the following scenarios:

  • You can't store more than 10 TiB of data per node (1000 processing units).

  • There are a large number of splits for your instance's data. In this scenario, Spanner might not be able to manage the splits after you reduce compute capacity. You can try reducing the compute capacity by progressively smaller amounts until you find the minimum capacity that Spanner needs to manage all of the instance's splits.

    Spanner can create a large number of splits to accommodate your usage patterns. If your usage patterns change, then after one or two weeks, Spanner might merge some splits together and you can try to reduce the instance's compute capacity.

When removing compute capacity, monitor your CPU utilization and request latencies in Cloud Monitoring to ensure CPU utilization stays under 65% for regional instances and 45% for each region in multi-region instances. You might experience a temporary increase in request latencies while removing compute capacity.

If you want to increase the compute capacity of an instance, your Google Cloud project must have sufficient quota to add the compute capacity. The time it takes for the increase request to complete depends on the size of the request. In most cases, requests complete within a few minutes. On rare occasions, a scale up might take up to an hour to complete.

Console

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Click the name of the instance that you want to change.

  3. Click Edit Instance.

  4. Change the compute capacity by choosing the measurement units (processing units or nodes) and then entering a quantity. When using processing units, enter quantities up to 1000 in multiples of 100 (100, 200, 300 and so on) and enter greater quantities in multiples of 1000 (1000, 2000, 3000 and so on). Each node equals 1000 processing units.

  5. Click Save.

If you see a dialog that says you have insufficient quota to add compute capacity in this location, follow the instructions to request a higher quota.

gcloud

Use the gcloud spanner instances update command. When using this command, specify the compute capacity as a number of nodes or processing units.

gcloud spanner instances update INSTANCE_ID --nodes=NODE_COUNT
[--async]

or

gcloud spanner instances update INSTANCE_ID
--processing-units=PROCESSING_UNIT_COUNT [--async]

Replace the following:

  • INSTANCE_ID: the permanent identifier for the instance.
  • NODE_COUNT: the compute capacity of the instance, expressed as a number of nodes. Each node equals 1000 processing units.
  • PROCESSING_UNIT_COUNT: the compute capacity of the instance, expressed as a number of processing units. Enter quantities up to 1000 in multiples of 100 (100, 200, 300 and so on) and enter greater quantities in multiples of 1000 (1000, 2000, 3000 and so on).

Optional flags:

  • --async: Use this flag if you want your request to return immediately, without waiting for the operation in progress to complete. You can check the status of your request by running gcloud spanner operations describe.

Enable or modify managed autoscaler on an instance

You can enable or modify autoscaling on a Spanner instance using the Google Cloud console, the gcloud CLI, or the Spanner client libraries. The following limitations apply when you add or change the managed autoscaling feature on an existing instance:

  • Managed autoscaler is only available in the Enterprise edition or Enterprise Plus edition.
  • You can't enable the managed autoscaler on an instance that you are moving.
  • You can't move an instance while the managed autoscaler is enabled.

Console

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Click the name of the instance that you want to enable the managed autoscaler on.

  3. Click Edit instance.

  4. Under Configure compute capacity, click Autoscaling.

  5. For Minimum, select the minimum limit to use when scaling down. For more information, see Determine the minimum limit.

  6. For Maximum, select the maximum limit to use when scaling up. For more information, see Determine the maximum limit.

  7. For High priority CPU utilization target, select the percentage of high priority CPU to use. For more information, see Determine the CPU utilization target.

  8. For Storage utilization target, select the percentage of storage to use. For more information, see Determine the storage utilization target.

  9. Optional: If you select Autoscaling as the scaling mode, then you can click the Show asymmetric autoscaling options dropdown to autoscale your read-only replicas independently from other replicas.

    1. Select the read-only replica you want to asymmetrically autoscale.

    2. Configure the following autoscaler options:

      • Minimum indicates the minimum limit to scale down to, depending on the measurement unit that you choose for Compute capacity. For more information, see Determine the minimum limit.
      • Maximum indicates the maximum limit to scale up to, depending on the measurement unit that you choose for Compute capacity. For more information, see Determine the maximum limit.
      • High priority CPU utilization target indicates the target percentage of high priority CPU to use. For more information, see Determine the CPU utilization target.
  10. Click Save.

gcloud

Use the gcloud spanner instances update command to add the managed autoscaler to an instance. For more information and limitations, see Google Cloud CLI flags and limitations.

You can add the managed autoscaler with the following command:

  gcloud spanner instances update INSTANCE_ID \
    --autoscaling-min-processing-units=MINIMUM_PROCESSING_UNITS \
    --autoscaling-max-processing-units=MAXIMUM_PROCESSING_UNITS \
    --autoscaling-high-priority-cpu-target=CPU_PERCENTAGE \
    --autoscaling-storage-target=STORAGE_PERCENTAGE \
    [--asymmetric-autoscaling-option \
       location=ASYMMETRIC_AUTOSCALING_LOCATION,min_nodes=ASYMMETRIC_AUTOSCALING_MIN,\
       max_nodes=ASYMMETRIC_AUTOSCALING_MAX,high_priority_cpu_target=ASYMMETRIC_CPU_TARGET]

or

  gcloud spanner instances update INSTANCE_ID \
    --autoscaling-min-processing-units=MINIMUM_NODES \
    --autoscaling-max-processing-units=MAXIMUM_NODES \
    --autoscaling-high-priority-cpu-target=CPU_PERCENTAGE \
    --autoscaling-storage-target=STORAGE_PERCENTAGE \
    [--asymmetric-autoscaling-option \
       location=ASYMMETRIC_AUTOSCALING_LOCATION,min_nodes=ASYMMETRIC_AUTOSCALING_MIN,\
       max_nodes=ASYMMETRIC_AUTOSCALING_MAX,high_priority_cpu_target=ASYMMETRIC_CPU_TARGET]

Replace the following:

  • INSTANCE_ID: the permanent identifier for the instance.
  • MINIMUM_PROCESSING_UNITS, MINIMUM_NODES: the minimum number of processing units or nodes to use when scaling down. For more information, see Determine the minimum limit.
  • MAXIMUM_PROCESSING_UNITS, MAXIMUM_NODES: the maximum number of processing units or nodes to use when scaling up. For more information, see Determine the maximum limit.
  • CPU_PERCENTAGE: the target percentage of high priority CPU to use, from 10% to 90%. If you're optimizing for cost and don't require low latency on all requests, then use a higher percentage. For more information, see Determine the CPU utilization target.
  • STORAGE_PERCENTAGE: the target percentage of storage to use, from 10% to 99%. For more information, see Determine the Storage Utilization Target.

Optional flags:

  • --asymmetric-autoscaling-option: Use this flag to enable asymmetric autoscaling. Replace the following parameters:

    • ASYMMETRIC_AUTOSCALING_LOCATION: if the flag is used, then this parameter is required. The location of the read-only region that you want to scale asymmetrically.
    • ASYMMETRIC_AUTOSCALING_MIN: optional parameter. The minimum number of nodes when scaling down.
    • ASYMMETRIC_AUTOSCALING_MAX: optional parameter. The maximum number of nodes when scaling up.
    • ASYMMETRIC_CPU_TARGET: optional parameter. The target percentage of high priority CPU to use, from 10 to 90%. If you're optimizing for cost, then use a higher percentage.

After you add the managed autoscaler to an instance, you can also modify the managed autoscaler settings. For example, if you want to increase the maximum number of processing units to 10000, run the following command:

gcloud spanner instances update test-instance \
     --autoscaling-max-processing-units=10000

Change an instance from using managed autoscaler to manual scaling

You can change whether a Spanner instance uses manual or managed scaling by using the Google Cloud console, the gcloud CLI, or the Spanner client libraries.

Console

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Click the name of the instance that you want to disable managed autoscaler on.

  3. Under Choose a scaling mode, click Manual allocation.

  4. Click Save.

gcloud

Use the gcloud spanner instances update command to update the instance.

Use the following command to change an instance from using the managed autoscaler to manual scaling:

  gcloud spanner instances update INSTANCE_ID \
  --processing-units=PROCESSING_UNIT_COUNT

or

  gcloud spanner instances update INSTANCE_ID \
  --nodes=NODE_COUNT

Replace the following:

  • INSTANCE_ID: the permanent identifier for the instance.
  • NODE_COUNT: the compute capacity of the instance, expressed as a number of nodes. Each node equals 1000 processing units.
  • PROCESSING_UNIT_COUNT: the compute capacity of the instance, expressed as a number of processing units. Enter quantities up to 1000 in multiples of 100 (100, 200, 300 and so on) and enter greater quantities in multiples of 1000 (1000, 2000, 3000 and so on).

Label an instance

Labels help organize your resources.

Console

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Select the checkbox for the instance. The Info panel appears on the right-hand side of the page.

  3. Click the Labels tab in the Info panel. You can then add, delete or update labels for the Spanner instance.

Edit the default backup schedule type

Default backup schedules are automatically enabled for all new instances. You can enable or disable default backup schedules in an instance when creating the instance or by editing the instance later. For more information, see Default backup schedules.

Console

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Click the name of the instance that you want to edit the default backup schedule.

  3. Click Edit instance.

  4. Under Backups, the Enable default backup schedules checkbox determines whether default backup schedules are enabled or not. When enabled, all new databases in this instance have a default backup schedule created.

  5. Click Save.

gcloud

Use the gcloud spanner instances update command to edit the default backup schedules type.

You can edit the default backup schedule type by running the following command:

  gcloud spanner instances update INSTANCE_ID \
    --default-backup-schedule-type=DEFAULT_BACKUP_SCHEDULE_TYPE

Replace the following:

  • INSTANCE_ID: the permanent identifier for the instance.
  • DEFAULT_BACKUP_SCHEDULE_TYPE: the default backup schedule type that is used in the instance. Must be one of the following values:

    • AUTOMATIC: a default backup schedule is created automatically when a new database is created in the instance. The default backup schedule creates a full backup every 24 hours. These full backups are retained for 7 days. You can edit or delete the default backup schedule once it's created.
    • NONE: a default backup schedule isn't created automatically when a new database is created in the instance.

C#

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Go

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Java

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Node.js

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Python

To learn how to install and use the client library for Spanner, see Spanner client libraries.

To authenticate to Spanner, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Move an instance

For instructions on how to move your instance from any instance configuration to any other instance configuration, including between regional and multi-regional configurations, see Move an instance.

Delete an instance

You can delete an instance with the Google Cloud console or the Google Cloud CLI.

If you want to delete an instance that has one or more databases with deletion protection enabled, you must first disable the deletion protection on all databases in that instance before you can delete the instance.

Console

  1. Go to the Spanner Instances page in the Google Cloud console.

    Go to the Instances page

  2. Click the name of the instance that you want to delete.

  3. Click Delete instance.

  4. Follow the instructions to confirm that you want to delete the instance.

  5. Click Delete.

gcloud

Use the gcloud spanner instances delete command, replacing INSTANCE_ID with the instance ID:

gcloud spanner instances delete INSTANCE_ID

Stop or restart an instance

Spanner is a fully managed database service which oversees its own underlying tasks and resources, including monitoring and restarting processes when necessary with zero downtime. As there is no need to manually stop or restart a given instance, Spanner does not offer a way to do so.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.