// 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: "GCP", googleCloudProviderEncryptionKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-googleCloudProviderEncryptionKeyId-Value"
}
,
adminPassword: "EXAMPLE-adminPassword-Value",
dbUniqueName: "EXAMPLE-dbUniqueName-Value",
dbName: "EXAMPLE-dbName-Value",
sidPrefix: "EXAMPLE-sidPrefix-Value",
pluggableDatabases: ["EXAMPLE--Value" ],
storageSizeDetails: {
dataStorageSizeInGBs: 919,
recoStorageSizeInGBs: 193,
}
,
freeformTags: {
EXAMPLE_KEY_EPQkE :"EXAMPLE_VALUE_AoGCf7ovhA6D2hKdOrFN"
},
definedTags: {
EXAMPLE_KEY_sNE3Y :{
EXAMPLE_KEY_dGG8t :"EXAMPLE--Value"
}
},
}
,
freeformTags: {
EXAMPLE_KEY_85jwc :"EXAMPLE_VALUE_P4bYL6SjGMrFBV3n4tzB"
},
definedTags: {
EXAMPLE_KEY_PlpJJ :{
EXAMPLE_KEY_6meYa :"EXAMPLE--Value"
}
},
}
,
databaseEdition: database.models.LaunchDbSystemFromBackupDetails.DatabaseEdition.EnterpriseEdition,
diskRedundancy: database.models.LaunchDbSystemFromBackupDetails.DiskRedundancy.High,
licenseModel: database.models.LaunchDbSystemFromBackupDetails.LicenseModel.BringYourOwnLicense,
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.Lvm,
}
,
storageVolumePerformanceMode: database.models.LaunchDbSystemBase.StorageVolumePerformanceMode.HighPerformance,
sparseDiskgroup: false,
sshPublicKeys: ["EXAMPLE--Value" ],
hostname: "EXAMPLE-hostname-Value",
domain: "EXAMPLE-domain-Value",
cpuCoreCount: 306,
clusterName: "EXAMPLE-clusterName-Value",
dataStoragePercentage: 919,
initialDataStorageSizeInGB: 427,
kmsKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
kmsKeyVersionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value",
nodeCount: 977,
freeformTags: {
EXAMPLE_KEY_mDCAz :"EXAMPLE_VALUE_VkBozxRog6Tn7cX1PzHB"
},
definedTags: {
EXAMPLE_KEY_hCk81 :{
EXAMPLE_KEY_7qzQD :"EXAMPLE--Value"
}
},
securityAttributes: {
EXAMPLE_KEY_ZTqBu :{
EXAMPLE_KEY_imeWq :"EXAMPLE--Value"
}
},
privateIp: "EXAMPLE-privateIp-Value",
privateIpV6: "EXAMPLE-privateIpV6-Value",
clusterPlacementGroupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-clusterPlacementGroupId-Value",
subscriptionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value",
dataCollectionOptions: {
isDiagnosticsEventsEnabled: false,
isHealthMonitoringEnabled: false,
isIncidentLogsEnabled: false,
}
,
computeModel: database.models.LaunchDbSystemBase.ComputeModel.Ecpu,
computeCount: 12
}
const launchDbSystemRequest: database.requests.LaunchDbSystemRequest = {
launchDbSystemDetails: launchDbSystemBase,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
opcDryRun: false,
};
// Send request to the Client.
const launchDbSystemResponse = await client.launchDbSystem(launchDbSystemRequest);
}
catch (error) {
console.log("launchDbSystem Failed with error " + error);
}
})();