Query Database Snapshots
Who can use this feature
Anyone with these permissions: Query databases
This article explains how to query your database snapshots in the Eon console and through the API.
Query a database snapshot
With the Eon console
With the API
To get started, open the database you want to query in the database explorer. You can do this from either your inventory or the Search page:
-
In your inventory: Select the database resource, and click Explore database when the drawer opens.
-
In the Search page: Search for a database name, table name, or column, and click Explore Database in the relevant card in the results.
Before you start
-
You can query only RDS databases that are backed up by Eon. If your database hasn’t been backed up by Eon, or if all its Eon snapshots have expired, you can back it up on demand.
-
Make sure the restore account contains a bucket in the same region as the vault you’re querying from.
Choose the snapshot you want to query
In the database explorer, under Currently exploring this snapshot, check the time and date of the snapshot you’re exploring. This is the snapshot you’ll query.
If you want to query a different snapshot:
-
Click Change. You’ll see a calendar view with colored dots on the days when snapshots were taken. There can be more than one snapshot per day.
When you click a day, a list of database snapshots taken that day is displayed below the calendar.
-
When you find the snapshot you want to explore, click Select. The database explorer updates to show the snapshot you selected.
-
The schema is presented as a tree view that shows the database structure when the snapshot was taken. You can expand all the levels to see your tables and columns.
Choose the database to query
If the resource backed up by the snapshot contains multiple databases, you’ll choose which database to query. To do this, click the Querying database list and select the database you want to query.
Choose the restore storage destination
Query results are restored to a bucket in your restore account.
To set the destination bucket:
-
Click Save results to. The Save Destination drawer opens.
-
Choose an Account and Bucket.
-
Optionally, you can provide a bucket Prefix if you want to restore the object to a specific location in the bucket. If you don’t provide a prefix, the object is restored to the bucket root.
If there are naming conflicts with existing objects, Eon overwrites the existing data. We recommend using a prefix if you’re restoring to a non-empty bucket.
-
Click Save.
Run the query
Eon supports running SELECT SQL queries against snapshots as if you were querying the original database directly.
Under the hood, Eon queries the snapshot data with Amazon Athena.
For more information, see SELECT in the Amazon Athena docs.
To query the snapshot, enter your SQL expression in the query editor, and click Run Query.
The query runs and, when the response is ready, a sample of the results is displayed in the results panel. Note that the sample results are limited to 1,000 rows.
Download the records
When you run a query, the full results are saved to the restore bucket as a CSV file. If you need to see more than 1,000 records or share the results, you can retrieve the CSV file by clicking (Visit object URL) or (Visit object URL).
Note that read access to the S3 bucket is needed to visit the URL or download the file.
If you navigated away from the database explorer before the query results were returned, the location of the query results won’t be displayed in the console. You can still retrieve them by visiting the restore bucket at the prefix you specified in step 3.
You can now share or download the query results as needed.
Additionally, Eon creates a restore job for the query, which you can find in the Restore jobs tab in the Jobs page.