[Oracle]创建用户

(1)   创建表空间

create tablespace 空间名

datafile 'E:\文件名.dat'

size 1M

autoextend on

(2)   创建用户

-- 不用的

--create user 用户名 identified by 密码;

--grant connect,resource to 用户名;

--grant create any view to 用户名;

-- 如果用户存在则删除用户

--drop user 用户名 CASCADE;

-- 创建用户

create user 用户名

  identified by "用户名"

  default tablespace 用户名

  temporary tablespace TEMP

  profile DEFAULT;

-- Grant/Revoke role privileges

grant connect to 用户名;

grant dba to 用户名;

grant exp_full_database to 用户名;

grant imp_full_database to 用户名;

grant resource to 用户名;

-- Grant/Revoke system privileges

grant alter any table to 用户名;

grant analyze any to 用户名;

grant create any index to 用户名;

grant create any sequence to 用户名;

grant create any table to 用户名;

grant select any table to 用户名;

grant unlimited tablespace to 用户名;

如用从一个用户导入另一个用户,需要授予DBA权限:

GRANT DBA TO 用户名

原文地址:https://www.cnblogs.com/teacher/p/4066424.html