After you change the schema of a table in a database in Data Management (DMS), DMS adds the latest schema to the schema version list of the database. You can download and compare schema versions and restore an earlier schema version in the schema version list.
Prerequisites
You have permissions to query the data of the table or the database to which the table belongs. For more information, see View owned permissions.
Overview
Schema versions are defined based on a database and store the schema information of all the tables in the database. If the schema of a table in the database is changed, a new schema version is saved. New schema versions are saved when the following operations are performed in DMS:
- SQL statements are executed on the SQL Console tab to change schemas.
- SQL statements are executed to change schemas when you submit tickets for normal data modify, lock-free data change, schema design, or schema synchronization.
- SQL statements are executed to change schemas by a DMS administrator.
- If the instance in which the database resides is managed in Security Collaboration
mode, click the
icon in the upper-right corner of the SQL Console page to synchronize the latest schema.
- If the instance in which the database resides is managed in Flexible Management or
Stable Change mode, click the
icon in the upper-left corner of the SQL Console page to synchronize the latest schema.
Usage notes
- The following database engines are supported:
- MySQL series: native MySQL, Apsara RDS for MySQL, PolarDB for MySQL, PolarDB-X, AnalyticDB for MySQL, and ApsaraDB OceanBase for MySQL
- PostgreSQL series: native PostgreSQL, PolarDB for PostgreSQL, and AnalyticDB for PostgreSQL
- PolarDB for Oracle
- SQL Server series
- MariaDB series
- The following content shows the maximum number of schema versions that can be retained
for each database in database instances that are managed in different control modes:
- Flexible Management: 3
- Stable Change: 20
- Security Collaboration: 50
- You cannot manage schema versions for the following databases:
- Databases that contain more than 1,024 tables
- System databases such as the information_schema and sys databases in a MySQL database instance