Skip to content

Commit

Permalink
更新数据库笔记。
Browse files Browse the repository at this point in the history
  • Loading branch information
Suomea committed Nov 30, 2024
1 parent 7b0af6e commit 2abcc72
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 102 deletions.
127 changes: 29 additions & 98 deletions .obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,95 +4,24 @@
"type": "split",
"children": [
{
"id": "a45a840c1ad45698",
"id": "01cc4a5b82eeb3b3",
"type": "tabs",
"children": [
{
"id": "47b552b8f2a4ce6b",
"id": "0743fed77e619d96",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "docs/Kafka/Kafka 常用命令.md",
"file": "docs/MySQL/MySQL 配置主从.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Kafka 常用命令"
}
},
{
"id": "15ad8188edb7d17e",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "docs/Doris/Doris 用户角色权限.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Doris 用户角色权限"
}
},
{
"id": "577d134547ab0814",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "docs/DM/达梦安装.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "达梦安装"
}
},
{
"id": "934cebd8e14fc42f",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "docs/OS/并发控制.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "并发控制"
}
},
{
"id": "8364f7f1d8a80f5a",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "docs/Doris/Doris 接入 MySQL 的数据.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Doris 接入 MySQL 的数据"
}
},
{
"id": "5e3de0ae73146200",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "docs/OS/线程.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "线程"
"title": "MySQL 配置主从"
}
}
],
"currentTab": 2
]
}
],
"direction": "vertical"
Expand Down Expand Up @@ -210,10 +139,10 @@
"state": {
"type": "outline",
"state": {
"file": "docs/DM/达梦安装.md"
"file": "docs/MySQL/MySQL 配置主从.md"
},
"icon": "lucide-list",
"title": "达梦安装 的大纲"
"title": "MySQL 配置主从 的大纲"
}
}
],
Expand All @@ -234,35 +163,37 @@
"command-palette:打开命令面板": false
}
},
"active": "577d134547ab0814",
"active": "0743fed77e619d96",
"lastOpenFiles": [
"docs/DM/达梦备份.md",
"docs/DM/达梦 Tips.md",
"docs/MySQL/MySQL 备份.md",
"docs/MySQL/MySQL Tips.md",
"docs/Doris/Doris 接入 MySQL 的数据.md",
"docs/Doris/Doris 接入 Kafka 的数据.md",
"docs/Doris/Doris 分区表.md",
"docs/Doris/Doris 用户角色权限.md",
"docs/Doris/Doris 日期时间类型.md",
"docs/Doris/Doris 用户角色权限.md",
"docs/DM/达梦安装.md",
"docs/Kafka/Kafka 常用命令.md",
"docs/DM/达梦备份.md",
"docs/DM/达梦 Tips.md",
"docs/Kafka/Kafka 集群搭建.md",
"docs/Kafka/Kafka 常用命令.md",
"docs/Kafka/Kafka 消费者.md",
"docs/Java/Java 并发.md",
"docs/Reading/Timeline.md",
"docs/Linux/Nginx 使用自签名证书.md",
"docs/Linux/Linux 账号群组.md",
"docs/Redis/Redis 分布式锁.md",
"docs/Java/Java 队列.md",
"docs/index.md",
"docs/Java/Tips.md",
"docs/Java/重复提交.md",
"未命名.md",
"docs/Docker/安装 Docker.md",
"docs/Docker/镜像操作.md",
"docs/Arts/满江红-岳飞.md",
"docs/Arts/大观楼长联-孙髯.md",
"docs/Arts/侠客行-李白.md",
"docs/Algorithms/求解算数表达式的值.md",
"docs/Algorithms/字符串匹配算法.md",
"docs/Algorithms/Base64 算法.md",
"overrides/partials/comments.html",
"overrides/partials/footer.html",
"template/Doris.md",
"docs/OS/线程.md",
"mkdocs.yml",
"docs/Redis/Redis 安装.md",
"docs/Server/阿里云服务器106.15.72.83.md",
"docs/Server/本地服务器192.168.31.11.md",
"docs/Linux/Debian 软件安装.md",
"docs/Linux/curl.md",
"docs/Linux/ArcLinux 安装.md",
"docs/Java/并发.md",
"docs/Java/微服务优雅停机.md",
"docs/LocalFile/Picture/ReentrantReadWriteLock类图.svg",
"docs/LocalFile/Picture/ReentrantLock类图.svg",
"docs/LocalFile/Picture/ReentrantLock类图.png",
Expand Down
10 changes: 7 additions & 3 deletions docs/DM/达梦 Tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ Maven 依赖
mvn install:install-file -Dfile=.\DmJdbcDriver18.jar -DgroupId=com.dm -DartifactId=DmJdbcDriver18 -Dversion=18 -Dpackaging=jar
```

## 查看 License 信息
EXPIRED_DATE 为空说明永久有效。
```
## 查询信息
查看许可信息,EXPIRED_DATE 为空说明永久有效。
```sql
select * from v$license
```

查看版本信息。
```sql
select * from v$instance;
```
## 达梦默认的角色
5 changes: 4 additions & 1 deletion docs/Doris/Doris 接入 Kafka 的数据.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ show routine load 能够查询导入作业的状态。

如果遇到错误,比如必填字段缺少会导致任务 pause,`resume routine load for task_name;` 重启启动任务就好,会跳过错误的消息。

测试完毕之后可以通过 pause 暂停导入任务:`pause routine load for task_name;`
测试完毕之后可以通过 pause 暂停导入任务:`pause routine load for task_name;`

## 调优
Kafka 多
23 changes: 23 additions & 0 deletions docs/MySQL/MySQL 配置主从.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,29 @@ character-set-server = utf8mb4
max_connections = 2000
```

使用启动选项 --binglog-ignore-db=db_name 可以配置对某个数据库不生成 binlog。该启动选项没有对应的系统变量。
```
[mysqld]
binlog-ignore-db=test_db
binlog-ignore-db=dev_db
```

查看 binlog 的文件内容:
```
mysqlbinlog --no-defaults --base64-output=decode-rows -v ./mysql_binary_log.135674 --result-file=135674.sql
```
- **`mysqlbinlog`**:这是 MySQL 提供的一个命令行工具,用于读取和显示 MySQL 二进制日志文件的内容。

- **`--no-defaults`**:这个选项告诉工具不要使用任何默认的配置文件(如 `my.cnf``my.ini`)。这样可以确保命令的执行仅依赖于命令行中提供的参数,而不受任何配置文件的影响。

- **`--base64-output=decode-rows`**:这个选项指定解码二进制日志中的基于 base64 编码的行事件。当二进制日志中的行数据被修改时,会进行 base64 编码,因此解码后可以使输出更具可读性。

- **`-v`**:这个选项是 `verbose`(详细模式)的缩写,表示输出会更加详细。它会以可读的格式展示每个事件的内容,显示实际执行的 SQL 语句,而不仅仅是事件类型。

- **`./mysql_binary_log.135674`**:这是需要处理的 MySQL 二进制日志文件的路径。在此命令中,文件名为 `mysql_binary_log.135674`,该文件包含了 MySQL 数据库的所有更改日志。

- **`--result-file=135674.sql`**:这个选项指定处理后的结果输出到一个文件中。在本例中,解码后的 SQL 语句和数据变更将保存到 `135674.sql` 文件中。

查看二进制日志文件和位置,从库配置需要使用 `File``Position`
```text
mysql> show master status \G
Expand Down

0 comments on commit 2abcc72

Please sign in to comment.