Oracle本地管理对照数据字典管理表空间
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.
后数据字典管理表空间已被废弃!
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.
Oracle本地管理对照数据字典管理表空间的更多相关文章
- [独孤九剑]Oracle知识点梳理(一)表空间、用户
本系列链接导航: [独孤九剑]Oracle知识点梳理(一)表空间.用户 [独孤九剑]Oracle知识点梳理(二)数据库的连接 [独孤九剑]Oracle知识点梳理(三)导入.导出 [独孤九剑]Oracl ...
- oracle 怎么查看用户对应的表空间
oracle 怎么查看用户对应的表空间? 查询用户: 查看数据库里面所有用户,前提是你是有 dba 权限的帐号,如 sys,system: select * from dba_users; 查看你能管 ...
- centos 安装oracle 11g r2(三)-----表空间创建
centos 安装oracle 11g r2(三)-----表空间创建 创建表空间前要保证监听与数据库实例已经启动 1.启动监听 [oracle@localhost ~]$ lsnrctl start ...
- (总结)Oracle 11g常用管理命令(用户、表空间、权限)
1.启动oracle数据库: 从root切换到oracle用户进入:su - oracle 进入sqlplus环境,nolog参数表示不登录:sqlplus /nolog 以管理员模式登录:sqlpl ...
- oracle的用户、权限、表空间的管理
1.创建表空间 create tablespace test1_tablespace datafile 'test1file.dbf' size 10m; 2.创建临时表空间 create tempo ...
- 【oracle11g,13】表空间管理2:undo表空间管理(调优) ,闪回原理
一.undo空间原理: dml操作会产生undo数据. update时,sever process 会在databuffer 中找到该记录的buffer块,没有就从datafile中找并读入data ...
- Oracle 高水位说明和释放表空间,加快表的查询速度
高水位的介绍 数据库运行了一段时间,经过一些列的删除.插入.更改操作有些表的高水位线就有可能和实际的表存储数据的情况相差特别多,为了提高检索该表的效率,建议对这些表进行收缩: 查找高水位线的表 查找表 ...
- Oracle 释放过度使用的Undo表空间
故障现象:UNDO表空间越来越大,长此下去最终数据因为磁盘空间不足而崩溃: 问题分析:产生问题的原因主要以下两点: 1. 有较大的事务量让Oracle Undo自动扩展,产生过度占用磁盘空间的情况: ...
- oracle下的数据库实例、表空间、用户及其表的区分
完整的Oracle数据库通常由两部分组成:Oracle数据库和数据库实例. 1) 数据库是一系列物理文件的集合(数据文件,控制文件,联机日志,参数文件等): 2) Oracle数据库实例则是一组Ora ...
随机推荐
- 人人网javascript面试题
JavaScript面试题要求:以下题目必须从一至四题中,选出三道题,使用原生代码实现,不可使用任何框架,第五题为选作题. 一. 在页面的固定区域内实现图片的展示 <ignore_ ...
- C++学习之路—多态性与虚函数(二)纯虚函数与抽象类
(根据<C++程序设计>(谭浩强)整理,整理者:华科小涛,@http://www.cnblogs.com/hust-ghtao转载请注明) 1 纯虚函数 在前面的博客中已经提到:有时 ...
- 在Java中使用MD5和BASE64
MD5: 在上一篇<Servlet的学习之Session(5)>中,为了能使获取的所有随机数都能有相同的位数,我们采用MD5获取随机数的消息摘要(或称数据指纹.数据摘要等等). MD5可以 ...
- 如何使用Gmail的别名功能?
Gmail真的是一个很好的邮箱,一直是我的最爱!它有一个很独特的功能-别名,用这个功能,我们就可以把一个 邮箱当成很多个邮箱来使用了! 1.Gmail 不提供传统别名 ,但是你可以收到发送到 your ...
- zabbix 主机名必须要能ping通
api01:/home/tomcat> cat /etc/hosts 127.0.0.1 localhost ::1 localhost localhost.localdomain localh ...
- display:table 水平居中
<div style="width:auto; margin:auto;display:table"> <div style="width: 100px ...
- Swift - AnyObject与Any的区别
1,AnyObject :代表任何class类型的对象实例. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 class Man{ } class Woman{ ...
- JMS学习的个人理解笔记
Jms即java消息服务javamessage service,所谓的面向消息编程,主要应用在企业内部各个系统之间做接口,以异步方式传递消息数据. Jms有2种传送模式,先来看第一种,即点对点传送模式 ...
- Lucene.Net 2.3.1开发介绍 —— 三、索引(五)
原文:Lucene.Net 2.3.1开发介绍 -- 三.索引(五) 话接上篇,继续来说权重对排序的影响.从上面的4个测试,只能说是有个直观的理解了.“哦,是!调整权重是能影响排序了,但是好像没办法来 ...
- MSA2312 enclosure 闪断后
故障描述:由于电源原因,导致整个扩展柜闪断,硬盘全部为leftover状态. 存储划分配置:之前满配的一套MSA2312,划分为4个vd,后面两个vd无影响,前面2个VD都是一半在1号柜子,一半在2号 ...