表空间

查看默认表空间

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;
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容