// 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 databasemigration from "oci-databasemigration";
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 databasemigration.DatabaseMigrationClient({
authenticationDetailsProvider: provider
});
// Create a request and dependent object(s).
const updateMigrationDetails = {
type: databasemigration.models.MigrationTypes.Online,
displayName: "EXAMPLE-displayName-Value",
agentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-agentId-Value",
sourceDatabaseConnectionId:
"ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDatabaseConnectionId-Value",
sourceContainerDatabaseConnectionId:
"ocid1.test.oc1..<unique_ID>EXAMPLE-sourceContainerDatabaseConnectionId-Value",
targetDatabaseConnectionId:
"ocid1.test.oc1..<unique_ID>EXAMPLE-targetDatabaseConnectionId-Value",
dataTransferMediumDetailsV2: {
type: "DBLINK",
objectStorageBucket: {
namespaceName: "EXAMPLE-namespaceName-Value",
bucketName: "EXAMPLE-bucketName-Value"
},
name: "EXAMPLE-name-Value"
},
dataTransferMediumDetails: {
databaseLinkDetails: {
name: "EXAMPLE-name-Value",
walletBucket: {
namespaceName: "EXAMPLE-namespaceName-Value",
bucketName: "EXAMPLE-bucketName-Value"
}
},
objectStorageDetails: {
namespaceName: "EXAMPLE-namespaceName-Value",
bucketName: "EXAMPLE-bucketName-Value"
},
awsS3Details: {
name: "EXAMPLE-name-Value",
region: "EXAMPLE-region-Value",
accessKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-accessKeyId-Value",
secretAccessKey: "EXAMPLE-secretAccessKey-Value"
}
},
dumpTransferDetails: {
source: {
kind: "CURL",
walletLocation: "EXAMPLE-walletLocation-Value"
},
target: {
kind: "OCI_CLI",
ociHome: "EXAMPLE-ociHome-Value",
walletLocation: "EXAMPLE-walletLocation-Value"
},
sharedStorageMountTargetId:
"ocid1.test.oc1..<unique_ID>EXAMPLE-sharedStorageMountTargetId-Value"
},
datapumpSettings: {
jobMode: databasemigration.models.DataPumpJobMode.Schema,
dataPumpParameters: {
isCluster: false,
estimate: databasemigration.models.DataPumpEstimate.Statistics,
tableExistsAction: databasemigration.models.DataPumpTableExistsAction.Replace,
excludeParameters: [
databasemigration.models.DataPumpExcludeParameters.Index,
databasemigration.models.DataPumpExcludeParameters.MaterializedView,
databasemigration.models.DataPumpExcludeParameters.MaterializedViewLog
],
importParallelismDegree: 816,
exportParallelismDegree: 9
},
metadataRemaps: [
{
type: databasemigration.models.MetadataRemap.Type.Tablespace,
oldValue: "EXAMPLE-oldValue-Value",
newValue: "EXAMPLE-newValue-Value"
}
],
tablespaceDetails: {
targetType: "ADB_S_REMAP"
},
exportDirectoryObject: {
name: "EXAMPLE-name-Value",
path: "EXAMPLE-path-Value"
},
importDirectoryObject: {
name: "EXAMPLE-name-Value",
path: "EXAMPLE-path-Value"
}
},
advisorSettings: {
isSkipAdvisor: false,
isIgnoreErrors: true
},
excludeObjects: [
{
owner: "EXAMPLE-owner-Value",
objectName: "EXAMPLE-objectName-Value",
type: "EXAMPLE-type-Value",
isOmitExcludedTableFromReplication: false
}
],
includeObjects: [
{
owner: "EXAMPLE-owner-Value",
objectName: "EXAMPLE-objectName-Value",
type: "EXAMPLE-type-Value",
isOmitExcludedTableFromReplication: false
}
],
goldenGateServiceDetails: {
sourceDbCredentials: {
username: "EXAMPLE-username-Value",
password: "EXAMPLE-password-Value"
},
sourceContainerDbCredentials: {
username: "EXAMPLE-username-Value",
password: "EXAMPLE-password-Value"
},
targetDbCredentials: {
username: "EXAMPLE-username-Value",
password: "EXAMPLE-password-Value"
},
settings: {
extract: {
performanceProfile: databasemigration.models.ExtractPerformanceProfile.High,
longTransDuration: 150
},
replicat: {
performanceProfile: databasemigration.models.ReplicatPerformanceProfile.Low,
mapParallelism: 35,
minApplyParallelism: 320,
maxApplyParallelism: 979
},
acceptableLag: 5
}
},
goldenGateDetails: {
hub: {
restAdminCredentials: {
username: "EXAMPLE-username-Value",
password: "EXAMPLE-password-Value"
},
sourceDbAdminCredentials: {
username: "EXAMPLE-username-Value",
password: "EXAMPLE-password-Value"
},
sourceContainerDbAdminCredentials: {
username: "EXAMPLE-username-Value",
password: "EXAMPLE-password-Value"
},
targetDbAdminCredentials: {
username: "EXAMPLE-username-Value",
password: "EXAMPLE-password-Value"
},
url: "EXAMPLE-url-Value",
sourceMicroservicesDeploymentName: "EXAMPLE-sourceMicroservicesDeploymentName-Value",
targetMicroservicesDeploymentName: "EXAMPLE-targetMicroservicesDeploymentName-Value",
computeId: "ocid1.test.oc1..<unique_ID>EXAMPLE-computeId-Value"
},
settings: {
extract: {
performanceProfile: databasemigration.models.ExtractPerformanceProfile.Low,
longTransDuration: 477
},
replicat: {
performanceProfile: databasemigration.models.ReplicatPerformanceProfile.Low,
mapParallelism: 43,
minApplyParallelism: 232,
maxApplyParallelism: 156
},
acceptableLag: 13
}
},
vaultDetails: {
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
vaultId: "ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value",
keyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-keyId-Value"
},
freeformTags: {
EXAMPLE_KEY_oOtcD: "EXAMPLE_VALUE_nhIbkynMF8ZQH9hU2UW9"
},
definedTags: {
EXAMPLE_KEY_MvE83: {
EXAMPLE_KEY_tF0Jk: "EXAMPLE--Value"
}
}
};
const updateMigrationRequest: databasemigration.requests.UpdateMigrationRequest = {
migrationId: "ocid1.test.oc1..<unique_ID>EXAMPLE-migrationId-Value",
updateMigrationDetails: updateMigrationDetails,
opcRequestId: "67HNZHWVXSQZHNATMMZ1<unique_ID>",
ifMatch: "EXAMPLE-ifMatch-Value"
};
// Send request to the Client.
const updateMigrationResponse = await client.updateMigration(updateMigrationRequest);
} catch (error) {
console.log("updateMigration Failed with error " + error);
}
})();