1. Registry
  2. Packages
  3. Oracle Cloud Infrastructure
  4. API Docs
  5. Database
  6. getDatabaseSnapshot
Viewing docs for Oracle Cloud Infrastructure v5.7.0
published on Thursday, Nov 12, 2026 by Pulumi
oci logo oci logo
Viewing docs for Oracle Cloud Infrastructure v5.7.0
published on Thursday, Nov 12, 2026 by Pulumi

    This data source provides details about a specific Database Snapshot resource in Oracle Cloud Infrastructure Database service.

    Gets information about the specified Exadata Database Snapshot.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testDatabaseSnapshot = oci.database.getDatabaseSnapshot({
        databaseSnapshotId: testDatabaseSnapshotOciDatabaseDatabaseSnapshot.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_database_snapshot = oci.database.get_database_snapshot(database_snapshot_id=test_database_snapshot_oci_database_database_snapshot["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v5/go/oci/database"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := database.GetDatabaseSnapshot(ctx, &database.GetDatabaseSnapshotArgs{
    			DatabaseSnapshotId: testDatabaseSnapshotOciDatabaseDatabaseSnapshot.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testDatabaseSnapshot = Oci.Database.GetDatabaseSnapshot.Invoke(new()
        {
            DatabaseSnapshotId = testDatabaseSnapshotOciDatabaseDatabaseSnapshot.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Database.DatabaseFunctions;
    import com.pulumi.oci.Database.inputs.GetDatabaseSnapshotArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var testDatabaseSnapshot = DatabaseFunctions.getDatabaseSnapshot(GetDatabaseSnapshotArgs.builder()
                .databaseSnapshotId(testDatabaseSnapshotOciDatabaseDatabaseSnapshot.get("id"))
                .build());
    
        }
    }
    
    variables:
      testDatabaseSnapshot:
        fn::invoke:
          function: oci:Database:getDatabaseSnapshot
          arguments:
            databaseSnapshotId: ${testDatabaseSnapshotOciDatabaseDatabaseSnapshot.id}
    
    terraform {
      required_providers {
        oci = {
          source = "pulumi/oci"
        }
      }
    }
    
    data "oci_database_database_snapshot" "testDatabaseSnapshot" {
      database_snapshot_id = testDatabaseSnapshotOciDatabaseDatabaseSnapshot.id
    }
    

    Using getDatabaseSnapshot

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDatabaseSnapshot(args: GetDatabaseSnapshotArgs, opts?: InvokeOptions): Promise<GetDatabaseSnapshotResult>
    function getDatabaseSnapshotOutput(args: GetDatabaseSnapshotOutputArgs, opts?: InvokeOutputOptions): Output<GetDatabaseSnapshotResult>
    def get_database_snapshot(database_snapshot_id: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetDatabaseSnapshotResult
    def get_database_snapshot_output(database_snapshot_id: pulumi.Input[Optional[str]] = None,
                              opts: Optional[InvokeOutputOptions] = None) -> Output[GetDatabaseSnapshotResult]
    func LookupDatabaseSnapshot(ctx *Context, args *LookupDatabaseSnapshotArgs, opts ...InvokeOption) (*LookupDatabaseSnapshotResult, error)
    func LookupDatabaseSnapshotOutput(ctx *Context, args *LookupDatabaseSnapshotOutputArgs, opts ...InvokeOption) LookupDatabaseSnapshotResultOutput

    > Note: This function is named LookupDatabaseSnapshot in the Go SDK.

    public static class GetDatabaseSnapshot 
    {
        public static Task<GetDatabaseSnapshotResult> InvokeAsync(GetDatabaseSnapshotArgs args, InvokeOptions? opts = null)
        public static Output<GetDatabaseSnapshotResult> Invoke(GetDatabaseSnapshotInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetDatabaseSnapshotResult> Invoke(GetDatabaseSnapshotInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetDatabaseSnapshotResult> getDatabaseSnapshot(GetDatabaseSnapshotArgs args, InvokeOptions options)
    public static Output<GetDatabaseSnapshotResult> getDatabaseSnapshot(GetDatabaseSnapshotArgs args, InvokeOptions options)
    public static Output<GetDatabaseSnapshotResult> getDatabaseSnapshot(GetDatabaseSnapshotArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: oci:Database/getDatabaseSnapshot:getDatabaseSnapshot
      arguments:
        # arguments dictionary
    data "oci_database_get_database_snapshot" "name" {
        # arguments
    }

    The following arguments are supported:

    DatabaseSnapshotId string
    The Exadata Database Snapshot OCID.
    DatabaseSnapshotId string
    The Exadata Database Snapshot OCID.
    database_snapshot_id string
    The Exadata Database Snapshot OCID.
    databaseSnapshotId String
    The Exadata Database Snapshot OCID.
    databaseSnapshotId string
    The Exadata Database Snapshot OCID.
    database_snapshot_id str
    The Exadata Database Snapshot OCID.
    databaseSnapshotId String
    The Exadata Database Snapshot OCID.

    getDatabaseSnapshot Result

    The following output properties are available:

    ClusterId string
    The OCID of the VM cluster.
    CompartmentId string
    The OCID of the compartment.
    DatabaseId string
    The OCID of the Exadata Database.
    DatabaseSnapshotId string
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    FreeformTags Dictionary<string, string>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of the Exadata Database Snapshot.
    LifecycleDetails string
    Additional information about the current lifecycle state of the Exadata Database Snapshot.
    Name string
    The user-friendly name for the Database Snapshot. The name should be unique.
    State string
    The current state of the Exadata Database Snapshot.
    SystemTags Dictionary<string, string>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    TimeCreated string
    The date and time that the Exadata Database Snapshot was created, as expressed in RFC 3339 format. For example: 2023-06-27T21:10:29Z
    ClusterId string
    The OCID of the VM cluster.
    CompartmentId string
    The OCID of the compartment.
    DatabaseId string
    The OCID of the Exadata Database.
    DatabaseSnapshotId string
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    FreeformTags map[string]string
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of the Exadata Database Snapshot.
    LifecycleDetails string
    Additional information about the current lifecycle state of the Exadata Database Snapshot.
    Name string
    The user-friendly name for the Database Snapshot. The name should be unique.
    State string
    The current state of the Exadata Database Snapshot.
    SystemTags map[string]string
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    TimeCreated string
    The date and time that the Exadata Database Snapshot was created, as expressed in RFC 3339 format. For example: 2023-06-27T21:10:29Z
    cluster_id string
    The OCID of the VM cluster.
    compartment_id string
    The OCID of the compartment.
    database_id string
    The OCID of the Exadata Database.
    database_snapshot_id string
    defined_tags map(string)
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    freeform_tags map(string)
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id string
    The OCID of the Exadata Database Snapshot.
    lifecycle_details string
    Additional information about the current lifecycle state of the Exadata Database Snapshot.
    name string
    The user-friendly name for the Database Snapshot. The name should be unique.
    state string
    The current state of the Exadata Database Snapshot.
    system_tags map(string)
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    time_created string
    The date and time that the Exadata Database Snapshot was created, as expressed in RFC 3339 format. For example: 2023-06-27T21:10:29Z
    clusterId String
    The OCID of the VM cluster.
    compartmentId String
    The OCID of the compartment.
    databaseId String
    The OCID of the Exadata Database.
    databaseSnapshotId String
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    freeformTags Map<String,String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of the Exadata Database Snapshot.
    lifecycleDetails String
    Additional information about the current lifecycle state of the Exadata Database Snapshot.
    name String
    The user-friendly name for the Database Snapshot. The name should be unique.
    state String
    The current state of the Exadata Database Snapshot.
    systemTags Map<String,String>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    timeCreated String
    The date and time that the Exadata Database Snapshot was created, as expressed in RFC 3339 format. For example: 2023-06-27T21:10:29Z
    clusterId string
    The OCID of the VM cluster.
    compartmentId string
    The OCID of the compartment.
    databaseId string
    The OCID of the Exadata Database.
    databaseSnapshotId string
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    freeformTags {[key: string]: string}
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id string
    The OCID of the Exadata Database Snapshot.
    lifecycleDetails string
    Additional information about the current lifecycle state of the Exadata Database Snapshot.
    name string
    The user-friendly name for the Database Snapshot. The name should be unique.
    state string
    The current state of the Exadata Database Snapshot.
    systemTags {[key: string]: string}
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    timeCreated string
    The date and time that the Exadata Database Snapshot was created, as expressed in RFC 3339 format. For example: 2023-06-27T21:10:29Z
    cluster_id str
    The OCID of the VM cluster.
    compartment_id str
    The OCID of the compartment.
    database_id str
    The OCID of the Exadata Database.
    database_snapshot_id str
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    freeform_tags Mapping[str, str]
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id str
    The OCID of the Exadata Database Snapshot.
    lifecycle_details str
    Additional information about the current lifecycle state of the Exadata Database Snapshot.
    name str
    The user-friendly name for the Database Snapshot. The name should be unique.
    state str
    The current state of the Exadata Database Snapshot.
    system_tags Mapping[str, str]
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    time_created str
    The date and time that the Exadata Database Snapshot was created, as expressed in RFC 3339 format. For example: 2023-06-27T21:10:29Z
    clusterId String
    The OCID of the VM cluster.
    compartmentId String
    The OCID of the compartment.
    databaseId String
    The OCID of the Exadata Database.
    databaseSnapshotId String
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    freeformTags Map<String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of the Exadata Database Snapshot.
    lifecycleDetails String
    Additional information about the current lifecycle state of the Exadata Database Snapshot.
    name String
    The user-friendly name for the Database Snapshot. The name should be unique.
    state String
    The current state of the Exadata Database Snapshot.
    systemTags Map<String>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
    timeCreated String
    The date and time that the Exadata Database Snapshot was created, as expressed in RFC 3339 format. For example: 2023-06-27T21:10:29Z

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo oci logo
    Viewing docs for Oracle Cloud Infrastructure v5.7.0
    published on Thursday, Nov 12, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial