达梦数据库使用和常见问题

文章目录

达梦数据库使用和常见问题

一、SQL语法

1. 表空间
# 创建
"""
语法注释:
create tablespace 表空间名 datafile 数据文件存储路径 size 数据文件初始大小 autoextend on maxsize 数据文件大小最大限制
"""
create tablespace 表空间名 datafile '/home/dmdba/dmdbms/data/表空间名.dbf' size 1024; # 路径自定义,或者 表空间名1.dbf;大小单位为MB,1024MB即1G,102400即100G。

# 查询
select 表空间名 from dba_tablespaces;  # dba权限下
select 表空间名 from user_tablespaces;  # 普通权限

# 删除
drop tablespace 表空间名;


2. 用户
# 创建
"""
语法注释:
create user 用户名 identified by 密码 limit 密码策略 default tablespace 表空间名;
grant 权限类型 to 用户名;
"""
create user "TEST" identified by "TEST" limit failed_login_attemps 3, password_lock_time 1, password_grace_time 10 default tablespace 表空间名;
grant "RESOURCE", "PUBLIC" to "TEST";

# 删除
drop user "TEST" cascade;

3. 模式
# 创建
create schema 模式名 authorization 用户名;

猜你喜欢

转载自blog.csdn.net/Acegem/article/details/133667873
今日推荐