使用plsql创建表空间和用户

使用plsql创建oracle数据库的表空间和用户,并授权的语句。
1.创建表空间:
说明:datafile是指定创建位置,指向oracle数据库的默认位置;
autoextend 设置容量为自动增长,50M是自增的大小

create tablespace TEST

datafile 'E:/app/Administrator/oradata/orcl/TEST'

size 1M autoextend on next 50M maxsize unlimited;

2.创建新的用户:

说明:identified by后为用户登录密码;
default tablespace为默认表空间;
profile设为系统默认;
ACCOUNT UNLOCK解锁用户;

create user TEST

identified by "123"

default tablespace TEST

profile DEFAULT

ACCOUNT UNLOCK;

3.授限:
说明:分别给用户授dba权限和表空间授无限增长权限

grant dba to TEST;

grant unlimited tablespace to TEST;
原文地址:https://www.cnblogs.com/dullfish/p/6125431.html