提交 a6c5bbe0 编写于 作者: M Mars Liu

disaster recovery

上级 769a1eed
{
"node_id": "mysql-91829d4938034ce09e99badf23dbebf6",
"keywords": [],
"children": [],
"export": [],
"keywords_must": [
["mysql", "WITH ROLLUP"]
],
"keywords_forbid": [],
"group": 0
}
\ No newline at end of file
{ {
"type": "code_options", "type": "code_options",
"author": null, "author": "Mars",
"source": "drop_index.md", "source": "drop_index.md",
"notebook_enable": false, "notebook_enable": false,
"exercise_id": "f786df4790e0407b91348a0fad24220f" "exercise_id": "f786df4790e0407b91348a0fad24220f"
......
{
"node_id": "mysql-40cf0134521849d891d6135e2316491a",
"keywords": ["mysqldumper"],
"children": [],
"export": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
\ No newline at end of file
{
"node_id": "mysql-0b976462e6314fa499a9f086c0eded8f",
"keywords": ["mysqlhotcopy"],
"children": [],
"export": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
\ No newline at end of file
{ {
"node_id": "mysql-76b4d2f260f94ea1a6692d5a8dab2709", "node_id": "mysql-76b4d2f260f94ea1a6692d5a8dab2709",
"keywords": ["灾难恢复"], "keywords": [
"灾难恢复"
],
"children": [], "children": [],
"export": [], "export": [
"disaster_recovery.json",
"dr_options.json"
],
"keywords_must": [], "keywords_must": [],
"keywords_forbid": [], "keywords_forbid": [],
"group": 0 "group": 2
} }
\ No newline at end of file
{ {
"type": "code_options", "type": "code_options",
"author": "ccat", "author": "Mars",
"source": "in_column.md", "source": "disaster_recovery.md",
"notebook_enable": false, "notebook_enable": false,
"exercise_id": "2ded48602e384fc2b5476186e8b91842" "exercise_id": "abca6ad634a74d09ba5cf44ab2510bfb"
} }
\ No newline at end of file
# 灾难恢复
Joe 管理的一台 MySQL 服务器因意外断电,出现了文件损坏,无法启动。他需要将这台服务器恢复起来,下列步骤中哪些是需要执行的?
1. 在 my.cnf 中的`[mysqld]`一节添加 `innodb_force_recovery = 1`
2. 尝试启动,如果失败,尝试 2 ~ 6 间的其它参数
3. 启动后备份数据库
4. 删除数据库,清理数据目录
5. 备份 MySQL 数据目录下的 ib_logfile\* 和 ibdata\* 文件,然后删除
6. 将 my.cnf 中的 `innodb_force_recovery` 设为0
7. 重启MySQL
8. 导入数据
## 答案
```
1, 2, 3, 4, 5, 6, 7, 8
```
## 选项
### A
```
1, 2, 4, 5, 6, 8
```
### B
```
1, 2, 4, 5, 8
```
### C
```
1, 2, 4, 8
```
### D
```
1, 2, 3, 4, 6, 7, 8
```
{
"type": "code_options",
"author": "Mars",
"source": "disaster_recovery.md",
"notebook_enable": false,
"exercise_id": "d971d72cd46f4bd38b0205b9a06f3798"
}
\ No newline at end of file
# 灾难恢复选项
设定 `innodb_force_recovery` 的值时,可选的有哪些?
1. (SRV_FORCE_IGNORE_CORRUPT):忽略损坏的数据页,继续运行MySQL服务。
2. (SRV_FORCE_NO_BACKGROUND):防止主线程和任何清除线程运行。如果清除操作期间发生崩溃,则此恢复值将阻止崩溃。
3. (SRV_FORCE_NO_TRX_UNDO):在崩溃后不运行事务回滚操作。
4. (SRV_FORCE_NO_IBUF_MERGE):不执行插入缓冲的合并操作,此值可能会永久损坏数据文件。使用此值后,需要删除并重新创建所有辅助索引,并且需要将InnoDB设置为只读。
5. (SRV_FORCE_NO_UNDO_LOG_SCAN):不查看重做日志,InnoDB存储引擎会将未提交的事务视为已提交。此值可能会永久损坏数据文件,需要将InnoDB设置为只读。
6. (SRV_FORCE_NO_LOG_REDO):不执行与恢复相关重做日志的前滚操作。此值可能会永久损坏数据文件,使数据库页处于过时状态,这反过来又可能导致B树和其他数据库结构的损坏,需要将InnoDB设置为只读。
## 答案
全部都是
## 选项
### A
```
2, 3, 4, 5
```
### B
```
1, 2, 3, 4, 5
```
### C
```
1, 2, 4
```
\ No newline at end of file
{
"node_id": "mysql-6064766016164bfebb475090c0979d2a",
"keywords": [],
"children": [],
"export": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
\ No newline at end of file
{
"node_id": "mysql-1c793163cd8047e1a3b327f2c86a1f68",
"keywords": [],
"children": [],
"export": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
\ No newline at end of file
{
"node_id": "mysql-3c8b76e8fa914a7a87c74f511fd39680",
"keywords": [],
"children": [],
"export": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
\ No newline at end of file
{
"node_id": "mysql-626f1ca763b344558b3a5eefdb4885a2",
"keywords": ["pt-query-digest", "优化"],
"children": [],
"export": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
\ No newline at end of file
{
"node_id": "mysql-4d5cfac3820648ffbe0b382898d9cf26",
"keywords": ["subquery"],
"children": [],
"export": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
\ No newline at end of file
...@@ -973,21 +973,6 @@ ...@@ -973,21 +973,6 @@
"keywords_forbid": [], "keywords_forbid": [],
"group": 1 "group": 1
} }
},
{
"WITH ROLLUP": {
"node_id": "mysql-91829d4938034ce09e99badf23dbebf6",
"keywords": [],
"children": [],
"keywords_must": [
[
"mysql",
"WITH ROLLUP"
]
],
"keywords_forbid": [],
"group": 0
}
} }
], ],
"keywords_must": [], "keywords_must": [],
...@@ -1072,7 +1057,11 @@ ...@@ -1072,7 +1057,11 @@
{ {
" IN": { " IN": {
"node_id": "mysql-8436069c855c4f1ead7cf11a026e004b", "node_id": "mysql-8436069c855c4f1ead7cf11a026e004b",
"keywords": [], "keywords": [
"in",
"subquery",
"子查询"
],
"children": [], "children": [],
"keywords_must": [ "keywords_must": [
[ [
...@@ -1083,7 +1072,7 @@ ...@@ -1083,7 +1072,7 @@
"keywords_forbid": [ "keywords_forbid": [
"not in" "not in"
], ],
"group": 0 "group": 1
} }
}, },
{ {
...@@ -1304,11 +1293,14 @@ ...@@ -1304,11 +1293,14 @@
{ {
"错误日志": { "错误日志": {
"node_id": "mysql-7645195ec078406c9303d39ea9c3738c", "node_id": "mysql-7645195ec078406c9303d39ea9c3738c",
"keywords": [], "keywords": [
"日志",
"错误日志"
],
"children": [], "children": [],
"keywords_must": [], "keywords_must": [],
"keywords_forbid": [], "keywords_forbid": [],
"group": 0 "group": 2
} }
}, },
{ {
...@@ -1345,42 +1337,8 @@ ...@@ -1345,42 +1337,8 @@
} }
}, },
{ {
"mysqldumper": { "数据导入和导出": {
"node_id": "mysql-40cf0134521849d891d6135e2316491a", "node_id": "mysql-e2eefb85984643f8adb95f4eee16bc8f",
"keywords": [
"mysqldumper"
],
"children": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
},
{
"mysqlhotcopy": {
"node_id": "mysql-0b976462e6314fa499a9f086c0eded8f",
"keywords": [
"mysqlhotcopy"
],
"children": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
},
{
"xtrabackup": {
"node_id": "mysql-6064766016164bfebb475090c0979d2a",
"keywords": [],
"children": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
},
{
"完全备份和增量备份": {
"node_id": "mysql-1c793163cd8047e1a3b327f2c86a1f68",
"keywords": [], "keywords": [],
"children": [], "children": [],
"keywords_must": [], "keywords_must": [],
...@@ -1397,27 +1355,7 @@ ...@@ -1397,27 +1355,7 @@
"children": [], "children": [],
"keywords_must": [], "keywords_must": [],
"keywords_forbid": [], "keywords_forbid": [],
"group": 0 "group": 2
}
},
{
"自动备份": {
"node_id": "mysql-3c8b76e8fa914a7a87c74f511fd39680",
"keywords": [],
"children": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
},
{
"数据导入和导出": {
"node_id": "mysql-e2eefb85984643f8adb95f4eee16bc8f",
"keywords": [],
"children": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
} }
} }
], ],
...@@ -2266,31 +2204,6 @@ ...@@ -2266,31 +2204,6 @@
"keywords_forbid": [], "keywords_forbid": [],
"group": 0 "group": 0
} }
},
{
" PT-QUERY-DIGEST分析查询": {
"node_id": "mysql-626f1ca763b344558b3a5eefdb4885a2",
"keywords": [
"pt-query-digest",
"优化"
],
"children": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
},
{
"子查询优化": {
"node_id": "mysql-4d5cfac3820648ffbe0b382898d9cf26",
"keywords": [
"subquery"
],
"children": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
}
} }
], ],
"keywords_must": [], "keywords_must": [],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册