1、手工改变数据文件的大小
sql>conn / as sysdba
sql>createtablespace exampletb datafile ‘e:\ examp01.dbf’ size 10m ;
sql>alter database datafile ‘e:\examp01.dbf’ resize 20m;
sql>alter database datafile ‘e:\examp01.dbf’ resize 9m;
2、添加数据文件到表空间
sql> alter tablespace exampletb add datafile ‘e:\ examp02.dbf’ size 10m;
3、从表空间中删除数据文件
sql> alter tablespace exampletb drop datafile ‘e:\ examp02.dbf’;
4、将表空间设置为只读模式和读写模式
sql>createtable scott.student (id number(5), name varchar2(10)) tablespace exampletb;
sql>insertinto scott.student(id,name) values(1, ‘lucy’);
sql> alter tablespace exampletb read only;
sql>insertinto scott.student(id,name) values(2, ‘lily’);
sql>select* from scott.student;
sql> alter tablespace exampletb read write;
sql>insertinto scott.student(id,name) values(2, ‘lily’);
5、 将表空间设置为在线和离线
sql> alter tablespace exampletb offline;
sql>select* from scott.student;
sql> alter tablespace exampletb online;
sql>select* from scott.student;
6、查询表空间和数据文件
sql>select * from v$tablespace;
sql>select * from dba_tablespaces;
sql>select * from v$datafile;
sql> select * from dba_data_files;