forked from TencentBlueKing/blueking-dbm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mysql): dbbackup 物理备份恢复失败修复 TencentBlueKing#4237
- Loading branch information
Showing
5 changed files
with
114 additions
and
10 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
dbm-services/common/db-config/assets/migrations/000043_sqlservercomm_data.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DELETE FROM tb_config_file_def WHERE namespace='sqlservercomm'; | ||
DELETE FROM tb_config_name_def WHERE namespace='sqlservercomm' AND (flag_encrypt!=1 or value_default like '{{%'); |
96 changes: 96 additions & 0 deletions
96
dbm-services/common/db-config/assets/migrations/000043_sqlservercomm_data.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) | ||
-- | ||
-- Host: localhost Database: bk_dbconfig | ||
-- ------------------------------------------------------ | ||
-- Server version 5.7.20-tmysql-3.3-log | ||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | ||
/*!40103 SET TIME_ZONE='+00:00' */; | ||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | ||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
/*!50717 SELECT COUNT(*) INTO @rocksdb_has_p_s_session_variables FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'session_variables' */; | ||
/*!50717 SET @rocksdb_get_is_supported = IF (@rocksdb_has_p_s_session_variables, 'SELECT COUNT(*) INTO @rocksdb_is_supported FROM performance_schema.session_variables WHERE VARIABLE_NAME=\'rocksdb_bulk_load\'', 'SELECT 0') */; | ||
/*!50717 PREPARE s FROM @rocksdb_get_is_supported */; | ||
/*!50717 EXECUTE s */; | ||
/*!50717 DEALLOCATE PREPARE s */; | ||
/*!50717 SET @rocksdb_enable_bulk_load = IF (@rocksdb_is_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @rocksdb_dummy_bulk_load = 0') */; | ||
/*!50717 PREPARE s FROM @rocksdb_enable_bulk_load */; | ||
/*!50717 EXECUTE s */; | ||
/*!50717 DEALLOCATE PREPARE s */; | ||
|
||
-- | ||
-- Dumping data for table `tb_config_file_def` | ||
-- | ||
-- WHERE: namespace='sqlservercomm' | ||
|
||
INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (347,'sqlservercomm','alarm','alarm.conf','告警配置','NULL','plat,app,module,cluster','NULL',1,1,0,NULL,5,365,0,'告警配置','2024-04-12 15:06:53','2024-04-12 15:07:34',NULL); | ||
INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (346,'sqlservercomm','backup','dbbackup.conf','备份配置','NULL','plat,app,module,cluster',NULL,1,1,0,NULL,5,365,0,'备份配置','2024-04-11 17:58:05','2024-04-12 15:07:34',NULL); | ||
/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; | ||
/*!50112 PREPARE s FROM @disable_bulk_load */; | ||
/*!50112 EXECUTE s */; | ||
/*!50112 DEALLOCATE PREPARE s */; | ||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | ||
|
||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | ||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | ||
|
||
-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) | ||
-- | ||
-- Host: localhost Database: bk_dbconfig | ||
-- ------------------------------------------------------ | ||
-- Server version 5.7.20-tmysql-3.3-log | ||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | ||
/*!40103 SET TIME_ZONE='+00:00' */; | ||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | ||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
/*!50717 SELECT COUNT(*) INTO @rocksdb_has_p_s_session_variables FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'session_variables' */; | ||
/*!50717 SET @rocksdb_get_is_supported = IF (@rocksdb_has_p_s_session_variables, 'SELECT COUNT(*) INTO @rocksdb_is_supported FROM performance_schema.session_variables WHERE VARIABLE_NAME=\'rocksdb_bulk_load\'', 'SELECT 0') */; | ||
/*!50717 PREPARE s FROM @rocksdb_get_is_supported */; | ||
/*!50717 EXECUTE s */; | ||
/*!50717 DEALLOCATE PREPARE s */; | ||
/*!50717 SET @rocksdb_enable_bulk_load = IF (@rocksdb_is_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @rocksdb_dummy_bulk_load = 0') */; | ||
/*!50717 PREPARE s FROM @rocksdb_enable_bulk_load */; | ||
/*!50717 EXECUTE s */; | ||
/*!50717 DEALLOCATE PREPARE s */; | ||
|
||
-- | ||
-- Dumping data for table `tb_config_name_def` | ||
-- | ||
-- WHERE: namespace='sqlservercomm' AND (flag_encrypt!=1 or value_default like '{{%') | ||
|
||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23686,'sqlservercomm','alarm','alarm.conf','log_send_queue','INT','1048576',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 15:26:47','2024-04-12 15:26:47',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23687,'sqlservercomm','alarm','alarm.conf','shrink_size','INT','200',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 16:11:08','2024-04-12 16:11:08',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23688,'sqlservercomm','alarm','alarm.conf','slow_duration','INT','1000',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 15:26:47','2024-04-12 15:26:47',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23689,'sqlservercomm','alarm','alarm.conf','slow_saveday','INT','60',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 15:26:47','2024-04-12 15:26:47',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23690,'sqlservercomm','alarm','alarm.conf','traceon','INT','0',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 15:26:47','2024-04-12 15:26:47',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23691,'sqlservercomm','alarm','alarm.conf','updatestats','INT','0',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 15:26:47','2024-04-12 15:26:47',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23680,'sqlservercomm','backup','dbbackup.conf','backup_client_path','STRING','C:\\cygwinroot\\usr\\local\\backup_client\\bin\\backup_client.exe',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23681,'sqlservercomm','backup','dbbackup.conf','backup_storage_type','STRING','hdfs',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23678,'sqlservercomm','backup','dbbackup.conf','backup_type','STRING','physics',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23679,'sqlservercomm','backup','dbbackup.conf','data_schema_grant','STRING','all',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23684,'sqlservercomm','backup','dbbackup.conf','full_backup_file_tag','STRING','MSSQL_FULL_BACKUP',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23676,'sqlservercomm','backup','dbbackup.conf','full_backup_min_size_mb','INT','40960',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:09:54','2024-04-12 11:09:54',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23672,'sqlservercomm','backup','dbbackup.conf','full_backup_path','STRING','D:\\dbbak\\full\\',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-11 17:41:52','2024-04-11 17:58:30',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23682,'sqlservercomm','backup','dbbackup.conf','full_backup_report_path','STRING','D:\\dbbak\\backup_result.log',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23674,'sqlservercomm','backup','dbbackup.conf','keep_full_backup_days','INT','2',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:09:36','2024-04-12 11:09:36',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23675,'sqlservercomm','backup','dbbackup.conf','keep_log_backup_days','INT','2',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:09:45','2024-04-12 11:09:45',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23685,'sqlservercomm','backup','dbbackup.conf','log_backup_file_tag','STRING','INCREMENT_BACKUP',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23677,'sqlservercomm','backup','dbbackup.conf','log_backup_min_size_mb','INT','30720',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:57','2024-04-12 11:10:57',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23673,'sqlservercomm','backup','dbbackup.conf','log_backup_path','STRING','D:\\dbbak\\log\\',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 10:58:15','2024-04-12 10:58:15',0); | ||
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (23683,'sqlservercomm','backup','dbbackup.conf','log_backup_report_path','STRING','D:\\dbbak\\binlog_result.log',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2024-04-12 11:10:58','2024-04-12 11:10:58',0); | ||
/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; | ||
/*!50112 PREPARE s FROM @disable_bulk_load */; | ||
/*!50112 EXECUTE s */; | ||
/*!50112 DEALLOCATE PREPARE s */; | ||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | ||
|
||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | ||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.