Data Management (DMS) provides the database grouping feature that allows you to apply a data change or schema design to multiple databases. You can use this feature to group multiple databases that are of the same engine type and deployed in the same environment together. This topic describes how to create a database group in DMS.
Background information
You may deploy your business in multiple regions and have multiple databases. In this case, every time you want to perform a change, you must apply the change to all the databases. This requires you to remember the endpoints of all the databases in the different regions. When you create a data change or schema design ticket, you must select all the databases so as to apply the data change or schema design to all the databases. However, you may accidentally omit one or more databases. This poses risks to the stability of your business. In addition, if you have a large number of databases, it is time-consuming and energy-draining to select all of the databases. This is also prone to errors.
To resolve this issue, DMS provides the database grouping feature. You can use this feature to group multiple databases that are of the same engine type and deployed in the same environment together. For example, you create a ticket to perform a data change or schema design on a database that belongs to a database group. After you select the database, DMS displays a message to ask whether you want to perform the operation on all of the databases in the group. If you click OK, DMS adds all the other databases in the group as the databases on which the data change or schema design will be performed.
Prerequisites
The databases that you want to add to a database group must meet the following conditions:
All of the instances to which the databases belong are managed in Security Collaboration mode.
All of the databases are physical databases or logical databases.
All of the databases are deployed in the same environment, such as the development environment.
The engines of the databases are of the same type. For example, all of the databases are MySQL databases.
Common scenarios
Data change
For example, you create a ticket to perform a data change on a database that belongs to a database group. After you select the database, DMS displays a message to ask whether you want to perform the operation on all of the databases in the group. If you click OK, DMS adds all the other databases in the group as the databases on which the data change will be performed. This frees you from selecting databases one by one. If you click Cancel, the other databases in the group will not be selected.
The database grouping feature supports the following types of data change tickets: Normal Data Modify, Lockless change, History Data Clean, Large Data Import, and Programmable Object.
Schema design
For example, you create a schema design ticket and select a database that belongs to a database group as a base database. After you click Perform Changes to Base Database, DMS displays a message to remind you that the base database belongs to a database group and that the current operation will apply to all the other databases in the group.
Create a database group
- Log on to the DMS console V5.0.
In the top navigation bar, click .
NoteIf you use the DMS console in simple mode, move the pointer over the icon in the upper-left corner of the DMS console and choose All functions > O&M > Database Grouping.
On the Database Grouping page, click New Group.
In the NewGrouping dialog box, configure the following items.
Item
Description
Group name
The name of the database group that you want to create.
Add database
Click Add database. In the Search database dialog box, enter a database name in the search box. Find the databases that you want to group from the matched results and click Add in the Operation column.
Click Save.
What to do next
After you create a database group, you may need to perform the following operations:
Perform a schema design and apply the change to multiple databases in the database group. For more information, see Design schemas.
Perform a data change and apply the change to all of the databases in the database group. For more information, see Perform regular data change, Perform lock-free DML operations, Clear historical data, Import data, and Change programmable objects by using stored routines.