// 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).
import * as database from "oci-database";
import common = require("oci-common");
// 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.
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();
(async () => {
try {
// Create a service client
const client = new database.DatabaseClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const launchDbSystemBase = {
source: "DB_BACKUP", dbHome: {
displayName: "EXAMPLE-displayName-Value",
isUnifiedAuditingEnabled: false,
databaseSoftwareImageId: "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value",
database: {
backupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-backupId-Value",
backupTDEPassword: "EXAMPLE-backupTDEPassword-Value",
sourceEncryptionKeyLocationDetails: {
providerType: "EXTERNAL", hsmPassword: "EXAMPLE-hsmPassword-Value"
}
,
adminPassword: "EXAMPLE-adminPassword-Value",
dbUniqueName: "EXAMPLE-dbUniqueName-Value",
dbName: "EXAMPLE-dbName-Value",
sidPrefix: "EXAMPLE-sidPrefix-Value",
pluggableDatabases: ["EXAMPLE--Value" ],
}
,
freeformTags: {
EXAMPLE_KEY_63zsP :"EXAMPLE_VALUE_t4vL7jgGQwLi4hM69GaR"
},
definedTags: {
EXAMPLE_KEY_V2hl2 :{
EXAMPLE_KEY_J7ECK :"EXAMPLE--Value"
}
},
}
,
databaseEdition: database.models.LaunchDbSystemFromBackupDetails.DatabaseEdition.EnterpriseEditionExtremePerformance,
diskRedundancy: database.models.LaunchDbSystemFromBackupDetails.DiskRedundancy.Normal,
licenseModel: database.models.LaunchDbSystemFromBackupDetails.LicenseModel.LicenseIncluded,
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
faultDomains: ["EXAMPLE--Value" ],
displayName: "EXAMPLE-displayName-Value",
availabilityDomain: "EXAMPLE-availabilityDomain-Value",
subnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
backupSubnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-backupSubnetId-Value",
nsgIds: ["EXAMPLE--Value" ],
backupNetworkNsgIds: ["EXAMPLE--Value" ],
shape: "EXAMPLE-shape-Value",
timeZone: "EXAMPLE-timeZone-Value",
dbSystemOptions: {
storageManagement: database.models.DbSystemOptions.StorageManagement.Asm,
}
,
storageVolumePerformanceMode: database.models.LaunchDbSystemBase.StorageVolumePerformanceMode.HighPerformance,
sparseDiskgroup: false,
sshPublicKeys: ["EXAMPLE--Value" ],
hostname: "EXAMPLE-hostname-Value",
domain: "EXAMPLE-domain-Value",
cpuCoreCount: 530,
clusterName: "EXAMPLE-clusterName-Value",
dataStoragePercentage: 768,
initialDataStorageSizeInGB: 429,
kmsKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
kmsKeyVersionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value",
nodeCount: 412,
freeformTags: {
EXAMPLE_KEY_XDC4K :"EXAMPLE_VALUE_80CUdyIHRNDMX3hQE8kH"
},
definedTags: {
EXAMPLE_KEY_M8hs4 :{
EXAMPLE_KEY_ofsY4 :"EXAMPLE--Value"
}
},
securityAttributes: {
EXAMPLE_KEY_Fe0T8 :{
EXAMPLE_KEY_2hUch :"EXAMPLE--Value"
}
},
privateIp: "EXAMPLE-privateIp-Value",
privateIpV6: "EXAMPLE-privateIpV6-Value",
dataCollectionOptions: {
isDiagnosticsEventsEnabled: false,
isHealthMonitoringEnabled: true,
isIncidentLogsEnabled: true,
}
}
const launchDbSystemRequest: database.requests.LaunchDbSystemRequest = {
launchDbSystemDetails: launchDbSystemBase,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
};
// Send request to the Client.
const launchDbSystemResponse = await client.launchDbSystem(launchDbSystemRequest);
}
catch (error) {
console.log("launchDbSystem Failed with error " + error);
}
})();