oracle中多用户可以用同一个表空间,也可以指定一个用户只用某一个表空间。创建用户必须为其指定表空间,如果没有指定则指向users表空间。创建用户后,可以在用户上,创建表、存储过程等等其他数据库对象;
表空间操作
- 创建表空间
create tablespace STUDY
datafile '/home/oracle/app/oracle/oradata/helowin/study.dbf'
size 10M
autoextend on
next 1M
maxsize 1024M;
-
表空间改名:
alter tablespace ts1 rename to tss1;
-
删除表空间:
drop tablespace ts2 including contents and datafiles;
用户相关操作
- 创建用户并指定表空间
CREATE USER study IDENTIFIED BY study DEFAULT TABLESPACE study;
- 赋予用户一般权限
grant connect,resource to study;
grant create any sequence to study;
grant create any table to study;
grant delete any table to study;
grant insert any table to study;
grant select any table to study