–1、表空间:表空间用于容纳关系表,他不归属于任何一个用户
CREATE TABLESPACE test_ts
LOGGING
DATAFILE ‘/u01/app/oradata/oradb/test_ts.dbf’
SIZE 20 M
AUTOEXTEND ON
NEXT 5 M MAXSIZE unlimited
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
–2.创建用户:并制定默认表空间
CREATE USER test IDENTIFIED BY PASSWORD
DEFAULT TABLESPACE test_ts
QUOTA UNLIMITED ON test_ts;
–3.赋权:根据业务需求和数据安全,给用户赋予权限
grant connect to test;
grant dba to test; --一定要慎重,一般用户不要给DBA权限,应用程序用户一定不要给。
grant resource to test;
grant create any index to test;
grant create any materialized view to test;
grant create any table to test;
grant create sequence to test;
grant create table to test;
grant drop any sequence to test;
grant query rewrite to test;
grant unlimited tablespace to test;
SELECT * FROM SYS.DBA_DATA_FILES