通过长时间学习建立Oracle表空间,因而和你们分享一下,看完本文你确定有很多收获,但愿本文能教会你更多东西。oracle
一、先查询空闲空间app
- select tablespace_name,file_id,block_id,bytes,blocks from dba_free_space;
二、增长Oracle表空间ide
先查询数据文件名称、大小和路径的信息,语句以下:学习
- select tablespace_name,file_id,bytes,file_name from dba_data_files;
三、修改文件大小语句以下spa
- alter database datafile
- '须要增长的数据文件路径,即上面查询出来的路径
- 'resize 800M;
四、建立Oracle表空间orm
- create tablespace test
- datafile '/home/app/oracle/oradata/oracle8i/test01.dbf' size 8M
- autoextend on
- next 5M
- maxsize 10M;
- create tablespace sales
- datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize unlimited
- maxsize unlimited 是大小不受限制
- create tablespace sales
- datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize 1000M
- extent management local uniform;
- unform表示区的大小相同,默认为1M
- create tablespace sales
- datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize 1000M
- extent management local uniform size 500K;
- unform size 500K表示区的大小相同,为500K
- create tablespace sales
- datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize 1000M
- extent management local autoallocate;
- autoallocate表示区的大小由随表的大小自动动态改变,大表使用大区小表使用小区
- create tablespace sales
- datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize 1000M
- temporary;
- temporary建立字典管理临时表空间
- create temporary tablespace sales
- tempfile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize 1000M
- 建立本地管理临时表空间,若是是临时表空间,全部语句中的datafile都换为tempfile
- 8i系统默认建立字典管理临时表空间,要建立本地管理临时表空间要加temporary tablespace关键字
- 建立本地管理临时表空间时,不得使用atuoallocate参数,系统默认建立uniform管理方式
- 为表空间增长数据文件:
- alter tablespace sales add
- datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M
- autoextend on next 50M
- maxsize 1000M;
建立本地管理临时Oracle表空间,若是是临时表空间,全部语句中的datafile都换为tempfile8i系统默认建立字典管理临时表空间,要建立本地管理临时表空间要加temporary tablespace关键字建立本地管理临时表空间时,不得使用atuoallocate参数,系统默认建立uniform管理方式xml
为表空间增长数据文件:it
- alter tablespace sales add
- datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M
- autoextend on next 50M
- maxsize 1000M;
五、更改自动扩展属性:table
- alter database datafile
- '/home/app/oracle/oradata/oracle8i/sales01.dbf',
- '/home/app/oracle/oradata/oracle8i/sales02.dbf'
- '/home/app/oracle/oradata/oracle8i/sales01.dbf
- autoextend off;
以上介绍建立Oracle表空间,在这里拿出来和你们分享一下,但愿对你们有用。form