Locally vs. Dictionary Managed Tablespaces

整理自:http://www.orafaq.com/node/3.

When Oracleallocates space to a segment (like a table or index), a group of contiguousfree blocks, called an extent, is added to the segment. Metadata regardingextent allocation and unallocated extents are either stored in the datadictionary, or in the tablespace itself. Tablespaces that record extentallocation in the dictionary, are called dictionary managed tablespaces, andtablespaces that record extent allocation in the tablespace header, are calledlocally managed tablespaces.

表空间分配段空间,即区:一组连续的块。表空间关于区分配的信息被存于数据字典(DMT)或表空间自身(LMT)位图区

查看数据库中表空间管理方式:

SQL> select tablespace_name,extent_management, allocation_type from dba_tablespaces;

TABLESPACE_NAME                EXTENT_MAN ALLOCATIO

------------------------------ -------------------

SYSTEM                         DICTIONARY USER

SYS_UNDOTS                     LOCAL      SYSTEM

TEMP                           LOCAL      UNIFORM


DictionaryManaged Tablespaces (DMT):

Oracle use thedata dictionary (tables in the SYS schema) to track allocated and free extentsfor tablespaces that is in "dictionary managed" mode. Free space isrecorded in the SYS.FET$ table, and used space in the SYS.UET$ table. Wheneverspace is required in one of these tablespaces, the ST (space transaction)enqueue latch must be obtained to do inserts and deletes agianst these tables.As only one process can acquire the ST enque at a given time, this often leadto contention(竞争).

使用数据字典管理区分配。空暇空间被记录在SYS.FET$表中,已使用空间记录在SYS.UET$表。

Execute thefollowing statement to create a dictionary managed
tablespace:  创建数据字典管理表空间:

SQL> CREATE TABLESPACE ts1 DATAFILE'/oradata/ts1_01.dbf' SIZE 50M

EXTENT MANAGEMENT DICTIONARY

DEFAULT STORAGE ( INITIAL 50K NEXT 50KMINEXTENTS 2 MAXEXTENTS 50 PCTINCREASE 0);


Locally ManagedTablespaces (LMT):

Using LMT, eachtablespace manages it's own free and used space within a bitmap structurestored in one of the tablespace's data files. Each bit corresponds to adatabase block or group of blocks. Execute one of the following statements tocreate a locally managed
tablespace:

注意:在Oracle920中,默认系统表空间是local管理,因此不能在数据库中建立数据字典管理的表空间。
假设想要建立数据字典管理的表空间,必须在建立数据库时,将系统表空间改为数据字典管理才干够。

SQL> CREATE TABLESPACE ts2 DATAFILE'/oradata/ts2_01.dbf' SIZE 50M

EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

SQL> CREATE TABLESPACE ts3 DATAFILE'/oradata/ts3_01.dbf' SIZE 50M

EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;

Note the differencebetween AUTOALLOCATE and UNIFORM SIZE:  注意AUTOALLOCATE与UNIFORM SIZE选项差别!

AUTOALLOCATEspecifies that extent sizes are system managed. Oracle will choose"optimal" next extent sizes starting with 64KB. As the segment growslarger extent sizes will increase to 1MB, 8MB, and eventually to 64MB. This isthe recommended option for a low or unmanaged environment.

UNIFORMspecifies that the tablespace is managed with uniform extents of SIZE bytes(use K or M to specify the extent size in kilobytes or megabytes). The defaultsize is 1M. The uniform extent size of a locally managed tablespace cannot beoverridden when a schema object, such as a table or an index, is created.

Also not, if youspecify, LOCAL, you cannot specify DEFAULT STORAGE, MINIMUM EXTENT orTEMPORARY.

假设是本地管理表空间则不能够指定DEFAULT STORAGE与MINIMUM EXTENT或TEMPORARY选项。

Advantages ofLocally Managed Tablespaces: 本地管理优势:

  • Eliminates the need for recursive SQL operations against the data dictionary (UET$ and FET$ tables)  消除对于数据字典表的递归SQL操作。
  • Reduce contention on data dictionary tables (single ST enqueue)   降低对数据字典表的争用。
  • Locally managed tablespaces eliminate the need to periodically coalesce free space (automatically tracks adjacent free space)   不须要定期合并空暇空间。
  • Changes to the extent bitmaps do not generate rollback information   对于位图区的改变不会产生回滚信息。


Locally ManagedSYSTEM Tablespace:

From Oracle9irelease 9.2 one can change the SYSTEM tablespace to locally managed. Further, ifyou create a database with DBCA (Database Configuration Assistant), it willhave a locally managed SYSTEM tablespace by default. The following restrictionsapply:

  • No dictionary-managed tablespace in the database can be READ WRITE.
  • You cannot create new dictionary managed tablespaces
  • You cannot convert any dictionary managed tablespaces to local

Thus, it is bestonly to convert the SYSTEM tablespace to LMT after
all other tablespaces are migrated to LMT.


自920后数据字典管理表空间已被废弃!


Segment SpaceManagement in LMT: 本地管理表空间中的段管理

From Oracle 9i,one can not only have bitmap managed tablespaces, but also bitmap managedsegments when setting Segment Space Management to AUTO for a tablespace. Lookat this example:设置段自己主动管理

SQL> CREATE TABLESPACE ts4 DATAFILE '/oradata/ts4_01.dbf'SIZE 50M

EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO;

Segment SpaceManagement eliminates the need to specify and tune the PCTUSED, FREELISTS, andFREELISTS GROUPS storage parameters for schema objects. The Automatic SegmentSpace Management feature improves the performance of concurrent DML operationssignificantly since different parts of the bitmap can be used simultaneouslyeliminating serialization for free space lookups against the FREELSITS. This isof particular importance when using RAC, or if "buffer busy waits"are deteted.


Convert betweenLMT and DMT: 本地管理与数据字典管理表空间转换

TheDBMS_SPACE_ADMIN package allows DBAs to quickly and easily
convert between LMT and DMT mode. Look at these examples:

SQL> exec dbms_space_admin.Tablespace_Migrate_TO_Local('ts1');

PL/SQL procedure successfully completed.

SQL> execdbms_space_admin.Tablespace_Migrate_FROM_Local('ts2');

PL/SQL procedure successfully completed.

---------------------------

Dylan Presents.

转载于:https://www.cnblogs.com/mfrbuaa/p/3959335.html

Oracle本地管理对照数据字典管理表空间相关推荐

  1. oracle还原system备份包,SYSTEM表空间管理及备份恢复

    --============================= -- SYSTEM 表空间管理及备份恢复 --============================= SYSTEM表空间是Oracl ...

  2. 玩转oracle 11g(5):表空间的作用

    表空间是oracle内部定义的一个概念,是为了统一oracle物理和逻辑 上的结构而专门建立的,从物理上来说,一个表空间是由具体的一个或多个磁盘上数 据文件构成的(至少1对1,可以1对多),从逻辑上来 ...

  3. Oracle之同义词,DBLINK,表空间

    昨天讲了物化视图了,今天讲一下同义词的这个概念 就是synonym,反正这个我叫习惯了,这个同义词了解过吗,这个可能了解的不多吧,MYSQL里面有同义词的概念吗,给我点反馈,你用MYSQL里面有同义词 ...

  4. Oracle数据库迁移:异构传输表空间TTS HP-UX迁移至Redhat Linux 7.7

    墨墨导读:本文来自墨天轮用户"你好我是李白"的投稿,记录一个Oracle数据库迁移过程 :异构传输表空间TTS HP-UX迁移至Redhat Linux 7.7.墨天轮主页:htt ...

  5. Oracle入门(七)之表空间

    表空间 表空间是数据库的逻辑划分,一个表空间只能属于一个数据库.所有的数据库对象都存放在指定的表空间中.但主要存放的是表, 所以称作表空间. Oracle数据库中至少存在一个表空间,即SYSTEM的表 ...

  6. linux oracle 删除为空的dbf,Linux上Oracle误删除一个没有用的dbf表空间文件

    在Linux下面安装好Oracle只有,Linux 下面就会有一个Oracle用户,Linux上Oracle误删除一个没有用的dbf表空间文件,导致数据库连接 在Linux下面安装好Oracle只有, ...

  7. oracle 11g的audit导致system表空间快速增长的问题

    oracle 11g的audit导致system表空间快速增长的问题         分类:             oracle              2012-03-23 16:20     ...

  8. oracle有几种类型表空间,oracle 数据创建时如何指定表空间类型

    oracle建表时指定了表空间为何没起作用? oracle 12c /windows ,实验过程如下: 1.建第一个表空间data_tbs_01,数可以直接在创建语句后面追加"tablesp ...

  9. oracle plsql创建表空间,Oracle在PLSQL Developer上创建表空间和用户脚本 - 龙卷风的日志 - 网易博客...

    Oracle在PLSQL Developer上建立表空间脚本 创建表空间 一. create tablespace MOF_TEMP //name datafile 'D:\oracle\produc ...

最新文章

  1. php编写星期几,PHP实现今天是星期几的几种写法
  2. 在ChemDraw中输入千分号的方法
  3. 心得体悟帖---12、志向还是太短浅,目光也是
  4. Lotus Notes基础知识
  5. 在WORD文档里如何添加编号
  6. android 手机关机代码非root,Android手机获取root权限并实现关机重启功能的方法
  7. 【集训队作业】IOI 2020 集训队作业 试题泛做 8
  8. 语言模型——深度学习入门动手
  9. linux如何跳到命令行开端,Linux快捷键大全
  10. 来了!微信小程序五款最受欢迎的UI框架解读
  11. 双一流大学王牌专业计算机,重点大学的王牌专业,双一流大学的王牌专业都有哪些?...
  12. 第七章 Java基础类库
  13. Postman 开发团队共享接口协作调试
  14. 2个月,3000节音频,利润30万+这就是赚钱的秘密
  15. Games101课程笔记_lecture20_color颜色
  16. 看程序员如何实力撩妹
  17. 特征多项式及Cayley-Hamilton定理
  18. 中国第一台103型电子计算机诞生于,第一台计算机诞生于几年?
  19. 中年人学C语言Windows程序设计,9 窗口绘图:直线的画法
  20. 控制系统的复域数学模型

热门文章

  1. iOS Provisioning Portal概述
  2. error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or
  3. MIL for PRE
  4. 图像语义分割模型DeepLab训练Cityscapes数据集过程记录
  5. linux下配置Docker的jupyter notebook环境
  6. 【正一专栏】故意豪宅纵火的保姆会判死刑吗?
  7. 在数组中找到第 k 小的数
  8. 配置文件加载优先级和外部配置文件加载||IDEA外部配置文件无法加载
  9. 使用axios上传文件+参数
  10. WAF果真是个好东西