百度智能云

All Product Document

          Data Warehouse

          SHOW-SNAPSHOT

          SHOW SNAPSHOT

          Description

          This statement is used to view backup snapshots that already exist in the respository.

          SHOW SNAPSHOT ON `repo_name`
          [WHERE SNAPSHOT = "snapshot" [AND TIMESTAMP = "backup_timestamp"]];

          The results can be filtered by using WHERE statement, and more detailed information about a snapshot can be displayed.

          Description of return results:

          1. View all snapshots:

            mysql> show snapshot on bos_repo;
            +------------+---------------------+--------+
            | Snapshot   | Timestamp           | Status |
            +------------+---------------------+--------+
            | snapshot1  | 2020-06-11-20-56-29 | OK     |
            | snapshot2  | 2020-06-11-15-34-35 | OK     |
            | snapshot3  | 2020-06-11-20-39-20 | OK     |
            +------------+---------------------+--------+
            • Snapshot:name of backup.
            • Timestamp:time version of corresponding backup.
            • Status:If the backup is normal, it will show OK; otherwise, it will show an error message.
          2. View the time version of specified snapshot:

            mysql> show snapshot on bos_repo where snapshot = "snapshot1" and timestamp="2020-06-11-20-56-29"\G
            *************************** 1. row ***************************
             Snapshot: snapshot1
            Timestamp: 2020-06-11-20-56-29
             Database: example_db
              Details: {
                         "database": "example_db",
                         "meta_version": 93,
                         "backup_time": 1591880189,
                         "name": "snapshot1",
                         "backup_result": "succeed",
                         "backup_objects": {
                          "table1": {"partitions": {"table1": {}}},
                          "table1": {"partitions": {"p1": {}}}
                         }
                        }
               Status: OK

            If TIMESTAMP is specified, the following additional information will be displayed:

            • Database:name of the database in the backup data source.
            • Details:Show the entire backup data directory and file structure in the form of Json.

          Example

          1. View the existing backups in repositoryexample_repo:

            SHOW SNAPSHOT ON example_repo;
          2. Only view the backups named backup1 in repository example_repo:

            SHOW SNAPSHOT ON example_repo WHERE SNAPSHOT = "backup1";
          3. View the details of the backup named backup1 in the repository example_repo with the time version of "2018-05-05-15-34-26":

            SHOW SNAPSHOT ON example_repo
            WHERE SNAPSHOT = "backup1" AND TIMESTAMP = "2020-05-05-15-34-26";

          Keywords

          SHOW, SNAPSHOT
          Previous
          SHOW-ALTER-TABLE-MATERIALIZED-VIEW
          Next
          SHOW-ROUTINE-LOAD