【手摸手玩轉 OceanBase 165】怎麼檢視資料備份結果?

13579NB232發表於2023-01-19

資料備份執行完成後,您可以透過檢視檢視備份任務歷史。

透過檢視檢視資料備份任務歷史

  1. 使用  root 使用者登入到資料庫的  sys 租戶。

  2. 檢視資料備份歷史。

    示例如下:

    obclient> SELECT * FROM oceanbase.CDB_OB_BACKUP_JOB_HISTORY\G
    *************************** 1. row ***************************
              TENANT_ID: 1
                 JOB_ID: 1
            INCARNATION: 1
          BACKUP_SET_ID: 0
    INITIATOR_TENANT_ID: 1
       INITIATOR_JOB_ID: 1
     EXECUTOR_TENANT_ID: 1002
        PLUS_ARCHIVELOG: OFF
            BACKUP_TYPE: D
              JOB_LEVEL: CLUSTER
        ENCRYPTION_MODE: NONE
                 PASSWD:
        START_TIMESTAMP: 2022-06-01 16:54:25.940040
          END_TIMESTAMP: 2022-06-01 16:56:03.779662
                 STATUS: COMPLETED
                 RESULT: 0
                COMMENT:
            DESCRIPTION:
                   PATH:
    *************************** 2. row ***************************
              TENANT_ID: 1002
                 JOB_ID: 1
            INCARNATION: 1
          BACKUP_SET_ID: 1
    INITIATOR_TENANT_ID: 1
       INITIATOR_JOB_ID: 1
     EXECUTOR_TENANT_ID: 1002
        PLUS_ARCHIVELOG: OFF
            BACKUP_TYPE: D
              JOB_LEVEL: USER_TENANT
        ENCRYPTION_MODE: NONE
                 PASSWD:
        START_TIMESTAMP: 2022-06-01 16:54:26.007298
          END_TIMESTAMP: 2022-06-01 16:56:03.629399
                 STATUS: COMPLETED
                 RESULT: 0
                COMMENT:
            DESCRIPTION:
                   PATH: file:///data/nfs/backup/data
    obclient> SELECT * FROM oceanbase.CDB_OB_BACKUP_TASK_HISTORY\G
    *************************** 1. row ***************************
                   TENANT_ID: 1002
                     TASK_ID: 1
                      JOB_ID: 1
                 INCARNATION: 1
               BACKUP_SET_ID: 1
             START_TIMESTAMP: 2022-06-01 16:54:26.007298
               END_TIMESTAMP: 2022-06-01 16:56:03.576909
                      STATUS: COMPLETED
                   START_SCN: 1658739252505427433
                     END_SCN: 1658739352813474497
           USER_LS_START_SCN: 1658739274182399688
             ENCRYPTION_MODE: NONE
                      PASSWD:
                 INPUT_BYTES: 567650229
                OUTPUT_BYTES: 567650229
           OUTPUT_RATE_BYTES: 5817899.8889
             EXTRA_META_BYTES: 0
                TABLET_COUNT: 1285
         FINISH_TABLET_COUNT: 1285
           MACRO_BLOCK_COUNT: 270
    FINISH_MACRO_BLOCK_COUNT: 270
                  FILE_COUNT: 0
                META_TURN_ID: 1
                DATA_TURN_ID: 1
                      RESULT: 0
                     COMMENT:
                        PATH: file:///data/nfs/backup/data

    oceanbase.CDB_OB_BACKUP_JOB_HISTORY 檢視中的各欄位基本與  oceanbase.CDB_OB_BACKUP_JOBS 檢視相對應,  oceanbase.CDB_OB_BACKUP_TASK_HISTORY 各欄位基本與  oceanbase.CDB_OB_BACKUP_TASKS 相對應。其中,  COMMENT 用於記錄任務失敗時的相關錯誤資訊。

    更多  CDB_OB_BACKUP_JOB_HISTORY 和  CDB_OB_BACKUP_TASK_HISTORY 檢視的說明,請參見  CDB_OB_BACKUP_JOB_HISTORY 和  CDB_OB_BACKUP_TASK_HISTORY

  3. 檢視對應的備份集資訊。

    obclient> SELECT * FROM oceanbase.CDB_OB_BACKUP_SET_FILES WHERE backup_set_id = 1 AND tenant_id = 1004\G
    *************************** 1. row ***************************
                     TENANT_ID: 1002
                 BACKUP_SET_ID: 1
                       DEST_ID: 1001
                   INCARNATION: 1
                   BACKUP_TYPE: FULL
       PREV_FULL_BACKUP_SET_ID: 0
        PREV_INC_BACKUP_SET_ID: 0
               START_TIMESTAMP: 2022-06-01 16:54:26.007298
                 END_TIMESTAMP: 2022-06-01 16:56:03.576909
                        STATUS: SUCCESS
                   FILE_STATUS: AVAILABLE
              ELAPSED_SECONDES: 469
               PLUS_ARCHIVELOG: OFF
              START_REPLAY_SCN: 0
      START_REPLAY_SCN_DISPLAY:
               MIN_RESTORE_SCN: 1662389318902587000
       MIN_RESTORE_SCN_DISPLAY: 2022-06-01 16:55:03.902587
                   INPUT_BYTES: 567650229
                  OUTPUT_BYTES: 567650229
             OUTPUT_RATE_BYTES: 5817899.8889
              EXTRA_META_BYTES: 0
                  TABLET_COUNT: 1285
           FINISH_TABLET_COUNT: 1285
             MACRO_BLOCK_COUNT: 270
      FINISH_MACRO_BLOCK_COUNT: 270
                    FILE_COUNT: 0
                  META_TURN_ID: 1
                  DATA_TURN_ID: 1
                        RESULT: 0
                       COMMENT:
               ENCRYPTION_MODE: NONE
                        PASSWD:
             TENANT_COMPATIBLE: 4.0.0.0
             BACKUP_COMPATIBLE: 0
                          PATH: file:///data/nfs/backup/data

    更多  CDB_OB_BACKUP_SET_FILES 檢視的說明,請參見  CDB_OB_BACKUP_SET_FILES


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70026124/viewspace-2932882/,如需轉載,請註明出處,否則將追究法律責任。

相關文章