説明
BACKUP および RESTORE 操作に関する情報を含むログエントリです。
カラム
hostname(LowCardinality(String)) — クエリを実行しているサーバーのホスト名。event_date(Date) — エントリの日付。event_time(DateTime) — エントリの時刻。event_time_microseconds(DateTime64(6)) — マイクロ秒精度のエントリ時刻。id(String) — バックアップまたは復元操作の識別子。name(String) — バックアップストレージの名前 (FROM 句または TO 句の内容) 。base_backup_name(String) — インクリメンタルバックアップの場合のベースバックアップ名。query_id(String) — バックアップ操作に関連付けられたクエリの ID。status(Enum8('CREATING_BACKUP' = 0, 'BACKUP_CREATED' = 1, 'BACKUP_FAILED' = 2, 'RESTORING' = 3, 'RESTORED' = 4, 'RESTORE_FAILED' = 5, 'BACKUP_CANCELLED' = 6, 'RESTORE_CANCELLED' = 7)) — 操作の状態。error(String) — 失敗した操作のエラーメッセージ (成功した操作では空文字列) 。start_time(DateTime64(6)) — 操作の開始時刻。end_time(DateTime64(6)) — 操作の終了時刻。num_files(UInt64) — バックアップに格納されているファイル数。total_size(UInt64) — バックアップに格納されているファイルの合計サイズ。num_entries(UInt64) — バックアップ内のエントリ数。つまり、バックアップがフォルダーとして保存されている場合はそのフォルダー内のファイル数、アーカイブとして保存されている場合はそのアーカイブ内のファイル数です。インクリメンタルバックアップである場合や、空ファイルまたは重複ファイルを含む場合は、num_filesと一致しません。常にnum_entries ≤ num_filesが成り立ちます。uncompressed_size(UInt64) — バックアップの非圧縮サイズ。compressed_size(UInt64) — バックアップの圧縮サイズ。バックアップがアーカイブとして保存されていない場合は、uncompressed_size と等しくなります。files_read(UInt64) — 復元操作中に読み取られたファイル数。bytes_read(UInt64) — 復元操作中に読み取られたファイルの合計サイズ。settings(Map(LowCardinality(String), String)) — この操作で実際に使用されたバックアップ/復元固有の設定 (SETTINGS句のもの。デフォルトを含む) 。機密性の高い設定は公開されません。engine_settings(Map(LowCardinality(String), String)) — バックアップエンジンの reader/writer が実際に使用した設定 (例: S3allow_native_copy) 。フラットな map で表現できない複数のエンジンが操作に関与する場合は空になります。これに該当するのは、インクリメンタルバックアップと復元、軽量スナップショットの復元、および内部でないON CLUSTER操作です。
例
BACKUP TABLE test_db.my_table TO Disk('backups_disk', '1.zip')┌─id───────────────────────────────────┬─status─────────┐
│ e5b74ecb-f6f1-426a-80be-872f90043885 │ BACKUP_CREATED │
└──────────────────────────────────────┴────────────────┘SELECT hostname, event_date, event_time_microseconds, id, name, status, error, start_time, end_time, num_files, total_size, num_entries, uncompressed_size, compressed_size, files_read, bytes_read FROM system.backup_log WHERE id = 'e5b74ecb-f6f1-426a-80be-872f90043885' ORDER BY event_date, event_time_microseconds \GRow 1:
──────
hostname: clickhouse.eu-central1.internal
event_date: 2023-08-19
event_time_microseconds: 2023-08-19 11:05:21.998566
id: e5b74ecb-f6f1-426a-80be-872f90043885
name: Disk('backups_disk', '1.zip')
status: CREATING_BACKUP
error:
start_time: 2023-08-19 11:05:21
end_time: 1970-01-01 03:00:00
num_files: 0
total_size: 0
num_entries: 0
uncompressed_size: 0
compressed_size: 0
files_read: 0
bytes_read: 0
Row 2:
──────
hostname: clickhouse.eu-central1.internal
event_date: 2023-08-19
event_time: 2023-08-19 11:08:56
event_time_microseconds: 2023-08-19 11:08:56.916192
id: e5b74ecb-f6f1-426a-80be-872f90043885
name: Disk('backups_disk', '1.zip')
status: BACKUP_CREATED
error:
start_time: 2023-08-19 11:05:21
end_time: 2023-08-19 11:08:56
num_files: 57
total_size: 4290364870
num_entries: 46
uncompressed_size: 4290362365
compressed_size: 3525068304
files_read: 0
bytes_read: 0RESTORE TABLE test_db.my_table FROM Disk('backups_disk', '1.zip')┌─id───────────────────────────────────┬─status───┐
│ cdf1f731-52ef-42da-bc65-2e1bfcd4ce90 │ RESTORED │
└──────────────────────────────────────┴──────────┘SELECT hostname, event_date, event_time_microseconds, id, name, status, error, start_time, end_time, num_files, total_size, num_entries, uncompressed_size, compressed_size, files_read, bytes_read FROM system.backup_log WHERE id = 'cdf1f731-52ef-42da-bc65-2e1bfcd4ce90' ORDER BY event_date, event_time_microseconds \GRow 1:
──────
hostname: clickhouse.eu-central1.internal
event_date: 2023-08-19
event_time_microseconds: 2023-08-19 11:09:19.718077
id: cdf1f731-52ef-42da-bc65-2e1bfcd4ce90
name: Disk('backups_disk', '1.zip')
status: RESTORING
error:
start_time: 2023-08-19 11:09:19
end_time: 1970-01-01 03:00:00
num_files: 0
total_size: 0
num_entries: 0
uncompressed_size: 0
compressed_size: 0
files_read: 0
bytes_read: 0
Row 2:
──────
hostname: clickhouse.eu-central1.internal
event_date: 2023-08-19
event_time_microseconds: 2023-08-19 11:09:29.334234
id: cdf1f731-52ef-42da-bc65-2e1bfcd4ce90
name: Disk('backups_disk', '1.zip')
status: RESTORED
error:
start_time: 2023-08-19 11:09:19
end_time: 2023-08-19 11:09:29
num_files: 57
total_size: 4290364870
num_entries: 46
uncompressed_size: 4290362365
compressed_size: 4290362365
files_read: 57
bytes_read: 4290364870これは、システムテーブル system.backups に記載されている情報と基本的に同じです。
SELECT id, name, status, error, start_time, end_time, num_files, total_size, num_entries, uncompressed_size, compressed_size, files_read, bytes_read FROM system.backups ORDER BY start_time┌─id───────────────────────────────────┬─name──────────────────────────┬─status─────────┬─error─┬──────────start_time─┬────────────end_time─┬─num_files─┬─total_size─┬─num_entries─┬─uncompressed_size─┬─compressed_size─┬─files_read─┬─bytes_read─┐
│ e5b74ecb-f6f1-426a-80be-872f90043885 │ Disk('backups_disk', '1.zip') │ BACKUP_CREATED │ │ 2023-08-19 11:05:21 │ 2023-08-19 11:08:56 │ 57 │ 4290364870 │ 46 │ 4290362365 │ 3525068304 │ 0 │ 0 │
│ cdf1f731-52ef-42da-bc65-2e1bfcd4ce90 │ Disk('backups_disk', '1.zip') │ RESTORED │ │ 2023-08-19 11:09:19 │ 2023-08-19 11:09:29 │ 57 │ 4290364870 │ 46 │ 4290362365 │ 4290362365 │ 57 │ 4290364870 │
└──────────────────────────────────────┴───────────────────────────────┴────────────────┴───────┴─────────────────────┴─────────────────────┴───────────┴────────────┴─────────────┴───────────────────┴─────────────────┴────────────┴────────────┘