| charset_name | The default character set for columns in the table. Valid values: <ul><li> `binary` </li><li> `utf8mb4` </li><li> `gbk` </li><li> `utf16` </li><li> `gb18030` </li></ul> |
| collation_name | The default collation for columns in the table. Valid values: <ul><li> `binary` </li><li> `gbk_bin` </li><li> `gbk_chinese_ci` </li><li> `utf8mb4_general_ci` </li><li> `utf8mb4__general_cs` </li><li> `utf8mb4_bin` </li><li> `utf8mb4_unicode_ci` </li><li> `utf16_general_ci` </li><li> `utf16_bin` </li><li> `utf16_unicode_ci` </li><li> `gb18030_chinese_ci` </li><li> `gb18030_bin` </li></ul> |
@@ -31,5 +31,4 @@ Set the character set to `gbk` and the collation to `gbk_bin` for the client, co
| FOR user | If the `FOR user` clause is absent, this statement changes the password of the current user. Any logged-on user can change their password. If the `FOR user` clause is present, this statement changes the password of the specified user. To change the password of the specified user, you must have the global `CREATE USER` privilege (MySQL mode). |
| Parameter | Description |
|----------|-----------------------------|
| FOR user | If the `FOR user` clause is not specified, it means changing the password of the current user. Any successfully logged-in user can change the password of the current user. If the `FOR user` clause is specified, it means changing the password of the specified user. To change the password of the specified user, you must have the `CREATE USER` privilege on the global (MySQL) database. |
|password_option | The password option. You can use `PASSWORD('authstring')` to specify a plaintext password, which will be automatically encoded by the system; or you can directly use `'hashstring'` to specify an encrypted hash string.|
## Examples
* Change the password of the current user.
```sql
obclient> SET PASSWORD = PASSWORD('**1***');
Query OK, 0 rows affected
```
```sql
obclient> SET PASSWORD = PASSWORD('**1***');
```
* Change the password of user `sqluser01`.
* Change the password of the `sqluser01` user.
```sql
obclient> SET PASSWORD FOR sqluser01 = PASSWORD('**2***');
Query OK, 0 rows affected
```
```sql
obclient> SET PASSWORD FOR sqluser01 = PASSWORD('**2***');
| GLOBAL \| SESSION \| LOCAL | The effective scope of the transaction isolation level. This parameter is unspecified by default. <ul><li> `GLOBAL`: indicates that the transaction isolation level applies to all subsequent sessions, without affecting the current session. </li><li> `SESSION | LOCAL`: indicates that the transaction isolation level applies to all transactions subsequently executed in the current session, without affecting the transaction in progress. If this statement is executed in an interval between transactions, it overrides any previous statement that sets the next-transaction value of the named characteristics. </li><li> Unspecified: indicates that the transaction isolation level applies to the next single transaction executed in the session. Subsequent transactions continue to use the session value of the named characteristics. </li></ul> |
| READ ONLY \| READ WRITE | The read/write mode of the transaction. |
| READ UNCOMMITED | Specifies that the transaction isolation level is read uncommitted. <br> **Note** The current version does not support the read uncommitted isolation level. |
| READ COMMITED | Specifies that the transaction isolation level is read committed. |
| REPEATABLE READ | Specifies that the transaction isolation level is repeatable read. |
| READ ONLY \| READ WRITE | The read/write mode of the transaction. |
| READ UNCOMMITTED | Specifies that the transaction isolation level is read uncommitted. <br> **Note** The current version does not support the read uncommitted isolation level. |
| READ COMMITTED | Specifies that the transaction isolation level is read committed. |
| REPEATABLE READ | Specifies that the transaction isolation level is repeatable read. |
| SERIALIZABLE | Specifies that the transaction isolation level is serializable. <br>**Note** OceanBase Database does not support the serializable isolation level for the <code>sys</code> tenant because GTS cannot be enabled for the sys tenant. |
You can use this statement to start a transaction.
This statement is used to start a transaction.
A database transaction is a series of operations performed as a logical unit of work. A transaction can be used to maintain the integrity of the database by ensuring that SQL operations in a batch are either all executed or none of them are executed.
A database transaction is a series of operations executed as a single logical unit. Transaction processing is used to maintain database integrity and ensure that all SQL operations in a batch are either executed or not executed.
Explicit transactions are user-defined or user-specified transactions. You can explicitly start a transaction by using the `BEGIN` or `BEGIN WORK` statement (which is an alias of `START TRANSACTION`) and explicitly end the transaction by using the `COMMIT` or `ROLLBACK` statement.
Explicit transactions are user-defined or user-specified transactions. They are explicitly started using the `BEGIN` or `BEGIN WORK` statement (which is an alias for `START TRANSACTION`) and explicitly ended using the `COMMIT` or `ROLLBACK` statement.
| START TRANSACTION \[READ ONLY \| READ WRITE\] | Starts a transaction. After a transaction is started, the subsequent SQL data operation statements (such as `INSERT`, `UPDATE`, and `DELETE`) do not take effect until it is explicitly committed. `READ ONLY` indicates that the transaction is started in read-only mode and modifications to the transaction are not allowed. `READ WRITE` indicates that the transaction is started in read and write mode, which is the default mode. |
| BEGIN | `BEGIN` and `BEGIN WORK` are used as the alias of `START TRANSACTION`. |
| COMMIT | Commits the current transaction. |
| ROLLBACK | Rolls back the current transaction. |
| SET TRANSACTION {READ ONLY \| READ WRITE} | Sets the current transaction to the `READ ONLY` or `READ WRITE` mode.|
| Parameter | Description |
|----------------|--------------|
| START TRANSACTION \[READ ONLY \| READ WRITE\] | Starts a transaction. Once a transaction is started, subsequent SQL data manipulation statements (such as `INSERT`, `UPDATE`, and `DELETE`) will only take effect until the transaction is explicitly committed. `READ ONLY` indicates that the transaction is started in read-only mode, and no modification operations can be executed within the transaction. `READ WRITE` indicates that the transaction is started in read-write mode, which is the default mode. |
| BEGIN | `BEGIN` and `BEGIN WORK` are aliases for `START TRANSACTION`. |
| COMMIT | Commits the current transaction. |
| ROLLBACK | Rolls back the current transaction. |
| SET TRANSACTION {READ ONLY \| READ WRITE} | Sets the current transaction to `READ ONLY` or `READ WRITE` mode.|
## Examples
* Assume that you have table `a` with the following data in your database.
Assume the `a` table is as follows:
| id | name | num | sell_date |
|----|------|-----|---------------------|
| 1 | a | 100 | 2013-06-21 10:06:43 |
| 2 | b | 200 | 2013-06-21 13:07:21 |
| 3 | a | 50 | 2013-06-21 13:08:15 |
```sql
| id | name | num | sell_date |
|----|------|-----|---------------------|
| 1 | a | 100 | 2013-06-21 10:06:43 |
| 2 | b | 200 | 2013-06-21 13:07:21 |
| 3 | a | 50 | 2013-06-21 13:08:15 |
```
1. Execute the following statements in sequence to start the transaction, change the `name` value of the record whose `id` is `3` to `c`, and insert a row for the record of selling `a`.
1. Execute the following commands to start a transaction, change the `name` of the record with `id` `3` to `c`, and insert a new record for the current sale of `a`.
```sql
obclient> START TRANSACTION;
Query OK, 0 rows affected
obclient> UPDATE a SET name = 'c' WHERE id = 3;
Query OK, 1 rows affected
obclient> INSERT INTO a VALUES (4, 'a', 30, '2013-06-21 16:09:13');
Query OK, 1 rows affected
obclient> COMMIT;
Query OK, 0 rows affected
```
2. Commit the transaction and execute the following statement to query the information of table `a`.
2. After the transaction is committed, execute the following command to view the information of the `a` table.
```sql
SELECT * FROM a;
obclient> SELECT * FROM a;
```
The result is as follows:
| id | name | num | sell_date |
```sql
| id | name | num | sell_date |
|----|------|-----|---------------------|
| 1 | a | 100 | 2013-06-21 10:06:43 |
| 2 | b | 200 | 2013-06-21 13:07:21 |
| 3 | c | 50 | 2013-06-21 13:08:15 |
| 4 | a | 30 | 2013-06-21 16:09:13 |
| 1 | a | 100 | 2013-06-21 10:06:43 |
| 2 | b | 200 | 2013-06-21 13:07:21 |
| 3 | c | 50 | 2013-06-21 13:08:15 |
| 4 | a | 30 | 2013-06-21 16:09:13 |
```
<main id="notice" type='notice'>
<h4>Notice</h4>
<ul>
<li>Before a transaction is committed, you can view whether the operation in the transaction has taken effect. For example, you can execute the <code>SELECT * FROM a</code> statement before you commit a transaction. </li>
<li>You can access the sessions of the current transaction to obtain the latest result. Access to sessions beyond the current transaction does not take effect. Before you <code>COMMIT</code> the transaction, your operations are visible only to the current transaction session. </li>
<li>To roll back a transaction, replace <code>COMMIT</code> with <code>ROLLBACK</code>. </li>
<li>Before the transaction is <code>COMMIT</code>, you can check whether the operations in the transaction have taken effect. For example, you can execute the SQL statement <code>SELECT * FROM a;</code> before <code>COMMIT</code>.</li>
<li>Within the transaction session, the latest results can be read, but outside the transaction session, the results are not effective. Before the transaction is <code>COMMIT</code>, the operations performed are only visible within the current transaction session.</li>
<li>To roll back the transaction, use <code>ROLLBACK</code> instead of <code>COMMIT</code>.</li>
You can use this statement to return a set of one or more rows as a table.
This statement is used to return a set of single or multiple rows of data as a table.
The `VALUES` statement is a table value constructor, which can be used independently or together with `UNION`, `EXCEPT`, `INTERSECT`, and so on.
`VALUES` is a table-valued constructor and can also be used as a standalone SQL statement in conjunction with `UNION`, `EXCEPT`, and `INTERSECT`.
## Syntax
@@ -31,74 +31,81 @@ column_designator:
## Parameters
| Parameter | Description |
| Parameter | Description |
|---------------|-----------|
| row_constructor_list | The list of row constructors, each of which has a `ROW()` clause, separated by commas(,). `ROW()` cannot be empty, but each of its scalar value enclosed in parentheses can be `NULL`. |
| value_list | A list of one or more scalar values. A scalar value can be a literal, or an expression that resolves to a scalar value. Each `ROW()` in the same `VALUES` statement must have the same number of values in `value_list`. |
| column_designator | The column designated for sorting rows. Columns are implicitly named as `column_0`, `column_1`, and so forth. You can use the optional `ORDER BY` clause to sort rows by the designated column. |
|row_constructor_list| A list of row constructors, composed of `ROW()` clauses, separated by commas. `ROW()` cannot be empty, but each scalar value within the parentheses can be `NULL`.|
|value_list| A list of one or more scalar values. Scalar values can be literals or expressions that resolve to scalar values. Each `ROW()` in the same `VALUES` statement must contain the same number of values in the `value_list`.|
|column_designator| Specifies the column, named as `column_0`, `column_1`, etc. Use the optional `ORDER BY` clause to sort the rows by this specified column.|
## Examples
* Use `VALUES` to generate a table where rows are sorted by the `column_0` column.
```shell
obclient> VALUES ROW(4,6,8), ROW(5,7,9), ROW(1,-2,3) ORDER BY column_0;
```
The output of the example is as follows:
```shell
+----------+----------+----------+----------+
| column_0 | column_1 | column_2 |
+----------+----------+----------+----------+
| 1 | -2 | 3 |
| 4 | 6 | 8 |
| 5 | 7 | 9 |
+----------+----------+----------+----------+
3 rows in set
```
* Use `VALUES` to generate a table where a column contains data of mixed types.
<td>配置 OceanBase 数据库中的 Zone 名称,可自定义。Zone 名称需以英文字母开头,英文或数字结尾,可包含英文、数字和下划线,且长度在 2~32 个字符之间。部署多 Zone 的 OceanBase 集群必须有一个 Zone 与主 Zone 的 Region 相同。可单击 <b>+ 新增 Zone</b> 或对应 Zone 后的删除图标新增或删除 Zone。</td>
</tr>
<tr>
<td>OBServer 节点</td>
<td>配置 OceanBase 集群中的 OBServer 节点 IP,输入 IP 后单击键盘 Enter 可配置多个节点 IP。<main id="notice" type='notice'><h4>注意</h4><ul><li>禁止为不同的 Zone 输入相同的节点。</li><li><p>当 OBServer 节点配置为 <code>127.0.0.1</code> 时,此 OceanBase 集群不支持扩展为分布式集群和配置主备租户。</p></li></ul></main></td>
</tr>
<tr>
<td>RootServer 节点</td>
<td>可通过下拉框在 <b>OBServer 节点</b> 配置的 IP 中选择一个 IP 作为 OceanBase 集群的 RootServer 节点。对于多副本的 OceanBase 集群,其每个 Zone 都需指定一个 RootServer。</td>
</tr>
<tr>
<td rowspan="6">组件节点配置</td>
<td>OBProxy 节点</td>
<td>支持配置多个节点,既可通过下拉框选择 OBServer 节点 IP,也可输入新的节点 IP,建议使用非 <code>127.0.0.1</code> IP 地址。输入 IP 后单击键盘 Enter 即可配置多个节点 IP。</td>
<td>配置 OceanBase 数据库中的 Zone 名称,可自定义。Zone 名称需以英文字母开头,英文或数字结尾,可包含英文、数字和下划线,且长度在 2~32 个字符之间。部署多 Zone 的 OceanBase 集群必须有一个 Zone 与主 Zone 的 Region 相同。可单击 <b>+ 新增 Zone</b> 或对应 Zone 后的删除图标新增或删除 Zone。</td>
</tr>
<tr>
<td>OBServer 节点</td>
<td>配置 OceanBase 集群中的 OBServer 节点 IP,输入 IP 后单击键盘 Enter 可配置多个节点 IP。<main id="notice" type='notice'><h4>注意</h4><ul><li>禁止为不同的 Zone 输入相同的节点。</li><li><p>当 OBServer 节点配置为 <code>127.0.0.1</code> 时,此 OceanBase 集群不支持扩展为分布式集群和配置主备租户。</p></li></ul></main></td>
</tr>
<tr>
<td>RootServer 节点</td>
<td>可通过下拉框在 <b>OBServer 节点</b> 配置的 IP 中选择一个 IP 作为 OceanBase 集群的 RootServer 节点。对于多副本的 OceanBase 集群,其每个 Zone 都需指定一个 RootServer。</td>
</tr>
<tr>
<td rowspan="6">组件节点配置</td>
<td>OBProxy 节点</td>
<td>支持配置多个节点,既可通过下拉框选择 OBServer 节点 IP,也可输入新的节点 IP,建议使用非 <code>127.0.0.1</code> IP 地址。输入 IP 后单击键盘 Enter 即可配置多个节点 IP。</td>
* 支持 V4.3.0 Beta 及之后 BP 版本、V4.3.1 Beta 及之后 BP 版本、V4.3.2 Beta Hotfix1 及之后 BP 版本、V4.3.3 GA 及之后 GA 版本、V4.3.4 GA 及之后 GA 版本(SN 模式),V4.3.5 GA 及之后 GA 版本(SN 模式),原地升级到 V4.4.0(SN 模式)。
* 不支持 V4.3.5 GA 及之后 GA 版本(SS 模式),平滑升级到 V4.4.0(SS 模式)。
| dfs.ha.automatic-failover.enabled.${nameservice id}=true | 表示启用自动故障转移,即让 HA 集群获取相关请求之后,自动获取可用 namenode 进行响应服务。|
| dfs.client.failover.proxy.provider.${nameservice id}=org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider | 指示 HA 集群进行主备切换的逻辑工具类,也可自定义打包上传 HA 集群自己需要的逻辑等。|
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.