Oracle创建表空间和临时表空间并指定给用户
1、创建表空间:
CREATE TABLESPACE DATA01 DATAFILE 'nnc_data01.dbf' SIZE 10000M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 512K;
CREATE TABLESPACE INDEX01 DATAFILE 'nnc_index01.dbf' SIZE 1000M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K;
2、创建临时表空间:
create temporary tablespace temp01
tempfile 'temp01.dbf'
size 1024m
autoextend on
next 50m maxsize 20480m
extent management local;
3、查看表空间信息:
select * from v$tablespace;
4、查看用户使用的表空间和临时表空间信息:
select username,default_tablespace,temporary_tablespace
from dba_users
where username = 'ncc';
5、指定表空间给用户:
alter user ncc default tablespace DATA01;
6、指定临时表空间给用户:
alter user ncc temporary tablespace temp01;