查看默认表空间
select default_tablespace,temporary_tablespace from dba_users where username='SYSTEM';
更改默认表空间
alter user system default
tablespace system;
创建表空间:
永久:create tablespace test1_tablespace datafile
‘test1file.dbf’ size 10m;
临时:create temporary tablespace temptest1_tablespace
tempfile ‘temptest1file.dbf’ size 10m;
查看表空间位置:
Select file_name
from dba_data_files where tablespace_name=’TEST1_TABLESPACE’;
Select file_name
from dba_temp_files where tablespace_name=’TEMPTEST1_TABLESPACE’;
更改表空间状态
Alter tablespace
tablespacename read only/read write/online/offline
查看表空间状态
Select status from
dba_tablespaces where tablespacename=’’;
表空间增加/删除数据文件
Alter tablespace test1_tablespace
add datafile ‘test2file.dbf’ size 10m;
Alter tablespace
test1_tablespace drop datafile ‘test2file.dbf’;
删除表空间
Drop tablespace tablespacename drop tablespace test including contents;