Metadata describes a database. Metadata is also called a data dictionary. Metadata includes the database name, database character set, table names, table sizes, the number of rows in each table, the character set of each table, table columns, table indexes, the description of each table, the type of each column, the precision of the columns, and the description of the columns. Data Management (DMS) collects metadata from databases such as the information_schema database. The collected metadata may not be accurate and is used only for reference.

Background information

Metadata is used to retrieve and display data in DMS. Metadata is the basis for automatic identification based on sensitive data rules. Metadata can also be used to implement fine-grained access control on databases, tables, columns, rows, and programmable objects. DMS supports different metadata collection scopes and methods based on the control mode of each database instance.

Collection scopes and methods

Collection scope and method Security Collaboration Stable Change and Flexible Management
Metadata collection scope DMS collects and stores all metadata of an instance. For more information, see The collected metadata list. DMS collects and stores all metadata of a database. Other metadata is loaded in real time after logon.
Whether to trigger full metadata collection when a database is added to DMS Yes, full metadata collection is triggered when a database is added to DMS. Yes, full metadata collection is triggered when a database is added to DMS.
Full metadata collection at specified points in time By default, DMS collects metadata of all instances of a tenant at six points in time each day.
Note DMS synchronizes the metadata every four hours at 02:00:00, 06:00:00, 10:00:00, 14:00:00, 18:00:00, and 22:00:00.
Full metadata collection at specified points in time is not supported.
On-demand incremental metadata collection
  • On the Cmd Tab or the Single Database query tab, click the refresh button to trigger incremental metadata collection.
  • In the left-side navigation pane in the DMS console, right-click a database and select Refresh / Syn dictionary to trigger incremental metadata collection.
  • If you are a database administrator or administrator, choose System Management > Instance in the top navigation bar to trigger incremental metadata collection. For more information, see Synchronize the data dictionary for an instance.
  • Execute Data Definition Language (DDL) statements on a table in DMS to trigger incremental metadata collection.
  • On the Cmd Tab or the Single Database query tab, click the refresh button to trigger incremental metadata collection.
  • In the left-side navigation pane in the DMS console, right-click a database and select Refresh / Syn dictionary to trigger incremental metadata collection.
  • If you are a database administrator or administrator, choose System Management > Instance in the top navigation bar to trigger incremental metadata collection. For more information, see Synchronize the data dictionary for an instance.
Others None. When you log on to a database, DMS collects information about the database based on the permissions of the account that you use to log on.

Use metadata

Metadata can be used to retrieve data and manage permissions. Metadata can be exported by calling API operations to provide support for operations, such as compliance audit.

You can export only metadata of instances in Security Collaboration mode by calling API operations.

The following table lists topics of API operations that are related to metadata.

API Description
GetDatabase Queries the details of a database.
ListColumns You can call this operation to query the column information of a specified table.
ListIndexes You can call this operation to return information about table indexes.
GetLogicDatabase Call the GetLogicDatabase operation to query the details about a logical database.
ListDatabases You can call this operation to query detailed information of databases in a specified instance.
ListLogicDatabases Call ListLogicDatabases returns logical database details List
ListLogicTables You can call this ListLogicTables to query detailed information of logical tables in a specified logical database.
SearchDatabase You can call this operation to query the information of a database.
SearchTable You can call this operation to search the table details list.
ListTables You can call this operation to query details about tables in a database.
SyncDatabaseMeta Call the SyncDatabaseMeta to synchronize dictionary metadata from databases.
SyncInstanceMeta Call the SyncInstanceMeta to synchronize the metadata of all database dictionaries under the specified instance.

Collected metadata

Object MySQL series ① PostgreSQL series ② Native SQL Server and ApsaraDB RDS for SQL Server Oracle Native MongoDB and ApsaraDB RDS for MongoDB Native Redis and ApsaraDB RDS for Redis
Database
  • Name
  • Character set
Name Name Name None Name
Table
  • Name
  • Description
  • Character set
  • Number of rows
  • Table size
  • Name
  • Description
  • Number of rows
  • Table size
  • Name
  • Description
  • Number of rows
  • Table size
  • Name
  • Description
  • Number of rows
  • Table size
None None
Column
  • Name
  • Type
  • Whether the value of the column can be null
  • Length
  • Precision
  • Description
  • Name
  • Type
  • Whether the value of the column can be null
  • Length
  • Precision
  • Description
  • Name
  • Type
  • Whether the value of the column can be null
  • Length
  • Precision
  • Description
  • Name
  • Type
  • Whether the value of the column can be null
  • Length
  • Precision
  • Description
None None
Index
  • Name
  • Type
  • Indexed column
  • Name
  • Type
  • Indexed column
  • Name
  • Type
  • Indexed column
  • Name
  • Type
  • Indexed column
  • Name
  • Indexed column
None
Programmable object
  • Name
  • Type
  • Name
  • Type
  • Name
  • Type
None None None
Pattern None Name None None None None
Collection None None None None Name None
Key None None None None None
  • Name
  • Type
Note

①: Native MySQL, PolarDB for MySQL, PolarDB-X, AnalyticDB for MySQL, Data Lake Analytics (DLA), ClickHouse, ApsaraDB OceanBase for MySQL, native MariaDB, and ApsaraDB RDS for MariaDB.

②: Native PostgreSQL, PolarDB-O, PolarDB for PostgreSQL, AnalyticDB for PostgreSQL, ApsaraDB OceanBase for Oracle, and ApsaraDB RDS for PPAS.