// 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: "DATABASE", dbHome: {
displayName: "EXAMPLE-displayName-Value",
database: {
databaseId: "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
backupTDEPassword: "EXAMPLE-backupTDEPassword-Value",
adminPassword: "EXAMPLE-adminPassword-Value",
dbUniqueName: "EXAMPLE-dbUniqueName-Value",
dbName: "EXAMPLE-dbName-Value",
timeStampForPointInTimeRecovery: new Date("Sat Mar 04 19:29:12 UTC 2023"),
pluggableDatabases: ["EXAMPLE--Value" ],
freeformTags: {
EXAMPLE_KEY_7NO1i :"EXAMPLE_VALUE_2u0LKIB2UUliFEmLbGaI"
},
definedTags: {
EXAMPLE_KEY_h1D33 :{
EXAMPLE_KEY_ionKl :"EXAMPLE--Value"
}
},
sidPrefix: "EXAMPLE-sidPrefix-Value",
sourceEncryptionKeyLocationDetails: {
providerType: "EXTERNAL", hsmPassword: "EXAMPLE-hsmPassword-Value"
}
,
storageSizeDetails: {
dataStorageSizeInGBs: 386,
recoStorageSizeInGBs: 885,
}
,
vmClusterId: "ocid1.test.oc1..<unique_ID>EXAMPLE-vmClusterId-Value",
}
,
isUnifiedAuditingEnabled: true,
freeformTags: {
EXAMPLE_KEY_KyNGY :"EXAMPLE_VALUE_D5znI0TgGNCMeL5j0HW2"
},
definedTags: {
EXAMPLE_KEY_3nIJ2 :{
EXAMPLE_KEY_cYY0l :"EXAMPLE--Value"
}
},
}
,
databaseEdition: database.models.LaunchDbSystemFromDatabaseDetails.DatabaseEdition.EnterpriseEditionDeveloper,
diskRedundancy: database.models.LaunchDbSystemFromDatabaseDetails.DiskRedundancy.High,
licenseModel: database.models.LaunchDbSystemFromDatabaseDetails.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: 893,
clusterName: "EXAMPLE-clusterName-Value",
dataStoragePercentage: 883,
initialDataStorageSizeInGB: 453,
kmsKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
kmsKeyVersionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value",
nodeCount: 23,
freeformTags: {
EXAMPLE_KEY_lMQsm :"EXAMPLE_VALUE_E2ppv6yY0C9032s95THF"
},
definedTags: {
EXAMPLE_KEY_1JSUS :{
EXAMPLE_KEY_iYfiw :"EXAMPLE--Value"
}
},
securityAttributes: {
EXAMPLE_KEY_kpgNq :{
EXAMPLE_KEY_GDJpt :"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: true,
}
,
computeModel: database.models.LaunchDbSystemBase.ComputeModel.Ocpu,
computeCount: 659
}
const launchDbSystemRequest: database.requests.LaunchDbSystemRequest = {
launchDbSystemDetails: launchDbSystemBase,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
opcDryRun: true,
};
// Send request to the Client.
const launchDbSystemResponse = await client.launchDbSystem(launchDbSystemRequest);
}
catch (error) {
console.log("launchDbSystem Failed with error " + error);
}
})();