一开始是先发表在新浪博客的,因此有些图片都被屏蔽了
(一)表空间的相关基础知识

相关博客非常多,这里不过多的赘述,就简单说下几个默认的值
(1)是否记日志,默认是logging
(2)段的管理方式是auto:segment space management auto   (另一种方式是手动管理manual)
(3)区的管理方式是local: extent management local  (另一种方式是数据字典管理dictionary)
(4)默认都是smallfile tablespace

(二)创建永久和临时表空间

(1)创建永久表空间举例

关于表空间的操作:创建、修改、删除

create tablespace inventory datafile '/u01/app/oracle/oradata/orcl/disk4/inventory01.dbf' size 5m ;
注:上面列的默认值一般是可以不书写的。

修改一下任务:
再新建一个表空间inven2,在上面的基础上打开数据文件自动扩展,一次增加5M,最大限定1G,区分配extent allocation设置为固定长度一次2M:

create tablespace inven2 datafile '/u01/app/oracle/oradata/orcl/disk4/inventory02.dbf' size 5m AUTOEXTEND ON NEXT 5M MAXSIZE 1G UNIFORM SIZE 2M;

(2)创建一个bigfile tablespace
关于表空间的操作:创建、修改、删除
create bigfile tablespace BIGTBS datafile '/u01/app/oracle/oradata/orcl/disk4/bigtbs.dbf' size 5m;

(3)创建临时表空间组,并设置为默认临时表空间
要求:
1) temporary tablespace group named TEMP_GRP containing tablespace TEMP1 and TEMP2

2) make TEMP_GRP the default temporary tablespace for all new users


create temporary tablespace TEMP1 tempfile '/u01/app/oracle/oradata/orcl/disk4/temp1.dbf' size 200m tablespace group temp_grp;


create temporary tablespace TEMP2 tempfile '/u01/app/oracle/oradata/orcl/disk5/temp2.dbf' size 200m tablespace group temp_grp;


alter database default temporary tablespace temp_grp;


(三)修改表空间

(1)修改数据文件的大小

alter database datafile '/u01/app/oracle/oradata/orcl/disk4/incentory01.dbf' resize 50m;


(2)给表空间增加数据文件

alter tablespace inventory add datafile '/u01/app/oracle/oradata/orcl/inventory03.dbf’size 50m autoextend on next 10m maxsize unlimited.


(四)删除表空间

drop tablespace inventory including contents and datafiles;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30935525/viewspace-2035171/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30935525/viewspace-2035171/

相关文章: