/** 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 com.oracle.bmc.ConfigFileReader;
import com.oracle.bmc.auth.AuthenticationDetailsProvider;
import com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider;
import com.oracle.bmc.database.DatabaseClient;
import com.oracle.bmc.database.model.*;
import com.oracle.bmc.database.requests.*;
import com.oracle.bmc.database.responses.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Date;
import java.util.UUID;
import java.util.Arrays;
public class LaunchDbSystemExample {
public static void main(String[] args) throws Exception {
/**
* 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.
*/
final ConfigFileReader.ConfigFile configFile = ConfigFileReader.parseDefault();
final AuthenticationDetailsProvider provider = new ConfigFileAuthenticationDetailsProvider(configFile);
/* Create a service client */
DatabaseClient client = DatabaseClient.builder().build(provider);
/* Create a request and dependent object(s). */
LaunchDbSystemBase launchDbSystemBase = LaunchDbSystemFromBackupDetails.builder()
.dbHome(CreateDbHomeFromBackupDetails.builder()
.displayName("EXAMPLE-displayName-Value")
.databaseSoftwareImageId("ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value")
.database(CreateDatabaseFromBackupDetails.builder()
.backupId("ocid1.test.oc1..<unique_ID>EXAMPLE-backupId-Value")
.backupTDEPassword("EXAMPLE-backupTDEPassword-Value")
.adminPassword("EXAMPLE-adminPassword-Value")
.dbUniqueName("EXAMPLE-dbUniqueName-Value")
.dbName("EXAMPLE-dbName-Value")
.sidPrefix("EXAMPLE-sidPrefix-Value")
.pluggableDatabases(new ArrayList<>(Arrays.asList("EXAMPLE--Value"))).build())
.freeformTags(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_pbkVJ","EXAMPLE_VALUE_43SLKTicqh9UYmfwlJWw");
}
})
.definedTags(new HashMap<java.lang.String, java.util.Map<java.lang.String, java.lang.Object>>() {
{
put("EXAMPLE_KEY_xZQ7B",new HashMap<java.lang.String, java.lang.Object>() {
{
put("EXAMPLE_KEY_MwLE5","EXAMPLE--Value");
}
});
}
}).build())
.databaseEdition(LaunchDbSystemFromBackupDetails.DatabaseEdition.EnterpriseEditionHighPerformance)
.diskRedundancy(LaunchDbSystemFromBackupDetails.DiskRedundancy.High)
.licenseModel(LaunchDbSystemFromBackupDetails.LicenseModel.BringYourOwnLicense)
.compartmentId("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value")
.faultDomains(new ArrayList<>(Arrays.asList("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(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.backupNetworkNsgIds(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.shape("EXAMPLE-shape-Value")
.timeZone("EXAMPLE-timeZone-Value")
.dbSystemOptions(DbSystemOptions.builder()
.storageManagement(DbSystemOptions.StorageManagement.Asm).build())
.storageVolumePerformanceMode(LaunchDbSystemBase.StorageVolumePerformanceMode.HighPerformance)
.sparseDiskgroup(true)
.sshPublicKeys(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.hostname("EXAMPLE-hostname-Value")
.domain("EXAMPLE-domain-Value")
.cpuCoreCount(852)
.clusterName("EXAMPLE-clusterName-Value")
.dataStoragePercentage(26)
.initialDataStorageSizeInGB(333)
.kmsKeyId("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value")
.kmsKeyVersionId("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value")
.nodeCount(443)
.freeformTags(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_2yIzu","EXAMPLE_VALUE_oZkj4aqiCr7F9Fo2f5yp");
}
})
.definedTags(new HashMap<java.lang.String, java.util.Map<java.lang.String, java.lang.Object>>() {
{
put("EXAMPLE_KEY_oA2ne",new HashMap<java.lang.String, java.lang.Object>() {
{
put("EXAMPLE_KEY_dsR1G","EXAMPLE--Value");
}
});
}
})
.privateIp("EXAMPLE-privateIp-Value")
.dataCollectionOptions(DataCollectionOptions.builder()
.isDiagnosticsEventsEnabled(true)
.isHealthMonitoringEnabled(true)
.isIncidentLogsEnabled(true).build()).build();
LaunchDbSystemRequest launchDbSystemRequest = LaunchDbSystemRequest.builder()
.launchDbSystemDetails(launchDbSystemBase)
.opcRetryToken("EXAMPLE-opcRetryToken-Value").build();
/* Send request to the Client */
LaunchDbSystemResponse response = client.launchDbSystem(launchDbSystemRequest);
}
}