mirror of https://github.com/dunwu/db-tutorial.git
格式化 markdown 文档
parent
32b7dca45a
commit
efddcade4c
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
(2)对于大多数项目而言,最简单的持续集成场景如下所示:
|
(2)对于大多数项目而言,最简单的持续集成场景如下所示:
|
||||||
|
|
||||||
![flyway-sample](https://flywaydb.org/assets/balsamiq/Environments.png)
|
<br><div align="center"><img src="https://flywaydb.org/assets/balsamiq/Environments.png"/></div><br>
|
||||||
|
|
||||||
这意味着,我们不仅仅要处理一份环境中的修改,由此会引入一些版本冲突问题:
|
这意味着,我们不仅仅要处理一份环境中的修改,由此会引入一些版本冲突问题:
|
||||||
|
|
||||||
|
@ -68,13 +68,13 @@
|
||||||
|
|
||||||
最简单的场景是指定 Flyway 迁移到一个空的数据库。
|
最简单的场景是指定 Flyway 迁移到一个空的数据库。
|
||||||
|
|
||||||
![image](http://upload-images.jianshu.io/upload_images/3101171-bb6e9f39e56ebbda.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-bb6e9f39e56ebbda.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
Flyway 会尝试查找它的 schema 历史表,如果数据库是空的,Flyway 就不再查找,而是直接创建数据库。
|
Flyway 会尝试查找它的 schema 历史表,如果数据库是空的,Flyway 就不再查找,而是直接创建数据库。
|
||||||
|
|
||||||
现再你就有了一个仅包含一张空表的数据库,默认情况下,这张表叫 _flyway_schema_history_。
|
现再你就有了一个仅包含一张空表的数据库,默认情况下,这张表叫 _flyway_schema_history_。
|
||||||
|
|
||||||
![image](http://upload-images.jianshu.io/upload_images/3101171-410eb31c6313b389.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-410eb31c6313b389.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
这张表将被用于追踪数据库的状态。
|
这张表将被用于追踪数据库的状态。
|
||||||
|
|
||||||
|
@ -82,17 +82,17 @@ Flyway 会尝试查找它的 schema 历史表,如果数据库是空的,Flywa
|
||||||
|
|
||||||
这些 **migrations** 将根据他们的版本号进行排序。
|
这些 **migrations** 将根据他们的版本号进行排序。
|
||||||
|
|
||||||
![image](http://upload-images.jianshu.io/upload_images/3101171-d36ee07ada4efbcd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-d36ee07ada4efbcd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
任意 migration 应用后,schema 历史表将更新。当元数据和初始状态替换后,可以称之为:迁移到新版本。
|
任意 migration 应用后,schema 历史表将更新。当元数据和初始状态替换后,可以称之为:迁移到新版本。
|
||||||
|
|
||||||
Flyway 一旦扫描了文件系统或应用 classpath 下的 migrations,这些 migrations 会检查 schema 历史表。如果它们的版本号低于或等于当前的版本,将被忽略。保留下来的 migrations 是等待的 migrations,有效但没有应用。
|
Flyway 一旦扫描了文件系统或应用 classpath 下的 migrations,这些 migrations 会检查 schema 历史表。如果它们的版本号低于或等于当前的版本,将被忽略。保留下来的 migrations 是等待的 migrations,有效但没有应用。
|
||||||
|
|
||||||
![image](http://upload-images.jianshu.io/upload_images/3101171-99a88fea7a31a070.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-99a88fea7a31a070.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
migrations 将根据版本号排序并按序执行。
|
migrations 将根据版本号排序并按序执行。
|
||||||
|
|
||||||
![image](http://upload-images.jianshu.io/upload_images/3101171-b444fef6e5c13b71.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-b444fef6e5c13b71.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
## 快速上手
|
## 快速上手
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ migrations 最常用的编写形式就是 SQL。
|
||||||
|
|
||||||
为了被 Flyway 自动识别,SQL migrations 的文件命名必须遵循规定的模式:
|
为了被 Flyway 自动识别,SQL migrations 的文件命名必须遵循规定的模式:
|
||||||
|
|
||||||
![sql-migrations](https://raw.githubusercontent.com/dunwu/Database/master/images/flyway/sql-migrations.png)
|
<br><div align="center"><img src="https://raw.githubusercontent.com/dunwu/Database/master/images/flyway/sql-migrations.png"/></div><br>
|
||||||
|
|
||||||
- **Prefix** - `V` 代表 versioned migrations (可配置), `U` 代表 undo migrations (可配置)、 `R` 代表 repeatable migrations (可配置)
|
- **Prefix** - `V` 代表 versioned migrations (可配置), `U` 代表 undo migrations (可配置)、 `R` 代表 repeatable migrations (可配置)
|
||||||
- **Version** - 版本号通过`.`(点)或`_`(下划线)分隔 (repeatable migrations 不需要)
|
- **Version** - 版本号通过`.`(点)或`_`(下划线)分隔 (repeatable migrations 不需要)
|
||||||
|
@ -424,7 +424,7 @@ migrations 最常用的编写形式就是 SQL。
|
||||||
|
|
||||||
为了被 Flyway 自动识别,JAVA migrations 的文件命名必须遵循规定的模式:
|
为了被 Flyway 自动识别,JAVA migrations 的文件命名必须遵循规定的模式:
|
||||||
|
|
||||||
![java-migrations](https://raw.githubusercontent.com/dunwu/Database/master/images/flyway/java-migrations.png)
|
<br><div align="center"><img src="https://raw.githubusercontent.com/dunwu/Database/master/images/flyway/java-migrations.png"/></div><br>
|
||||||
|
|
||||||
- **Prefix** - `V` 代表 versioned migrations (可配置), `U` 代表 undo migrations (可配置)、 `R` 代表 repeatable migrations (可配置)
|
- **Prefix** - `V` 代表 versioned migrations (可配置), `U` 代表 undo migrations (可配置)、 `R` 代表 repeatable migrations (可配置)
|
||||||
- **Version** - 版本号通过`.`(点)或`_`(下划线)分隔 (repeatable migrations 不需要)
|
- **Version** - 版本号通过`.`(点)或`_`(下划线)分隔 (repeatable migrations 不需要)
|
||||||
|
@ -447,13 +447,13 @@ Callbacks 可以用 SQL 或 JAVA 来实现。
|
||||||
|
|
||||||
SQL Callbacks 的命名规则为:event 名 + SQL migration。
|
SQL Callbacks 的命名规则为:event 名 + SQL migration。
|
||||||
|
|
||||||
如: `beforeMigrate.sql`, `beforeEachMigrate.sql`, `afterEachMigrate.sql` 等。
|
如: `beforeMigrate.sql`, `beforeEachMigrate.sql`, `afterEachMigrate.sql` 等。
|
||||||
|
|
||||||
SQL Callbacks 也可以包含描述(description)。这种情况下,SQL Callbacks 文件名 = event 名 + 分隔符 + 描述 + 后缀。例:`beforeRepair__vacuum.sql`
|
SQL Callbacks 也可以包含描述(description)。这种情况下,SQL Callbacks 文件名 = event 名 + 分隔符 + 描述 + 后缀。例:`beforeRepair__vacuum.sql`
|
||||||
|
|
||||||
当同一个 event 有多个 SQL callbacks,将按照它们描述(description)的顺序执行。
|
当同一个 event 有多个 SQL callbacks,将按照它们描述(description)的顺序执行。
|
||||||
|
|
||||||
> **注:** Flyway 也支持你配置的 `sqlMigrationSuffixes`。
|
> **注:** Flyway 也支持你配置的 `sqlMigrationSuffixes`。
|
||||||
|
|
||||||
##### JAVA Callbacks
|
##### JAVA Callbacks
|
||||||
|
|
||||||
|
|
102
docs/h2.md
102
docs/h2.md
|
@ -36,11 +36,11 @@ H2 允许用户通过浏览器接口方式访问 SQL 数据库。
|
||||||
2. 启动方式:在 bin 目录下,双击 jar 包;执行 `java -jar h2*.jar`;执行脚本:`h2.bat` 或 `h2.sh`。
|
2. 启动方式:在 bin 目录下,双击 jar 包;执行 `java -jar h2*.jar`;执行脚本:`h2.bat` 或 `h2.sh`。
|
||||||
3. 在浏览器中访问:http://localhost:8082,应该可以看到下图中的页面:
|
3. 在浏览器中访问:http://localhost:8082,应该可以看到下图中的页面:
|
||||||
|
|
||||||
![h2-console](https://raw.githubusercontent.com/dunwu/Database/master/images/h2/h2-console.png)
|
<br><div align="center"><img src="https://raw.githubusercontent.com/dunwu/Database/master/images/h2/h2-console.png"/></div><br>
|
||||||
|
|
||||||
点击 **Connect** ,可以进入操作界面:
|
点击 **Connect** ,可以进入操作界面:
|
||||||
|
|
||||||
![h2-console](https://raw.githubusercontent.com/dunwu/Database/master/images/h2/h2-console-02.png)
|
<br><div align="center"><img src="https://raw.githubusercontent.com/dunwu/Database/master/images/h2/h2-console-02.png"/></div><br>
|
||||||
|
|
||||||
操作界面十分简单,不一一细说。
|
操作界面十分简单,不一一细说。
|
||||||
|
|
||||||
|
@ -105,9 +105,9 @@ Datasource class: `org.h2.jdbcx.JdbcDataSource`
|
||||||
|
|
||||||
数据库持久化存储为单个文件。
|
数据库持久化存储为单个文件。
|
||||||
|
|
||||||
连接字符串:`~/.h2/DBName` 表示数据库文件的存储位置,如果第一次连接则会自动创建数据库。
|
连接字符串:`\~/.h2/DBName` 表示数据库文件的存储位置,如果第一次连接则会自动创建数据库。
|
||||||
|
|
||||||
- `jdbc:h2:~/test` - 'test' 在用户根目录下
|
- `jdbc:h2:\~/test` - 'test' 在用户根目录下
|
||||||
- `jdbc:h2:/data/test` - 'test' 在 /data 目录下
|
- `jdbc:h2:/data/test` - 'test' 在 /data 目录下
|
||||||
- `jdbc:h2:test` - 'test' 在当前工作目录
|
- `jdbc:h2:test` - 'test' 在当前工作目录
|
||||||
|
|
||||||
|
@ -119,8 +119,8 @@ Datasource class: `org.h2.jdbcx.JdbcDataSource`
|
||||||
|
|
||||||
如果不指定 DBName,则以私有方式启动,只允许一个连接。
|
如果不指定 DBName,则以私有方式启动,只允许一个连接。
|
||||||
|
|
||||||
- `jdbc:h2:mem:test` - 一个进程中有多个连接
|
- `jdbc:h2:mem:test` - 一个进程中有多个连接
|
||||||
- `jdbc:h2:mem:` - 未命名的私有库,一个连接
|
- `jdbc:h2:mem:` - 未命名的私有库,一个连接
|
||||||
|
|
||||||
#### 服务模式
|
#### 服务模式
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ H2 支持三种服务模式:
|
||||||
|
|
||||||
启动 tcp 服务连接字符串示例:
|
启动 tcp 服务连接字符串示例:
|
||||||
|
|
||||||
- `jdbc:h2:tcp://localhost/~/test` - 用户根目录
|
- `jdbc:h2:tcp://localhost/\~/test` - 用户根目录
|
||||||
- `jdbc:h2:tcp://localhost//data/test` - 绝对路径
|
- `jdbc:h2:tcp://localhost//data/test` - 绝对路径
|
||||||
|
|
||||||
#### 启动服务
|
#### 启动服务
|
||||||
|
@ -155,8 +155,8 @@ java -cp h2*.jar org.h2.tools.Server -?
|
||||||
|
|
||||||
#### 设置
|
#### 设置
|
||||||
|
|
||||||
- `jdbc:h2:..;MODE=MySQL` 兼容模式(或 HSQLDB 等)
|
- `jdbc:h2:..;MODE=MySQL` 兼容模式(或 HSQLDB 等)
|
||||||
- `jdbc:h2:..;TRACE_LEVEL_FILE=3` 记录到 `*.trace.db`
|
- `jdbc:h2:..;TRACE_LEVEL_FILE=3` 记录到 `*.trace.db`
|
||||||
|
|
||||||
#### 连接字符串参数
|
#### 连接字符串参数
|
||||||
|
|
||||||
|
@ -272,184 +272,184 @@ java -jar h2-1.3.168.jar -web -webPort 8090 -browser
|
||||||
|
|
||||||
### SELECT
|
### SELECT
|
||||||
|
|
||||||
![SELECT](http://upload-images.jianshu.io/upload_images/3101171-a3f90c0d1f1f3437.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-a3f90c0d1f1f3437.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### INSERT
|
### INSERT
|
||||||
|
|
||||||
![INSERT](http://upload-images.jianshu.io/upload_images/3101171-6a92ae4362c3468a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-6a92ae4362c3468a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### UPDATE
|
### UPDATE
|
||||||
|
|
||||||
![UPDATE](http://upload-images.jianshu.io/upload_images/3101171-dddf0e26995d46c3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-dddf0e26995d46c3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### DELETE
|
### DELETE
|
||||||
|
|
||||||
![DELETE](http://upload-images.jianshu.io/upload_images/3101171-96e72023445a6fd6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-96e72023445a6fd6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### BACKUP
|
### BACKUP
|
||||||
|
|
||||||
![BACKUP](http://upload-images.jianshu.io/upload_images/3101171-6267894d24fab47f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-6267894d24fab47f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### EXPLAIN
|
### EXPLAIN
|
||||||
|
|
||||||
![EXPLAIN](http://upload-images.jianshu.io/upload_images/3101171-bbed6bb69f998b7a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-bbed6bb69f998b7a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
7、MERGE
|
7、MERGE
|
||||||
![](http://upload-images.jianshu.io/upload_images/3101171-bd021648431d12a7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-bd021648431d12a7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### RUNSCRIPT
|
### RUNSCRIPT
|
||||||
|
|
||||||
运行 sql 脚本文件
|
运行 sql 脚本文件
|
||||||
|
|
||||||
![RUNSCRIPT](http://upload-images.jianshu.io/upload_images/3101171-d6fe03eff0037e14.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-d6fe03eff0037e14.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### SCRIPT
|
### SCRIPT
|
||||||
|
|
||||||
根据数据库创建 sql 脚本
|
根据数据库创建 sql 脚本
|
||||||
|
|
||||||
![SCRIPT](http://upload-images.jianshu.io/upload_images/3101171-9ba7547ab8bcaeab.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-9ba7547ab8bcaeab.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### SHOW
|
### SHOW
|
||||||
|
|
||||||
![SHOW](http://upload-images.jianshu.io/upload_images/3101171-67449c6cc5cbb8c1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-67449c6cc5cbb8c1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### ALTER
|
### ALTER
|
||||||
|
|
||||||
#### ALTER INDEX RENAME
|
#### ALTER INDEX RENAME
|
||||||
|
|
||||||
![ALTER INDEX RENAME](http://upload-images.jianshu.io/upload_images/3101171-230bd3f97e185d2f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-230bd3f97e185d2f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
#### ALTER SCHEMA RENAME
|
#### ALTER SCHEMA RENAME
|
||||||
|
|
||||||
![ALTER SCHEMA RENAME](http://upload-images.jianshu.io/upload_images/3101171-797a028938e46ba3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-797a028938e46ba3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
#### ALTER SEQUENCE
|
#### ALTER SEQUENCE
|
||||||
|
|
||||||
![ALTER SEQUENCE](http://upload-images.jianshu.io/upload_images/3101171-46f343da1b6c6a29.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-46f343da1b6c6a29.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
#### ALTER TABLE
|
#### ALTER TABLE
|
||||||
|
|
||||||
![ALTER TABLE](http://upload-images.jianshu.io/upload_images/3101171-7e146a4010f2f357.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-7e146a4010f2f357.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
##### 增加约束
|
##### 增加约束
|
||||||
|
|
||||||
![增加约束](http://upload-images.jianshu.io/upload_images/3101171-4e5605a9c87a79cb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-4e5605a9c87a79cb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
##### 修改列
|
##### 修改列
|
||||||
|
|
||||||
![修改列](http://upload-images.jianshu.io/upload_images/3101171-fbc1358c553e6614.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-fbc1358c553e6614.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
##### 删除列
|
##### 删除列
|
||||||
|
|
||||||
![删除列](http://upload-images.jianshu.io/upload_images/3101171-dc3b897413700981.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-dc3b897413700981.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
##### 删除序列
|
##### 删除序列
|
||||||
|
|
||||||
![删除序列](http://upload-images.jianshu.io/upload_images/3101171-ec83899cb8724966.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-ec83899cb8724966.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
#### ALTER USER
|
#### ALTER USER
|
||||||
|
|
||||||
##### 修改用户名
|
##### 修改用户名
|
||||||
|
|
||||||
![修改用户名](http://upload-images.jianshu.io/upload_images/3101171-a1e429c0d8ece66c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-a1e429c0d8ece66c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
##### 修改用户密码
|
##### 修改用户密码
|
||||||
|
|
||||||
![修改用户密码](http://upload-images.jianshu.io/upload_images/3101171-5b86f98796606e54.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-5b86f98796606e54.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
#### ALTER VIEW
|
#### ALTER VIEW
|
||||||
|
|
||||||
![ALTER VIEW](http://upload-images.jianshu.io/upload_images/3101171-8832ecbc2db63a13.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-8832ecbc2db63a13.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### COMMENT
|
### COMMENT
|
||||||
|
|
||||||
![COMMENT](http://upload-images.jianshu.io/upload_images/3101171-467ce031883f0020.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-467ce031883f0020.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### CREATE CONSTANT
|
### CREATE CONSTANT
|
||||||
|
|
||||||
![CREATE CONSTANT](http://upload-images.jianshu.io/upload_images/3101171-1231c83563bfec9c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-1231c83563bfec9c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### CREATE INDEX
|
### CREATE INDEX
|
||||||
|
|
||||||
![CREATE INDEX](http://upload-images.jianshu.io/upload_images/3101171-d66d59bd7803d5c1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-d66d59bd7803d5c1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### CREATE ROLE
|
### CREATE ROLE
|
||||||
|
|
||||||
![CREATE ROLE](http://upload-images.jianshu.io/upload_images/3101171-7df1dee098e1127b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-7df1dee098e1127b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### CREATE SCHEMA
|
### CREATE SCHEMA
|
||||||
|
|
||||||
![CREATE SCHEMA](http://upload-images.jianshu.io/upload_images/3101171-c485123c62c0866e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-c485123c62c0866e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### CREATE SEQUENCE
|
### CREATE SEQUENCE
|
||||||
|
|
||||||
![CREATE SEQUENCE](http://upload-images.jianshu.io/upload_images/3101171-cc25860776d361ae.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-cc25860776d361ae.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### CREATE TABLE
|
### CREATE TABLE
|
||||||
|
|
||||||
![CREATE TABLE](http://upload-images.jianshu.io/upload_images/3101171-36ffc66327df8b5b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-36ffc66327df8b5b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### CREATE TRIGGER
|
### CREATE TRIGGER
|
||||||
|
|
||||||
![CREATE TRIGGER](http://upload-images.jianshu.io/upload_images/3101171-9a7bfa4425281213.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-9a7bfa4425281213.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### CREATE USER
|
### CREATE USER
|
||||||
|
|
||||||
![CREATE USER](http://upload-images.jianshu.io/upload_images/3101171-a1e45e308be6dac3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-a1e45e308be6dac3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### CREATE VIEW
|
### CREATE VIEW
|
||||||
|
|
||||||
![CREATE VIEW](http://upload-images.jianshu.io/upload_images/3101171-45c4cd516fd36611.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-45c4cd516fd36611.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### DROP
|
### DROP
|
||||||
|
|
||||||
![DROP](http://upload-images.jianshu.io/upload_images/3101171-52a3562d76411811.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-52a3562d76411811.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### GRANT RIGHT
|
### GRANT RIGHT
|
||||||
|
|
||||||
给 schema 授权授权
|
给 schema 授权授权
|
||||||
|
|
||||||
![授权](http://upload-images.jianshu.io/upload_images/3101171-750e96ceff00c4ee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-750e96ceff00c4ee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
给 schema 授权给 schema 授权
|
给 schema 授权给 schema 授权
|
||||||
|
|
||||||
![给schema授权](http://upload-images.jianshu.io/upload_images/3101171-22cfd65c2ff1eea5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-22cfd65c2ff1eea5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
#### 复制角色的权限
|
#### 复制角色的权限
|
||||||
|
|
||||||
![复制角色的权限](http://upload-images.jianshu.io/upload_images/3101171-6cba2f1585fd913b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-6cba2f1585fd913b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### REVOKE RIGHT
|
### REVOKE RIGHT
|
||||||
|
|
||||||
#### 移除授权
|
#### 移除授权
|
||||||
|
|
||||||
![移除授权](http://upload-images.jianshu.io/upload_images/3101171-3f905669cbb331b7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-3f905669cbb331b7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
#### 移除角色具有的权限
|
#### 移除角色具有的权限
|
||||||
|
|
||||||
![移除角色具有的权限](http://upload-images.jianshu.io/upload_images/3101171-af77f495222f1b30.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-af77f495222f1b30.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### ROLLBACK
|
### ROLLBACK
|
||||||
|
|
||||||
#### 从某个还原点(savepoint)回滚
|
#### 从某个还原点(savepoint)回滚
|
||||||
|
|
||||||
![](http://upload-images.jianshu.io/upload_images/3101171-c71a226ac4fff913.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-c71a226ac4fff913.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
#### 回滚事务
|
#### 回滚事务
|
||||||
|
|
||||||
![](http://upload-images.jianshu.io/upload_images/3101171-efb65c504c7d69c2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-efb65c504c7d69c2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
#### 创建 savepoint
|
#### 创建 savepoint
|
||||||
|
|
||||||
![](http://upload-images.jianshu.io/upload_images/3101171-feefdc236d4b211d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-feefdc236d4b211d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
## 数据类型
|
## 数据类型
|
||||||
|
|
||||||
![数据类型](http://upload-images.jianshu.io/upload_images/3101171-52296dd53249cdae.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-52296dd53249cdae.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
### INT Type
|
### INT Type
|
||||||
|
|
||||||
![INT Type](http://upload-images.jianshu.io/upload_images/3101171-fe62e3d07eb93d11.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
|
<br><div align="center"><img src="http://upload-images.jianshu.io/upload_images/3101171-fe62e3d07eb93d11.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"/></div><br>
|
||||||
|
|
||||||
## 集群
|
## 集群
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
>
|
>
|
||||||
> 关键词:Database, RDBM, psql
|
> 关键词:Database, RDBM, psql
|
||||||
|
|
||||||
![](http://oyz7npk35.bkt.clouddn.com/images/20180920181010182614.png)
|
<br><div align="center"><img src="http://oyz7npk35.bkt.clouddn.com/images/20180920181010182614.png"/></div><br>
|
||||||
|
|
||||||
<!-- TOC depthFrom:2 depthTo:3 -->
|
<!-- TOC depthFrom:2 depthTo:3 -->
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
官方下载页面要求用户选择相应版本,然后动态的给出安装提示,如下图所示:
|
官方下载页面要求用户选择相应版本,然后动态的给出安装提示,如下图所示:
|
||||||
|
|
||||||
![](http://oyz7npk35.bkt.clouddn.com/images/20180920181010174348.png)
|
<br><div align="center"><img src="http://oyz7npk35.bkt.clouddn.com/images/20180920181010174348.png"/></div><br>
|
||||||
|
|
||||||
前 3 步要求用户选择,后 4 步是根据选择动态提示的安装步骤
|
前 3 步要求用户选择,后 4 步是根据选择动态提示的安装步骤
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue