This topic describes how to query data archived to Object Storage Service (OSS) buckets or dedicated storage. This topic also provides answers to FAQ.
Prerequisites
Data is archived to OSS buckets or dedicated storage before you can query archived data as an old user or new user.
An old user refers to a user who used the data archiving feature before the archived data query feature was released on September 14, 2022.
A new user refers to a user who uses the data archiving feature after the archived data query feature is released.
Billing
You can query data archived to OSS buckets or dedicated storage free of charge during public preview.
Usage notes
Only the creator or stakeholders of a data archiving ticket can query archived data involved in the ticket.
You can use only logical data warehouses to query data archived to OSS buckets or logical data warehouses.
Query data archived to OSS buckets
- Log on to the DMS console V5.0.
In the top navigation bar, choose .
NoteIf you use the DMS console in simple mode, move the pointer over the icon in the upper-left corner and choose
.On the Archive DataTickets page, set the View parameter to Archive View.
Search for the data archiving ticket that you want to query. You can enter the ticket number, database name, or table name in the search box and click Search.
Find the data archiving ticket that you want to query and click Query in the Operation column.
ImportantIf an OSS bucket in which archived data is stored is queried for the first time, you must log on to the OSS bucket by using the AccessKey ID and AccessKey secret of the OSS bucket. For more information about how to obtain an AccessKey pair, see Create an AccessKey pair.
Optional. Enter the database account and password of the OSS bucket and click OK.
ImportantMake sure that the database account and password that you enter are consistent with the AccessKey ID and AccessKey secret of the OSS bucket. Otherwise, the archived data stored in the OSS bucket cannot be queried.
You are redirected to the Logical data warehouse page, and an SQL query statement is automatically filled in the command execution area.
NoteIf you are redirected to a blank page, you do not have permissions on the logical data warehouse. In this case, join the DingTalk group whose ID is 24005004020 to apply for permissions.
Click Execute. The query results are displayed on the Execution History tab that appears in the lower part of the SQLConsole page.
ImportantBy default, the system returns up to 20 queried data records. You can modify the limit to return more data records based on your business requirements.
Query data archived to dedicated storage
- Log on to the DMS console V5.0.
- In the top navigation bar, choose .
On the Archive DataTickets page, set the View parameter to Archive View.
Search for the data archiving ticket that you want to view. You can enter the ticket number, database name, or table name in the search box and click Search.
Find the data archiving ticket that you want to view and click Query in the Operation column.
You are redirected to the Logical data warehouse page, and the data query SQL statement is automatically filled in the statement execution area.
NoteIf you are redirected to a blank page, you do not have permissions on the logical data warehouse. In this case, join the DingTalk group whose ID is 24005004020 to apply for permissions.
Click Execute. The query results are displayed on the Execution History tab that appears in the lower part of the page.
NoteBy default, the system returns up to 20 queried data records. You can modify the limit to return more data records based on your business requirements.
FAQ
Q: Are tables in a logical database merged into one physical table when I query the archived data of the logical database?
A: Yes. When data in a logical database is archived, all tables in the logical database are merged into one physical database table. Therefore, on the Archive DataTickets page in Archive View mode, you can click a logical table to query all data of the tables in the logical database.
Q: Can I query archived data across two data archiving tickets?
A: Yes. Logical data warehouses in Data Management (DMS) allow you to query data archived to different OSS buckets or the same OSS bucket. To query archived data across data archiving tickets, go to the Logical data warehouse page, log on to the relevant OSS buckets, and then execute the LEFT JOIN, INNER JOIN, or RIGHT JOIN statements.
Q: If periodic archiving is configured for a data archiving ticket, am I able to query the data that is archived within a specific period of time?
A: Yes. If periodic archiving is configured for a data archiving ticket, data is archived within different periods of time based on the specified scheduling cycle. Therefore, you can query the data that is archived within the specified period of time based on the time when the data archiving task is created.