As your business grows, the amount of data in your online databases increases. As a result, table queries slow down, and your business operations are affected. To resolve this problem, Data Management (DMS) provides the data archiving feature. You can use this feature to archive the data of large tables to Object Storage Service (OSS) buckets or ApsaraDB for Lindorm instances. You can also use this feature to delete archived data from large tables and recycle the storage space that is occupied by large tables. This way, you can improve query performance and reduce the costs of online storage. This topic describes how to archive the data of large tables to OSS buckets that are connected to Database Backup (DBS).
- A MySQL database, such as an ApsaraDB RDS for MySQL database or a PolarDB for MySQL database, is used.
- DBS is activated. For more information, see How do I activate DBS?.
- Data Lake Analytics (DLA) is activated. For information about how to activate DLA, see Activate DLA.
- You are a DMS administrator, database administrator (DBA), or regular user.
Note A regular user must have the export permissions on the database. For more information about how to apply for the permissions, see Manage permissions.
- Log on to the DMS console V5.0.
- On the New Data Archive Work Order page, set the parameters described in the following table.
Parameter Description Task Name The name of the data archiving task. We recommend that you specify an informative name that helps you reduce unnecessary communication. Archiving Destination The destination to which data is archived. Select OSS Buckets Connected to DBS. Database The database to be archived. You can search and select a database from the drop-down list. Archive configuration
- The configurations for data archiving, including the one or more tables to be archived and the filter conditions.
- Optional: Enter a WHERE clause without the WHERE keyword in the Filter Condition field.
Note If you want to use time variables in scenarios such as archiving data generated six months ago, you can configure the variables in the Variable configuration section before you configure the parameters in the Archive configuration section.
Variable configuration Optional. The variable that you want to use for data archiving. You can configure one or more variables. For more information about how to set time variables, see Configure time variables. Operation mode The method to be used for running the task. Valid values:
- Single execution: After the data archiving ticket is approved, DMS executes the data archiving task only once.
- Cyclic scheduling: After the data archiving ticket is approved, DMS executes the data archiving task based on the cycle that you specify. For more information, see Cyclic scheduling.
- Click Submit. After the data archiving ticket is approved, DMS automatically executes the data archiving task.Note The data archiving feature implements data archiving and post-behavior based on the UTC+0 time zone regardless of the time zone of the database to be archived.
- Optional: View archived data.
- Create a data lake in DBS for backup sets. For more information, see Create a data lake.
- Register a DLA instance with DMS. After the registration, you can query data on the
SQL Console tab and perform data analysis and development by using the task orchestration
Note For more information, see Register an ApsaraDB instance.
- Optional: After the data of the source tables is archived, you can delete the archived data from the source tables and optimize the storage usage of the source tables.
|Scheduling Cycle||Select the cycle based on which DMS executes the data archiving task.
|Timed Scheduling||Specify one of the following scheduling methods:
|Specific Point in Time||Specify the point in time at which DMS executes the data archiving task.
For example, if you select 02:55, DMS executes the data archiving task at 02:55 on the days that you select.
|Cron Expression||You do not need to configure this parameter. DMS automatically generates a cron expression based on the values that you specify for the preceding parameters.|