Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.36 KB

oracle12c用户相关操作.md

File metadata and controls

45 lines (35 loc) · 1.36 KB

本文所有内容仅针对oracle 12c版本


创建用户zhangying并且设定密码为123456

create user zhangying identified by 123456;


授权所有权限给用户zhangying

grant create session, resource,create any table, create any view ,create any index, create any procedure, alter any table, alter any procedure,create sequence, drop any table, drop any view, drop any index, drop any procedure, select any table, insert any table, update any table, delete any table to zhangying;


创建临时表空间和数据表空间,并更改用户的表空间

-- 创建临时空间
create temporary tablespace pdbadmin_temp
tempfile 'F:\oracle\oradata\orcl\pdbadmin_temp01.dbf'
size 32m autoextend on next 32m MAXSIZE unlimited
extent management local;

-- 创建数据表空间
create tablespace pdbadmin_data
logging datafile 'F:\oracle\oradata\orcl\pdbadmin_data01.dbf' size 10240m autoextend on next 100m MAXSIZE unlimited
extent management local;

-- 更改用户默认表空间
alter user zhangying default tablespace pdbadmin_data temporary tablespace pdbadmin_temp;
//alter user zhangying quota unlimited on users;--这条语句可能有问题
grant unlimited tablespace to zhangying;


删除用户所有数据,但不包含表空间

drop user zhangying CASCADE;