
文章插圖
背景前邊幾篇文章我簡單介紹了使用mysqlshell備份數據庫及恢復備份數據的方式.這篇文章我們簡單探討一下mysqlshell備份數據庫的原理.主要結合mysqlshell的輸出以及mysql general_log
mysqlshell備份整個實例的原理mysqlshell輸出:
MySQL10.10.119.63:33060+ sslJS > util.dumpInstance("/mysqlsh",{threads : 8,ocimds:true,compatibility:["strip_restricted_grants"],bytesPerChunk:"1M"})Acquiring global read lockGlobal read lock acquiredGathering information - doneAll transactions have been startedLocking instance for backupGlobal read lock has been releasedChecking for compatibility with MySQL Database Service 8.0.26NOTE: User 'donor'@'%' had restricted privilege (BACKUP_ADMIN) removedNOTE: User 'lzm'@'%' had restricted privileges (AUDIT_ADMIN, BACKUP_ADMIN, BINLOG_ADMIN, BINLOG_ENCRYPTION_ADMIN, CLONE_ADMIN, CREATE TABLESPACE, ENCRYPTION_KEY_ADMIN, FILE, GROUP_REPLICATION_ADMIN, INNODB_REDO_LOG_ARCHIVE, INNODB_REDO_LOG_ENABLE, PERSIST_RO_VARIABLES_ADMIN, RELOAD, REPLICATION_SLAVE_ADMIN, ROLE_ADMIN, SERVICE_CONNECTION_ADMIN, SESSION_VARIABLES_ADMIN, SET_USER_ID, SHOW_ROUTINE, SHUTDOWN, SUPER, SYSTEM_USER, SYSTEM_VARIABLES_ADMIN, TABLE_ENCRYPTION_ADMIN) removedNOTE: User 'repl_mgr'@'%' had restricted privilege (BACKUP_ADMIN) removedNOTE: User 'root'@'127.0.0.1' had restricted privileges (AUDIT_ADMIN, BACKUP_ADMIN, BINLOG_ADMIN, BINLOG_ENCRYPTION_ADMIN, CLONE_ADMIN, CREATE TABLESPACE, ENCRYPTION_KEY_ADMIN, FILE, GROUP_REPLICATION_ADMIN, INNODB_REDO_LOG_ARCHIVE, INNODB_REDO_LOG_ENABLE, PERSIST_RO_VARIABLES_ADMIN, RELOAD, REPLICATION_SLAVE_ADMIN, ROLE_ADMIN, SERVICE_CONNECTION_ADMIN, SESSION_VARIABLES_ADMIN, SET_USER_ID, SHOW_ROUTINE, SHUTDOWN, SUPER, SYSTEM_USER, SYSTEM_VARIABLES_ADMIN, TABLE_ENCRYPTION_ADMIN) removedNOTE: User 'root'@'localhost' had restricted privileges (AUDIT_ADMIN, BACKUP_ADMIN, BINLOG_ADMIN, BINLOG_ENCRYPTION_ADMIN, CLONE_ADMIN, CREATE TABLESPACE, ENCRYPTION_KEY_ADMIN, FILE, GROUP_REPLICATION_ADMIN, INNODB_REDO_LOG_ARCHIVE, INNODB_REDO_LOG_ENABLE, PERSIST_RO_VARIABLES_ADMIN, PROXY, RELOAD, REPLICATION_SLAVE_ADMIN, ROLE_ADMIN, SERVICE_CONNECTION_ADMIN, SESSION_VARIABLES_ADMIN, SET_USER_ID, SHOW_ROUTINE, SHUTDOWN, SUPER, SYSTEM_USER, SYSTEM_VARIABLES_ADMIN, TABLE_ENCRYPTION_ADMIN) removedNOTE: Database test_1 had unsupported ENCRYPTION option commented outNOTE: Database test_2 had unsupported ENCRYPTION option commented outNOTE: Database test had unsupported ENCRYPTION option commented outNOTE: Database lzm had unsupported ENCRYPTION option commented outCompatibility issues with MySQL Database Service 8.0.26 were found and repaired. Please review the changes made before loading them.Writing global DDL filesWriting users DDLWriting DDL for schema `test_1`Writing DDL for table `test_1`.`T_CM_CUST`Writing DDL for schema `test_2`Writing DDL for table `test_2`.`checkpoint_lox`Writing DDL for table `test_2`.`T_HM_PropertyRight`Writing DDL for table `test_2`.`checkpoint`Writing DDL for table `test_2`.`T_HM_OWNER`Preparing data dump for table `test_1`.`T_CM_CUST`Data dump for table `test_1`.`T_CM_CUST` will be chunked using column `PKID`Preparing data dump for table `test_2`.`checkpoint_lox`Data dump for table `test_2`.`checkpoint_lox` will be chunked using columns `group_name`, `group_key`, `log_cmplt_csn`, `log_cmplt_xids_seq`Preparing data dump for table `test_2`.`checkpoint`Data dump for table `test_2`.`checkpoint` will be chunked using columns `group_name`, `group_key`Preparing data dump for table `test_2`.`T_HM_PropertyRight`Data dump for table `test_2`.`T_HM_PropertyRight` will be chunked using column `pkid`Preparing data dump for table `test_2`.`T_HM_OWNER`Data dump for table `test_2`.`T_HM_OWNER` will be chunked using column `pkid`Preparing data dump for table `test_2`.`T_HM_HOUSE`Data dump for table `test_2`.`T_HM_HOUSE` will be chunked using column `pkid`Preparing data dump for table `test_2`.`T_HM_HOUSEDEL`Data dump for table `test_2`.`T_HM_HOUSEDEL` will be chunked using column `pkid`Preparing data dump for table `test`.`t1`Data dump for table `test`.`t1` will be chunked using column `c1`Preparing data dump for table `lzm`.`sbtest1`Data dump for table `lzm`.`sbtest1` will be chunked using column `id`Writing DDL for table `test_2`.`T_HM_HOUSE`Running data dump using 8 threads.NOTE: Progress information uses estimated values and may not be accurate.Writing DDL for table `test_2`.`T_HM_HOUSEDEL`Writing DDL for schema `test`Writing DDL for table `test`.`t1`Writing DDL for schema `lzm`Writing DDL for table `lzm`.`sbtest1`NOTE: Table statistics not available for `test_2`.`checkpoint_lox`, chunking operation may be not optimal. Please consider running 'ANALYZE TABLE `test_2`.`checkpoint_lox`;' first.NOTE: Table statistics not available for `test_2`.`checkpoint`, chunking operation may be not optimal. Please consider running 'ANALYZE TABLE `test_2`.`checkpoint`;' first.Data dump for table `test_1`.`T_CM_CUST` will be written to 4 filesData dump for table `test_2`.`checkpoint_lox` will be written to 1 fileData dump for table `test_2`.`T_HM_PropertyRight` will be written to 1 fileData dump for table `test_2`.`T_HM_OWNER` will be written to 1 fileNOTE: Table statistics not available for `test`.`t1`, chunking operation may be not optimal. Please consider running 'ANALYZE TABLE `test`.`t1`;' first.Data dump for table `test_2`.`T_HM_HOUSE` will be written to 1 fileData dump for table `test`.`t1` will be written to 1 fileData dump for table `test_2`.`T_HM_HOUSEDEL` will be written to 4 filesData dump for table `lzm`.`sbtest1` will be written to 23 filesData dump for table `test_2`.`checkpoint` will be written to 1 file1 thds dumping - 102% (128.91K rows / ~125.17K rows), 0.00 rows/s, 0.00 B/s uncompressed, 0.00 B/s compressedDuration: 00:00:00sSchemas dumped: 4Tables dumped: 9Uncompressed data size: 25.67 MBCompressed data size: 9.88 MBCompression ratio: 2.6Rows written: 128906Bytes written: 9.88 MBAverage uncompressed throughput: 25.67 MB/sAverage compressed throughput: 9.88 MB/s mysql general_log的輸出:
以上關于本文的內容,僅作參考!溫馨提示:如遇健康、疾病相關的問題,請您及時就醫(yī)或請專業(yè)人士給予相關指導!
「愛刨根生活網」www.malaban59.cn小編還為您精選了以下內容,希望對您有所幫助:- 云備份怎么恢復到手機 蘋果云備份怎么恢復
- 阿里分析型數據庫 阿里云數據庫怎么用
- mysql定時備份數據庫命令 mysql數據庫自動備份方法
- 自己搭建服務器步驟 服務器熱備份怎么做
- 數據庫數據去重方法 mysql查詢去重后的總數
- 數據庫遷移的兩種方法 oracle數據庫遷移方案對比
- java連接數據庫步驟 java連接mysql數據庫代碼
- redis保證和數據庫事務一致 redis和mysql數據同步原理
- 網頁連接mysql數據庫 jsp連接mysql設置
- 云服務器搭建數據庫方法 阿里云數據庫服務器怎么用
