start_metadata_model_export_as_script
¶
start_metadata_model_export_as_script(
migration_project_identifier: MigrationProjectIdentifier,
selection_rules: String,
origin: OriginTypeValue,
*,
config_overrides: Optional[DatabaseMigrationServiceClientConfig] = None,
file_name: Optional[String] = None,
) -> StartMetadataModelExportAsScriptResponse
Queues an export of metadata models (database objects such as tables, views, and procedures) as a data definition language (DDL) script. The script is stored as a ZIP archive in the Amazon S3 bucket associated with the migration project. If other requests created by Start* operations are already in the migration project's queue, the export begins after they complete.
When exporting from the target metadata tree, the export applies only to metadata models created by conversion. Metadata models imported from the database are skipped.
To check the status of the export request, call DescribeMetadataModelExportsAsScript using the returned RequestIdentifier as a filter.
Required permissions: dms:StartMetadataModelExportAsScripts. For more information, see Actions, resources, and condition keys for Database Migration Service.
Parameters:
-
migration_project_identifier(MigrationProjectIdentifier) –The migration project name or Amazon Resource Name (ARN).
-
selection_rules(String) –A JSON string that identifies the metadata models to export as a SQL script. For the selection rule format and examples, see Selection rules in DMS Schema Conversion.
Usage:
-
Accepts source or target selection rules depending on the
Originparameter. Theserver-namein the object locator must match the corresponding data provider. -
Supports
explicit,include, andexcluderule actions.
-
-
origin(OriginTypeValue) –Specifies the metadata tree to export from.
-
file_name(Optional[String], default:None) –The name for the exported file. When you omit this parameter, the service generates a name from the data provider engine name and an export timestamp.
Raises:
-
AccessDeniedFault–DMS was denied access to the endpoint. Check that the role is correctly configured.
-
InvalidResourceStateFault–The resource is in a state that prevents it from being used for database migration.
-
KMSKeyNotAccessibleFault–DMS cannot access the KMS key.
-
ResourceAlreadyExistsFault–The resource you are attempting to create already exists.
-
ResourceNotFoundFault–The resource could not be found.
-
ResourceQuotaExceededFault–The quota for this resource quota has been exceeded.
-
S3AccessDeniedFault–Insufficient privileges are preventing access to an Amazon S3 object.
-
S3ResourceNotFoundFault–A specified Amazon S3 bucket, bucket folder, or other object can't be found.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Export converted metadata models as DDL scripts The following example queues an export of converted metadata models for all objects in the ExampleSchema schema as data definition language (DDL) scripts to the S3 bucket associated with the migration project.
>>> client.start_metadata_model_export_as_script(migration_project_identifier='arn:aws:dms:us-east-1:111122223333:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS', selection_rules='{"rules": [{"rule-type": "selection","rule-id": "1","rule-name": "1","object-locator": {"server-name": "example-target-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"},"rule-action": "explicit"}]}', origin='TARGET', file_name='ExampleScript')
Source code in docs_src/capo_database_migration_service/_services/database_migration_service.py
9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 | |