• permanent tablespace contains persistent schema objects. Objects in permanent tablespaces are stored in data files.

  • An undo tablespace is a type of permanent tablespace used by Oracle Database to manage undo data if you are running your database in automatic undo management mode. Oracle strongly recommends that you use automatic undo management mode rather than using rollback segments for undo.

  • temporary tablespace contains schema objects only for the duration of a session. Objects in temporary tablespaces are stored in temp files.

1、extent_management_clause

The extent_management_clause lets you specify how the extents of the tablespace will be managed.

Note:

After you have specified extent management with this clause, you can change extent management only by migrating the tablespace.

  • AUTOALLOCATE specifies that the tablespace is system managed. Users cannot specify an extent size. You cannot specify AUTOALLOCATE for a temporary tablespace.

  • UNIFORM specifies that the tablespace is managed with uniform extents of SIZE bytes.The default SIZE is 1 megabyte. All extents of temporary tablespaces are of uniform size, so this keyword is optional for a temporary tablespace. However, you must specify UNIFORM in order to specifySIZE. You cannot specify UNIFORM for an undo tablespace.

If you do not specify AUTOALLOCATE or UNIFORM, then the default is UNIFORM for temporary tablespaces and AUTOALLOCATE for all other types of tablespaces.

If you do not specify the extent_management_clause, then Oracle Database interprets the MINIMUM EXTENT clause and the DEFAULTstorage_clause to determine extent management.

The DICTIONARY keyword is deprecated. It is still supported for backward compatibility. However, Oracle recommends that you create locally managed tablespaces. Locally managed tablespaces are much more efficiently managed than dictionary-managed tablespaces. The creation of new dictionary-managed tablespaces is scheduled for desupport.

2、logging_clause

Specify the default logging attributes of all tables, indexes, materialized views, materialized view logs, and partitions within the tablespace. LOGGING is the default. This clause is not valid for a temporary or undo tablespace.

The tablespace-level logging attribute can be overridden by logging specifications at the table, index, materialized view, materialized view log, and partition levels.

See Also:

logging_clause for a full description of this clause

FORCE LOGGING

Use this clause to put the tablespace into FORCE LOGGING mode. Oracle Database will log all changes to all objects in the tablespace except changes to temporary segments, overriding any NOLOGGING setting for individual objects. The database must be open and in READ WRITE mode.

This setting does not exclude the NOLOGGING attribute. You can specify both FORCE LOGGING and NOLOGGING. In this case, NOLOGGING is the default logging mode for objects subsequently created in the tablespace, but the database ignores this default as long as the tablespace or the database is inFORCE LOGGING mode. If you subsequently take the tablespace out of FORCE LOGGING mode, then the NOLOGGING default is once again enforced.

Note:

FORCE LOGGING mode can have performance effects. You cannot specify FORCE LOGGING for an undo or temporary tablespace.

3、segment_management_clause

The segment_management_clause is relevant only for permanent, locally managed tablespaces. It lets you specify whether Oracle Database should track the used and free space in the segments in the tablespace using free lists or bitmaps. This clause is not valid for a temporary tablespace.

AUTO  Specify AUTO if you want the database to manage the free space of segments in the tablespace using a bitmap. If you specify AUTO, then the database ignores any specification for PCTUSEDFREELIST, and FREELIST GROUPS in subsequent storage specifications for objects in this tablespace. This setting is called automatic segment-space management and is the default.

MANUAL Specify MANUAL if you want the database to manage the free space of segments in the tablespace using free lists. Oracle strongly recommends that you do not use this setting and that you create tablespaces with automatic segment-space management.

To determine the segment management of an existing tablespace, query the SEGMENT_SPACE_MANAGEMENT column of the DBA_TABLESPACES orUSER_TABLESPACES data dictionary view.

Notes:

If you specify AUTO segment management, then:

  • If you set extent management to LOCAL UNIFORM, then you must ensure that each extent contains at least 5 database blocks.

  • If you set extent management to LOCAL AUTOALLOCATE, and if the database block size is 16K or greater, then Oracle manages segment space by creating extents with a minimum size of 5 blocks rounded up to 64K.

Restrictions on Automatic Segment-Space Management This clause is subject to the following restrictions:

  • You can specify this clause only for a permanent, locally managed tablespace.

  • You cannot specify this clause for the SYSTEM tablespace

=======================================================

extent--最小空间分配单位 --tablespace management
block --最小i/o单位      --segment    management

create tablespace james
datafile '/export/home/oracle/oradata/james.dbf'
size 100M       --初始的文件大小 
autoextend On     --自动增长-默认为off
next 10M      --每次自动增长大小 
maxsize 2048M     --最大文件大小
extent management local --表空间采用本地表空间管理 --默认就是local-system可不用指定。
uniform size 128k    --uniform设置extent每次分配的大小统一为128k(如果是db_block_size=8k,则每次分配16个块)
                            --如果不指定大小,则为1M,即为1024/8个block
                           --autoallocate设置extent大小由系统自动分配
                           --不管系统大小分配为多少,但统一尺寸是64k(在bitmap中标记位的大小)。
                            --autoallocate在dba_extents中的allocation_type中显示为 SYSRTEM
segment space management auto;   --默认就是auto
                        --segment中的block管理有两种:MSSM(Manual Segment Space Management),
ASSM(Auto Systemt Space Management)
                        --Auto 模式时只有pctfree参数起作用
--Manual 模式时freelist,pctfree,pctused参数起作用。

Tablespace 管理方式有两种:(管理extent)

1 数据字典空间管理 dictionary managed tablespace
   通过管理两个主要的数据字典表,UET$(Used EXtends) 和FET$(Free EXtends)来实现
   在9i以后已淘汰
   缺点:1 并发访问争用
              2 产生大量redo undo
              3 空间碎片
2 本地表空间管理 Local managed tablespace 
   位图管理
   数据文件头部加入位图区域
   extent management local
   
   具体空间分配方式:
   1 autoallocate ----allocation_type=system
   2 uniform         ----allocation_type=uniform
ALLOCATION_TYPE 这个值有3个选项:
1、system:一旦设定该值,next_extent将为空,只有extents值。该值是默认值。这个选项的最小是64K
2、 user:一旦设定该值,就允许我们可以控制next_extent了。只有两种情况出现users:一是该ts是数据字典管理的;另外一个是该ts是从 数据字典管理转移到local的(用dbms_space_admin.tablespace_migrate_to_local)
3、uniform:将标明所有的extent的大小将一致,temp表空间只能采用这个方式;以上两个情况的extent的大小将不一致;uniform中的默认值为1M

Segment 管理方式有两种:(管理Block)
1 MSSM(Manual Segment Space Management)
2 ASSM(Auto Systemt Space Management)

1 MSSM(Manual Segment Space Management)
通过在segment的段头分配自由列表(freelist)来管理block
通过两个参数 pctfree pctused来管理block如何进出freelist
pctfree 值表示预留多少%的block空间用于更新
pctused 值表示低于这个值是,block会重新加入到freelist上

通过dba_tables,dba_indexes查看freelist,pctfree,pctused等参数的设置

2 ASSM(Auto Systemt Space Management)
通过在segment的段头分配位图(bitmap)来管理block
不再需要freelist 
不在需要pctused,因为不需要从freelist上摘除block。
前面提到了数据文件上block1-2是数据头文件,block3-8是extent的位图。
block9-10是ASSM的block的一级和二级位图。
ASSM最大支持三级为图,但是一般非常难见到使用三级目录的

(段空间管理: 本地管理的表空间中的段空间管理方式可指定为:

自动:Oracle DB 使用位图管理段中的空闲空间.位图描述了段中每个数据块的状态,该状态与可插入行的块中的空间量有关.当数据块中可用空间增多或减少时,位图中会反映数据块的新状态.通过使用位图,Oracle DB 可以提高管理空闲空间的自动化程度.因此,这种空间管理方式称为"自动段空间管理(ASSM)".

手动:此方法指定要使用空闲列表来管理段中的空闲空间.空闲列表是由一些数据块组成的列表,这些数据块中有可插入行的空间.由于这种管理段空间的方式需要为在表空间中创建的方案对象指定并优化PCTUSED、FREELISTS和FREELIST GROUPS存储参数,因此这种方式称为"手动段空间管理".支持使用此方法是为了向后兼容,建议使用ASSM.)

查看分区和段空间管理方式:

SQL> select tablespace_name,extent_management,segment_space_management from dba_tablespaces;
TABLESPACE_NAME EXTENT_MANAGEMENT SEGMENT_SPACE_MANAGEMENT
------------------------------ ----------------- ------------------------
SYSTEM  LOCAL MANUAL
SYSAUX LOCAL AUTO
UNDOTBS1 LOCAL MANUAL
TEMP LOCAL MANUAL
USERS LOCAL AUTO
EXAMPLE LOCAL AUTO
LXJ_TEMP LOCAL MANUAL
LXJ_DATA LOCAL AUTO
8 rows selected

===============

FROM:

http://www.cnblogs.com/blsong/archive/2009/11/09/1599076.html

http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_7003.htm#SQLRF01403

ORACLE表空间管理方式segment和extent的更多相关文章

  1. oracle 表空管理方式(LMT)、ASSM段管理方式、一级位图块、二级位图块、三级位图块。

    今天是2013-12-16,今天和明天是我学习oracle生涯中一个特殊的日子.今天晚上进行了一下表空间管理方式的学习,在此记录一下笔记. 对于oracle数据库最小i/0单位是数据块,最想分配空间单 ...

  2. ORACLE表空间管理维护

    1:表空间概念 在ORACLE数据库中,所有数据从逻辑结构上看都是存放在表空间当中,当然表空间下还有段.区.块等逻辑结构.从物理结构上看是放在数据文件中.一个表空间可由多个数据文件组成. 如下图所示, ...

  3. Oracle表空间管理

    oracle表空间相关常用命令小结: 1.ALTER DATABASE SET DEFAULT BIGFILE TABLESPACE;              //修改表空间数据文件类型 2.ALT ...

  4. oracle 表空间管理

    1.创建表空间 03:01:55 sys@ORADB11G> create tablespace TSPITR datafile '/u01/app/oracle/oradata/TSPITR0 ...

  5. ArcSDE for Oracle表空间管理——暂时(TEMP)表空间

    Oracle暂时表空间主要用来做查询和存放一些缓冲区数据.暂时表空间消耗的主要原因是须要对查询的中间结果进行排序. 重新启动数据库能够释放暂时表空间,假设不能重新启动实例,而一直保持问题sql语句的运 ...

  6. oracle 表空间管理相关(原创)

    通过以下几步基本可以查看表空间情况以及处理表空间不足问题. ASM相关 查看asm空间 select group_number,name,total_mb,free_mb from v$asm_dis ...

  7. Oracle表空间管理相关

    以下以我自己的测试环境举例: 1.表空间的 block_size 为 8192字节,即8KBytes.从数据字典中查到 max_size 为 2147483645,即约为15.9TBytes. 2.在 ...

  8. oracle表空间查询维护命令大全之二(undo表空间)

    --undo表空间汇总 --查看全部的表空间名字 select name from v$tablespace; --创建新的UNDO表空间,并设置自己主动扩展參数; create undo table ...

  9. oracle表空间查询维护命令大全之三(暂时表空间)史上最全

    --UNDO表空间汇总 --查看全部的表空间名字 SELECT NAME FROM V$TABLESPACE; --创建新的UNDO表空间,并设置自己主动扩展參数; CREATE UNDO TABLE ...

随机推荐

  1. js埋点(转载)

    页面埋点的作用,其实就是用于流量分析.而流量的意思,包含了很多:页面浏览数(PV).独立访问者数量(UV).IP.页面停留时间.页面操作时间.页面访问次数.按钮点击次数.文件下载次数等.而流量分析又有 ...

  2. Alexandra and Prime Numbers(思维)

    Alexandra and Prime Numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (J ...

  3. 事关Animation Tree的工作随笔(一)

    最近的业务上,又回到Animation Tree这块了. 众所周知的是Animation Tree这些概念已经提出很久了,但是使用有着AT支持的CE引擎的项目,却依然义无反顾地没有使用AT,而且,连某 ...

  4. iOS蓝牙4.0开发例子

    1建立中心角色 1 2 3 #import <CoreBluetooth/CoreBluetooth.h>  CBCentralManager *manager;  manager = [ ...

  5. minicom与USB转串口

    实验器材:mini6410 连接方式:ARM板通过USB转串口线连接到pc机 下面是具体的设置了. 默认情况下,UBUNTU安装了USB转串口驱动(pl2303). 1.# lsmod | grep ...

  6. Web App 聊天样式

    意见反馈: @using CommonDB.EF @model IEnumerable<Pub_ChatLog> @{ ViewBag.Title = "意见反馈"; ...

  7. 动态加载Ribbon功能区

    上下文选项卡对新UI的功能提供了极大的推进作用.当用户对某对象执行特定的任务时就会出现特定的选项卡.例如,在Excel中处理图表时,一个上下文选项卡提供用于图表处理的额外选项.本文将介绍创建和执行这些 ...

  8. spring 配置和实例

    Spring 是一个开源框架.Spring 为简化企业级应用开发而生. 使用 Spring 可以使简单的 JavaBean 实现以前只有 EJB 才能实现的功能.Spring 是一个 IOC(DI) ...

  9. Python中安装numpy,scipy,matplotlib安装方法

    这个吧,说简单也简单,说难吧我捣鼓了两天才弄出来,真是头发都急白了.其实只要一个网址就搞定了,嘿嘿 http://www.lfd.uci.edu 这里面有你需要的任何东西,当你运行python imp ...

  10. 用户登录之cookie信息安全一二事

    大家都知道用户登陆后,用户信息一般会选择保存在cookie里面,因为cookie是保存客户端, 并且cookie可以在客户端用浏览器自由更改,这样将会造成用户cookie存在伪造的危险,从而可能使伪造 ...