// 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  createDbHomeBase = {
		source: "NONE",		dbSystemId: "ocid1.test.oc1..<unique_ID>EXAMPLE-dbSystemId-Value",
		dbVersion: "EXAMPLE-dbVersion-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: true,
				recoveryWindowInDays: 28,
				autoBackupWindow: database.models.DbBackupConfig.AutoBackupWindow.SlotFour,
				autoFullBackupWindow: database.models.DbBackupConfig.AutoFullBackupWindow.SlotSeven,
				autoFullBackupDay: database.models.DbBackupConfig.AutoFullBackupDay.Tuesday,
				runImmediateFullBackup: true,
				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",
						isRemote: false,
						remoteRegion: "EXAMPLE-remoteRegion-Value",

						}
						],
				backupDeletionPolicy: database.models.DbBackupConfig.BackupDeletionPolicy.DeleteAfterRetentionPeriod,

				}
,
			freeformTags: {
				EXAMPLE_KEY_tJRMW :"EXAMPLE_VALUE_FJolTI375WwYsT8jz1r2"
				},
			definedTags: {
				EXAMPLE_KEY_4S2U5 :{
					EXAMPLE_KEY_ayBcR :"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: "EXTERNAL",				hsmPassword: "EXAMPLE-hsmPassword-Value"

				}
,

			}
,
		displayName: "EXAMPLE-displayName-Value",
		kmsKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
		kmsKeyVersionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value",
		databaseSoftwareImageId: "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value",
		freeformTags: {
			EXAMPLE_KEY_s57sV :"EXAMPLE_VALUE_dIu2CtCWzMv9cBozEgUa"
			},
		definedTags: {
			EXAMPLE_KEY_9IZqU :{
				EXAMPLE_KEY_vQ7B0 :"EXAMPLE--Value"
				}
			},
		isDesupportedVersion: false,
		isUnifiedAuditingEnabled: false

		}

	const createDbHomeRequest: database.requests.CreateDbHomeRequest = { 
	createDbHomeWithDbSystemIdDetails: createDbHomeBase,
	opcRetryToken: "EXAMPLE-opcRetryToken-Value",

		}; 


     // Send request to the Client.
     const createDbHomeResponse = await client.createDbHome(createDbHomeRequest);
     }
     catch (error) {
         console.log("createDbHome Failed with error  " + error);
     }
})();