# 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 oci

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
database_migration_client = oci.database_migration.DatabaseMigrationClient(
    config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_migration_response = database_migration_client.create_migration(
    create_migration_details=oci.database_migration.models.CreateOracleMigrationDetails(
        database_combination="ORACLE",
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        type="OFFLINE",
        source_database_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDatabaseConnectionId-Value",
        target_database_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-targetDatabaseConnectionId-Value",
        description="EXAMPLE-description-Value",
        display_name="EXAMPLE-displayName-Value",
        freeform_tags={
            'EXAMPLE_KEY_WBcRd': 'EXAMPLE_VALUE_CzVW2TreHjxLxdc4DygX'},
        defined_tags={
            'EXAMPLE_KEY_foCbf': {
                'EXAMPLE_KEY_3KGUR': 'EXAMPLE--Value'}},
        data_transfer_medium_details=oci.database_migration.models.CreateOracleNfsDataTransferMediumDetails(
            type="NFS",
            object_storage_bucket=oci.database_migration.models.CreateObjectStoreBucket(
                namespace_name="EXAMPLE-namespaceName-Value",
                bucket_name="EXAMPLE-bucketName-Value"),
            source=oci.database_migration.models.OciCliDumpTransferDetails(
                kind="OCI_CLI",
                wallet_location="EXAMPLE-walletLocation-Value",
                oci_home="EXAMPLE-ociHome-Value"),
            target=oci.database_migration.models.OciCliDumpTransferDetails(
                kind="OCI_CLI",
                wallet_location="EXAMPLE-walletLocation-Value",
                oci_home="EXAMPLE-ociHome-Value"),
            shared_storage_mount_target_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sharedStorageMountTargetId-Value"),
        initial_load_settings=oci.database_migration.models.CreateOracleInitialLoadSettings(
            job_mode="FULL",
            data_pump_parameters=oci.database_migration.models.CreateDataPumpParameters(
                is_cluster=False,
                estimate="STATISTICS",
                table_exists_action="SKIP",
                exclude_parameters=[
                    "INDEX",
                    "MATERIALIZED_VIEW",
                    "MATERIALIZED_VIEW_LOG"],
                import_parallelism_degree=93,
                export_parallelism_degree=33),
            tablespace_details=oci.database_migration.models.CreateADBServerlesTablespaceDetails(
                target_type="ADB_S_REMAP"),
            export_directory_object=oci.database_migration.models.CreateDirectoryObject(
                name="EXAMPLE-name-Value",
                path="EXAMPLE-path-Value"),
            import_directory_object=oci.database_migration.models.CreateDirectoryObject(
                name="EXAMPLE-name-Value",
                path="EXAMPLE-path-Value"),
            metadata_remaps=[
                oci.database_migration.models.MetadataRemap(
                    type="DATAFILE",
                    old_value="EXAMPLE-oldValue-Value",
                    new_value="EXAMPLE-newValue-Value")]),
        advisor_settings=oci.database_migration.models.CreateOracleAdvisorSettings(
            is_skip_advisor=True,
            is_ignore_errors=False),
        hub_details=oci.database_migration.models.CreateGoldenGateHubDetails(
            rest_admin_credentials=oci.database_migration.models.CreateAdminCredentials(
                username="EXAMPLE-username-Value",
                password="EXAMPLE-password-Value"),
            url="EXAMPLE-url-Value",
            vault_id="ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value",
            key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-keyId-Value",
            compute_id="ocid1.test.oc1..<unique_ID>EXAMPLE-computeId-Value",
            extract=oci.database_migration.models.CreateExtract(
                performance_profile="HIGH",
                long_trans_duration=390),
            replicat=oci.database_migration.models.CreateReplicat(
                performance_profile="LOW"),
            acceptable_lag=24),
        ggs_details=oci.database_migration.models.CreateOracleGgsDeploymentDetails(
            extract=oci.database_migration.models.CreateExtract(
                performance_profile="HIGH",
                long_trans_duration=753),
            replicat=oci.database_migration.models.CreateReplicat(
                performance_profile="LOW"),
            acceptable_lag=10),
        advanced_parameters=[
            oci.database_migration.models.MigrationParameterDetails(
                value="EXAMPLE-value-Value",
                name="EXAMPLE-name-Value",
                data_type="INTEGER")],
        source_container_database_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sourceContainerDatabaseConnectionId-Value",
        source_standby_database_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sourceStandbyDatabaseConnectionId-Value",
        exclude_objects=[
            oci.database_migration.models.OracleDatabaseObject(
                owner="EXAMPLE-owner-Value",
                object_name="EXAMPLE-objectName-Value",
                type="EXAMPLE-type-Value",
                is_omit_excluded_table_from_replication=False)],
        include_objects=[
            oci.database_migration.models.OracleDatabaseObject(
                owner="EXAMPLE-owner-Value",
                object_name="EXAMPLE-objectName-Value",
                type="EXAMPLE-type-Value",
                is_omit_excluded_table_from_replication=False)],
        bulk_include_exclude_data="EXAMPLE-bulkIncludeExcludeData-Value"),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="FX5FMCPB7PODHEADCUTJ<unique_ID>")

# Get the data from response
print(create_migration_response.data)

Was this article helpful?