oracle扩展表空间的三种方法

1.增加数据文件

alter tablespace tablespace_name add datafile 'd:\test\sp01.dbf' size 20m;

2.增加数据文件的大小

alter tablespace tablespace_name 'd:\test\sp01.dbf' resize 20m;

这里需要注意的是数据文件的大小不超过500m;

3.设置文件的自动增长

alter tablespace tablespace_name 'd:\sp01.dbf' autoextend on next 10m maxsize 500m;

4.查询某表空间下有哪些数据文件

select * from dba_data_files where tablespace_name='ARCHIVES';

5.删除某个数据文件

alter tablespace tablespace_name drop datafile 'd:\sp01.dbf';

6.移动数据文件

有时,如果你的数据文件所在的磁盘损坏时,该数据文件将不能在使用,为了能够重新使用,需要将这些文件的副本移动到其他的磁盘,然后恢复。 下面以移动数据文件sp01.dbf为例来说明: 1.确定数据文件所在的表空间

select tablespace_name from dba_data_files where fille_name='d:\sp01.dbf';

2.使表空间脱机 确保数据文件的一致性,将表空间转变为offline的状态。

alter tablespace sp01 offline;

3.使用命令移动数据文件到指定的目标位置

host move d:\sp01.dbf c:\sp01.dbf;

4.执行alter tablespace命令 在物理上移动了数据之后,还必须执行alter tablespace命令对数据库文件进行逻辑修改

alter tablespace sp01 rename datafile 'd:\sp01.dbf' to 'c:\sp01.dbf';

5.使表空间联机

alter tablespace sp01 online;

    原文作者:热恋Oracle
    原文地址: https://blog.csdn.net/luxiaopengpeng/article/details/50424148
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞