1--创建jim和tom用户。
2openGauss=# CREATE USER jim PASSWORD 'xxxxxxxxx';
3openGauss=# CREATE USER tom PASSWORD 'xxxxxxxxx';
4
5--创建一个GBK编码的数据库music(本地环境的编码格式必须也为GBK)。
6openGauss=# CREATE DATABASE music ENCODING 'GBK' template = template0;
7
8--创建数据库music2,并指定所有者为jim。
9openGauss=# CREATE DATABASE music2 OWNER jim;
10
11--用模板template0创建数据库music3,并指定所有者为jim。
12openGauss=# CREATE DATABASE music3 OWNER jim TEMPLATE template0;
13
14--设置music数据库的连接数为10。
15openGauss=# ALTER DATABASE music CONNECTION LIMIT= 10;
16
17--将music名称改为music4。
18openGauss=# ALTER DATABASE music RENAME TO music4;
19
20--将数据库music2的所属者改为tom。
21openGauss=# ALTER DATABASE music2 OWNER TO tom;
22
23--设置music3的表空间为PG_DEFAULT。
24openGauss=# ALTER DATABASE music3 SET TABLESPACE PG_DEFAULT;
25
26--关闭在数据库music3上缺省的索引扫描。
27openGauss=# ALTER DATABASE music3 SET enable_indexscan TO off;
28
29--重置enable_indexscan参数。
30openGauss=# ALTER DATABASE music3 RESET enable_indexscan;
31
32--删除数据库。
33openGauss=# DROP DATABASE music2;
34openGauss=# DROP DATABASE music3;
35openGauss=# DROP DATABASE music4;
36
37--删除jim和tom用户。
38openGauss=# DROP USER jim;
39openGauss=# DROP USER tom;
40
41--创建兼容TD格式的数据库。
42openGauss=# CREATE DATABASE td_compatible_db DBCOMPATIBILITY 'C';
43
44--创建兼容A格式的数据库。
45openGauss=# CREATE DATABASE ora_compatible_db DBCOMPATIBILITY 'A';
46
47--删除兼容TD、A格式的数据库。
48openGauss=# DROP DATABASE td_compatible_db;
49openGauss=# DROP DATABASE ora_compatible_db;