oracle创建删除用户和表空间

时间:2021-01-04 09:15:23

创建用户:
sqlplus /nolog
conn / as sysdba;
create user username identified by password
greant dba to username;

select * from user_sys_privs; 查看当前用户所有权限
select * from user_tab_prive; 查看当前用户对表的权限

1、创建
sys:系统管理员,最高权限
system:本地管理员,次高权限
scott:普通用户,默认密码tiger

2、登陆
sqlplus / as sysdba; 登陆sys账户
sqlplus sys as sysdba;

3、管理用户
alert user scott identified by tiger; 修改密码

4、创建表空间
create tablespace name datafile 'd:\a.dbf' size 100m autoextend on next 50m maxsize 2000m extent management local;

5、删除表空间
drop tablespace name including contents and datafiles

6、创建表空间内的用户
create user username identified by password default tablespace name;

grant connect,resource,dba to username;

7、授权用户使用表空间
alter user name quota unlimited on tablespacename;

8、删除用户
drop user  name cascade;