All Products
Search
Document Center

Data Management:Manage schema versions

Last Updated:Mar 25, 2025

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.

Background information

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:

Note
  • If the schema of a table in a database is changed in an environment other than DMS, you can synchronize the metadata of the database in DMS to obtain and save the latest schema. For more information, see Synchronize the data dictionary of a database instance.

  • If the database instance in which the database resides is managed in Security Collaboration mode, you can also click the 同步元数据按钮 icon on the SQLConsole tab to synchronize the metadata of the database.

Prerequisites

  • You have query permissions on the table or database that you want to manage.

  • Your database is of one of the following types:

    • MySQL: ApsaraDB RDS for MySQL, PolarDB for MySQL, PolarDB-X, AnalyticDB for MySQL, and OceanBase databases in MySQL mode

    • PostgreSQL: ApsaraDB RDS for PostgreSQL, PolarDB for PostgreSQL, and AnalyticDB for PostgreSQL

    • PolarDB for PostgreSQL (Compatible with Oracle)

    • SQL Server

    • MariaDB

    • Oracle

Limits

  • 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: unlimited

  • 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

Procedure

  1. Log on to the DMS console V5.0.
  2. Go to the Database version list page by using one of the following methods:

    Method 1: Access from the Database Instances section on the homepage

    In the left-side navigation pane of the DMS console, click Database Instances, find the database that you want to manage, right-click the database, and then select Version Management.

    image

    Method 2: Access from the SQLConsole tab

    On the SQLConsole tab of the database that you want to manage, click the image.png icon in the upper-right corner.

    image

    Method 3: Access from the Instances page

    This method is applicable only to DMS administrators or database administrators (DBAs).

    1. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the DMS console and choose All Features > Data Assets > Instances.

      Note

      If you use the DMS console in normal mode, choose Data Assets > Instances in the top navigation bar.

    2. In the Database List tab, find the database that you want to manage.

    3. Choose More > Version Management in the Actions column.image

  3. On the Database version list page, find the version number of the schema that you want to manage. The following section describes the operations that you can perform:

    • Click Change Details to view the SQL script that is used to generate the schema version.

    • Click Rollback to roll back data to the previous schema version.

    • Select two schema versions and click Version Comparison.