// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).
package main
import (
"context"
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/database"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
)
func ExampleCreateDbHome() {
// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
client, err := database.NewDatabaseClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := database.CreateDbHomeRequest{CreateDbHomeWithDbSystemIdDetails: database.CreateDbHomeWithDbSystemIdDetails{Database: &database.CreateDatabaseDetails{SidPrefix: common.String("EXAMPLE-sidPrefix-Value"),
DatabaseSoftwareImageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value"),
DbUniqueName: common.String("EXAMPLE-dbUniqueName-Value"),
NcharacterSet: common.String("EXAMPLE-ncharacterSet-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_i8u5c": "EXAMPLE_VALUE_PvzfSzdg3SZ9TRBBwg6m"},
KmsKeyVersionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
PdbName: common.String("EXAMPLE-pdbName-Value"),
TdeWalletPassword: common.String("EXAMPLE-tdeWalletPassword-Value"),
VaultId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value"),
CharacterSet: common.String("EXAMPLE-characterSet-Value"),
DbBackupConfig: &database.DbBackupConfig{AutoFullBackupWindow: database.DbBackupConfigAutoFullBackupWindowSix,
BackupDeletionPolicy: database.DbBackupConfigBackupDeletionPolicyAfterRetentionPeriod,
BackupDestinationDetails: []database.BackupDestinationDetails{database.BackupDestinationDetails{Id: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
InternetProxy: common.String("EXAMPLE-internetProxy-Value"),
Type: database.BackupDestinationDetailsTypeLocal,
VpcPassword: common.String("EXAMPLE-vpcPassword-Value"),
VpcUser: common.String("EXAMPLE-vpcUser-Value"),
DbrsPolicyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-dbrsPolicyId-Value")}},
RecoveryWindowInDays: common.Int(16),
RunImmediateFullBackup: common.Bool(false),
AutoBackupEnabled: common.Bool(true),
AutoBackupWindow: database.DbBackupConfigAutoBackupWindowFour,
AutoFullBackupDay: database.DbBackupConfigAutoFullBackupDayMonday},
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_Z8z8L": map[string]interface{}{"EXAMPLE_KEY_XLVF0": "EXAMPLE--Value"}},
AdminPassword: common.String("EXAMPLE-adminPassword-Value"),
DbName: common.String("EXAMPLE-dbName-Value"),
DbWorkload: database.CreateDatabaseDetailsDbWorkloadDss,
KmsKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value")},
DbSystemId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-dbSystemId-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_s6tDB": map[string]interface{}{"EXAMPLE_KEY_MmKAD": "EXAMPLE--Value"}},
IsDesupportedVersion: common.Bool(false),
KmsKeyVersionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
DatabaseSoftwareImageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value"),
DbVersion: common.String("EXAMPLE-dbVersion-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_QF1nY": "EXAMPLE_VALUE_pTgC6h2l9Qs8focui5T4"},
IsUnifiedAuditingEnabled: common.Bool(true),
KmsKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value")},
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}
// Send the request using the service client
resp, err := client.CreateDbHome(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}