// 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: "NONE", dbHome: {
displayName: "EXAMPLE-displayName-Value",
dbVersion: "EXAMPLE-dbVersion-Value",
databaseSoftwareImageId: "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value",
database: {
dbName: "EXAMPLE-dbName-Value",
dbUniqueName: "EXAMPLE-dbUniqueName-Value",
databaseSoftwareImageId: "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value",
pdbName: "EXAMPLE-pdbName-Value",
adminPassword: "EXAMPLE-adminPassword-Value",
tdeWalletPassword: "EXAMPLE-tdeWalletPassword-Value",
characterSet: "EXAMPLE-characterSet-Value",
ncharacterSet: "EXAMPLE-ncharacterSet-Value",
dbWorkload: database.models.CreateDatabaseDetails.DbWorkload.Dss,
dbBackupConfig: {
autoBackupEnabled: false,
recoveryWindowInDays: 49,
autoBackupWindow: database.models.DbBackupConfig.AutoBackupWindow.SlotTwelve,
autoFullBackupWindow: database.models.DbBackupConfig.AutoFullBackupWindow.SlotEleven,
autoFullBackupDay: database.models.DbBackupConfig.AutoFullBackupDay.Wednesday,
runImmediateFullBackup: false,
backupDestinationDetails: [{
type: database.models.BackupDestinationDetails.Type.Local,
id: "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
vpcUser: "EXAMPLE-vpcUser-Value",
vpcPassword: "EXAMPLE-vpcPassword-Value",
internetProxy: "EXAMPLE-internetProxy-Value",
dbrsPolicyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-dbrsPolicyId-Value",
isRetentionLockEnabled: true,
backupRetentionPolicyOnTerminate: database.models.BackupDestinationDetails.BackupRetentionPolicyOnTerminate.RetainFor72Hours,
isRemote: false,
remoteRegion: "EXAMPLE-remoteRegion-Value",
}
],
backupDeletionPolicy: database.models.DbBackupConfig.BackupDeletionPolicy.DeleteAfterRetentionPeriod,
}
,
freeformTags: {
EXAMPLE_KEY_ltsS5 :"EXAMPLE_VALUE_2vMGKRZU6N2bgqqlH5sR"
},
definedTags: {
EXAMPLE_KEY_kjuK7 :{
EXAMPLE_KEY_iV4Uc :"EXAMPLE--Value"
}
},
kmsKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
kmsKeyVersionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value",
vaultId: "ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value",
sidPrefix: "EXAMPLE-sidPrefix-Value",
keyStoreId: "ocid1.test.oc1..<unique_ID>EXAMPLE-keyStoreId-Value",
encryptionKeyLocationDetails: {
providerType: "GCP", googleCloudProviderEncryptionKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-googleCloudProviderEncryptionKeyId-Value"
}
,
storageSizeDetails: {
dataStorageSizeInGBs: 968,
recoStorageSizeInGBs: 251,
}
,
}
,
freeformTags: {
EXAMPLE_KEY_B5cBV :"EXAMPLE_VALUE_AhTgHE0DHTkb8wL8zB8o"
},
definedTags: {
EXAMPLE_KEY_IP8cg :{
EXAMPLE_KEY_ZMmgc :"EXAMPLE--Value"
}
},
isUnifiedAuditingEnabled: true,
}
,
databaseEdition: database.models.LaunchDbSystemDetails.DatabaseEdition.EnterpriseEditionDeveloper,
diskRedundancy: database.models.LaunchDbSystemDetails.DiskRedundancy.Normal,
licenseModel: database.models.LaunchDbSystemDetails.LicenseModel.BringYourOwnLicense,
maintenanceWindowDetails: {
preference: database.models.MaintenanceWindow.Preference.CustomPreference,
patchingMode: database.models.MaintenanceWindow.PatchingMode.Nonrolling,
isCustomActionTimeoutEnabled: true,
customActionTimeoutInMins: 16,
isMonthlyPatchingEnabled: true,
months: [{
name: database.models.Month.Name.October,
}
],
weeksOfMonth: [1 ],
daysOfWeek: [{
name: database.models.DayOfWeek.Name.Tuesday,
}
],
hoursOfDay: [6 ],
leadTimeInWeeks: 1,
skipRu: [true,false ],
}
,
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: true,
sshPublicKeys: ["EXAMPLE--Value" ],
hostname: "EXAMPLE-hostname-Value",
domain: "EXAMPLE-domain-Value",
cpuCoreCount: 258,
clusterName: "EXAMPLE-clusterName-Value",
dataStoragePercentage: 557,
initialDataStorageSizeInGB: 334,
kmsKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
kmsKeyVersionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value",
nodeCount: 752,
freeformTags: {
EXAMPLE_KEY_h8V70 :"EXAMPLE_VALUE_VN1ST9HS5GvGoONQitwk"
},
definedTags: {
EXAMPLE_KEY_Ze1X9 :{
EXAMPLE_KEY_gW2qk :"EXAMPLE--Value"
}
},
securityAttributes: {
EXAMPLE_KEY_orSYr :{
EXAMPLE_KEY_aHw3o :"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: true,
isHealthMonitoringEnabled: true,
isIncidentLogsEnabled: false,
}
,
computeModel: database.models.LaunchDbSystemBase.ComputeModel.Ecpu,
computeCount: 542
}
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);
}
})();