Metadata model in DMS Schema Conversion
When you work with DMS Schema Conversion, the service represents your database schemas as a hierarchical tree. This tree is called the metadata tree, and it applies to both source and target schemas. Each element in the tree, including the root element ("Servers"), is a metadata model.
The metadata tree contains two kinds of elements:
-
Objects — Represent actual database objects such as tables, functions, views, sequences, and indexes. You can retrieve the SQL definition of an object using the DescribeMetadataModel request.
-
Categories — Virtual grouping containers such as "Schemas", "Tables", "Functions", and "Indexes". Categories organize objects in the tree for navigation but do not have SQL definitions themselves.
The metadata tree loads data only when you request it. This approach is called on-demand loading (also known as lazy loading), which means DMS Schema Conversion retrieves data from your database only as needed. You use the import operation to load metadata — either by refreshing a specific metadata model or importing an entire subtree at once. Operations such as assessment and conversion also load the metadata tree automatically.
How the metadata model works
The metadata model in DMS Schema Conversion follows a lifecycle of operations. Operations that modify the metadata tree (such as import and convert) are asynchronous. You start a request for these operations, and it runs in the background. Call the corresponding describe API to check the request status. Operations that read the tree (such as describing children or definitions) are synchronous.
Note
In DMS Schema Conversion, the terms operation and request are used interchangeably.
The typical workflow includes the following steps:
-
Import — Load metadata from your source or target database into the metadata tree. You can either load the initial metadata model or reload an existing model from the database. For more information, see Navigate the tree. For the API reference, see StartMetadataModelImport.
-
Assess — Analyze the selected source metadata models to identify conversion complexity and potential issues. For more information, see Creating database migration assessment reports with DMS Schema Conversion.
-
Convert — Convert the selected source metadata models to a target-compatible format. The converted definitions are stored as part of the target metadata tree. For more information, see Converting database schemas in DMS Schema Conversion: step-by-step guide.
-
Export — Save metadata definitions. You can export both source and target metadata as SQL scripts to your Amazon S3 bucket. For non-virtual targets, you can also apply converted objects directly to your target database. For more information about virtual targets, see Virtual data provider. For more information about applying converted objects, see Applying your converted code.
After you assess or convert source metadata models, you can generate an assessment report to review the results. For more information, see Creating database migration assessment reports with DMS Schema Conversion.
For supported migration pairs, you can also create custom statement metadata models from SQL definitions using StartMetadataModelCreation. For more information, see Create statement models.
Navigate the metadata model tree
You can navigate the metadata tree using the following API requests:
-
DescribeMetadataModelChildren — Returns the children of a given metadata model. Each child includes selection rules (filters that identify specific metadata models) that you can pass to the next call to drill deeper.
-
DescribeMetadataModel — Returns the name, type, and SQL definition of a specific metadata model.
Both requests require the Origin parameter (SOURCE or
TARGET) and use selection rules to identify the metadata model.
The navigation pattern is the same for both source and target trees. For more information
about the selection rules format, see Selection rules in DMS Schema Conversion.
Choose your preferred interface to view navigation instructions.
Create statement metadata models
Note
Statement creation currently supports only the following directions: from SQL Server to Aurora PostgreSQL, or from SQL Server to Amazon RDS for PostgreSQL.
You can create statement metadata models from SQL definitions using StartMetadataModelCreation. This is useful when you want to convert SQL statements that do not exist as objects in your source database — for example, application queries or ad-hoc SQL code.