ORACLE创建用户,建表空间,授予权限
1.创建用户表空间
CREATE TABLESPACE my_ts
LOGGING
DATAFILE 'D:\app\win7\oradata\orcl\my_ts.dbf'
SIZE 10M
AUTOEXTEND ON
NEXT 2M MAXSIZE 1024M
EXTENT MANAGEMENT LOCAL;
2.创建临时表空间
CREATE TEMPORARY TABLESPACE my_ts_temp
TEMPFILE 'D:\app\win7\oradata\orcl\my_ts_temp.dbf'
SIZE 10M
AUTOEXTEND ON
NEXT 2M MAXSIZE 1024M
EXTENT MANAGEMENT LOCAL;
删除表空间:DROP TABLESPACE my_ts_temp;
如果表空间包含对象则使用DROP TABLESPACE my_ts_temp INCLUDING CONTENTS;
删除表空间并且删除物理文件:DROP TABLESPACE my_ts_temp INCLUDING CONTENTS AND DATAFILES;
3.创建用户并指定表空间
CREATE USER test IDENTIFIED BY test
DEFAULT TABLESPACE my_ts
TEMPORARY TABLESPACE my_ts_temp;
删除用户: DROP USER test CASCADE;
4.授予用户权限
GRANT CONNECT TO test;
GRANT RESOURCE TO test;
回收用户权限: REVOKE 权限名 FROM 用户名