# 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).
require 'oci'
# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config
# Initialize service client with default config file
database_client = OCI::Database::DatabaseClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
create_database_response =
database_client.create_database(
OCI::Database::Models::CreateStandByDatabaseDetails.new(
source: 'DATAGUARD',
database:
OCI::Database::Models::CreateStandbyDetails.new(
source_database_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDatabaseId-Value',
database_admin_password: 'EXAMPLE-databaseAdminPassword-Value',
source_tde_wallet_password: 'EXAMPLE-sourceTdeWalletPassword-Value',
protection_mode: 'MAXIMUM_PROTECTION',
transport_type: 'FASTSYNC',
source_encryption_key_location_details:
OCI::Database::Models::AwsEncryptionKeyDetails.new(
provider_type: 'AWS',
aws_encryption_key_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-awsEncryptionKeyId-Value'
),
is_active_data_guard_enabled: false,
db_unique_name: 'EXAMPLE-dbUniqueName-Value',
sid_prefix: 'EXAMPLE-sidPrefix-Value',
storage_size_details:
OCI::Database::Models::DatabaseStorageSizeDetails.new(
data_storage_size_in_gbs: 987, reco_storage_size_in_gbs: 676
),
freeform_tags: {
'EXAMPLE_KEY_jFb3R' => 'EXAMPLE_VALUE_6FAv62FpUxhYDwMPTfr1'
},
defined_tags: {
'EXAMPLE_KEY_k54CT' => { 'EXAMPLE_KEY_kk3s0' => 'EXAMPLE--Value' }
}
),
db_home_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-dbHomeId-Value',
db_version: 'EXAMPLE-dbVersion-Value',
kms_key_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value',
kms_key_version_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value'
)
)
# Get the data from response
puts "#{create_database_response.data}"