Query backup data
NineData lets you query logical backup data by backup set or by point in time. When data is lost in a production database, use backup data query to inspect the backup data first, and then export or restore the required data.
Before you begin
A complete logical backup must be available. For details, see Perform logical backup.
Restrictions
- Views are not supported.
- Backup data query supports logical backup data only.
Procedure
Sign in to the NineData Console.
In the navigation pane, click Backup > Backup Query.
On the Backup Query tab, configure the parameters in the table, and click Query.
Parameters Description Select a data source Select the data source that contains the backup data. This helps you quickly locate the target Backup Set. Query Mode - Full Backup Set: Query data from a full backup set. This returns the data as of the time when the full backup completed, and does not include later incremental data.
- By Time: Query data based on full backup data and data logs. This mode can query full data and subsequent incremental data. For the available recovery time range, see the console.
Backup Set Configure this parameter when Query Mode is Full Backup Set. Select the full backup set to query. Query by Time Configure this parameter when Query Mode is By Time. Select the point in time for the query. - Logical backup: When second-level RPO is available, query data at any point in time from the backup start time to the current time.
- Physical backup: With minute-level RPO, query data from a few minutes to 30 minutes before the backup start time through the current time.
NineData opens the SQL console. Run SQL statements to query the backup data. To switch the query method, click Backup Set or Point in Time.
tip
- For SQL console usage, see SQL Console.
- After you find the required data, click Export in the result set to export the data and restore it to the target database.
:::
Result
Query data from the selected backup set or point in time. If the query finds the data you need, export the result set and use it for recovery.
Appendix: Supported query syntax
NineData supports the following query syntax for backup data query.
- MySQL
- SQL Server
| Statement | Options |
|---|---|
| SELECT (query) | ALL | DISTINCT |
| FROM | |
| WHERE | |
| GROUP BY | |
| HAVING | |
| WINDOW AS | |
| ORDER BY | |
| ASC | DESC | |
| LIMIT | |
| SHOW (view object list) | TABLES |
| SHOW CREATE (view object structure definition syntax) | TABLE |
| VIEW | |
| FUNCTION | |
| PROCEDURE | |
| TRIGGER | |
| EVENT |
| Statement | Options |
|---|---|
| SELECT (query) | ALL | DISTINCT | DISTINCTROW |
| FROM | |
| WHERE | |
| GROUP BY | |
| HAVING | |
| WINDOW AS | |
| ORDER BY | |
| ASC | DESC | |
| LIMIT | |
| SHOW (view object list) | TABLES |
| FUNCTIONS | |
| PROCEDURES | |
| TRIGGERS | |
| VIEWS | |
| SYNONYMS | |
| ASSONBLIES | |
| SHOW CREATE (view object structure definition syntax) | TABLE |
| VIEW | |
| FUNCTION | |
| PROCEDURE | |
| TRIGGER | |
| EVENT | |
| DATA TYPE | |
| SYNONYM |