×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

one more sample

本文发表在 rolia.net 枫下论坛Previous example is for create tablespace

example for create table
CREATE TABLE divisions
(div_no NUMBER(2),
div_name VARCHAR2(14),
location VARCHAR2(13) )
STORAGE ( INITIAL 100K NEXT 50K
MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 5);

Oracle allocates space for the table based on the STORAGE parameter values as follows:
· The MINEXTENTS value is 1, so Oracle allocates 1 extent for the table upon creation.
· The INITIAL value is 100K, so the first extent's size is 100 kilobytes.
· If the table data grows to exceed the first extent, then Oracle allocates a second extent. The NEXT value is 50K, so the second extent's size would be 50 kilobytes.
· If the table data subsequently grows to exceed the first two extents, then Oracle allocates a third extent. The PCTINCREASE value is 5, so the calculated size of the third extent is 5% larger than the second extent, or 52.5 kilobytes. If the data block size is 2 kilobytes, then Oracle rounds this value to 52 kilobytes.
If the table data continues to grow, then Oracle allocates more extents, each 5% larger than the previous one.
· The MAXEXTENTS value is 50, so Oracle can allocate as many as 50 extents for the table.
So the extent size for this table is grow every time. The table storage extent will be set as
100k, 50k, 52.5, … 50(1+5%)**50). Oracle rounds the calculated size of each new extent to the nearest multiple of the data block size.

You can find more details from SQL refrence.更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / 建立数据库中的表时候,这是什么意思?extent size 1024 next size 256 lock mode page
    • you can find all the answer from oracle documents. check the sql reference
    • Is it the parameter of Create/Alter tablespace ?
      If yes, it is define when your database size extend your define size, how much space will be allocated by the database.( Will has min and max).
      • 我想是建表的EXTEND 的SIZE,但我不懂 NEXT SIZE是什么意思,而且如果我想直接建一个表,让它占个1G的空间,不知道如何操作
        • 你现在是DBA?
          • 打杂的,从电线管到人脑:(
            • 人脑? 怎么管,拆开瞄瞄? 你别吓偶。
    • the answer is
      A segment is a database object (eg a
      table , an index). A segment is made up of extents. An extent is made up
      of database blocks. (blocks are fixed size eg 512, 1024, 2048, 4096, 8192
      bytes) When you create a database segment (eg a table) it occupies at least
      1 extent and at least 1 block. An extent is 1 or more database block in
      size (always an integral number, 1,2,3,4,5. never 2.5 database blocks).
      When you insert data into a table Oracle puts that data into an allocated
      extent provided there is room. (really a block that is part of an extent.)
      If all the extents are full then it grows bigger. It allocates X more
      blocks as the next extent. (eg 10 blocks could make up the next extent) You
      can control how large an extent is and how many there are when you define
      your database segment.
      • 哦,那第一个数字是初始化表的BLOCKS数字,NEXT后面的是满了后添加的BLOCK数字,对吗?
        • 不对,和满不满没有关系。extent size是数据库分配的第一个entent的大小。
          如果你已知这个表的大小,由于一个entent内部的空间是连续的,你可以通过设置entent size把这个表当前所有的数据,放在一个连续的空间(查找速度就快)。然后你估计表可能增加的速度,来决定next size的大小。第一个数字一般很大(如果数据已经很多的话),第二个数字通常小很多。
          • 我觉得你的意思和我一样啊,而且大多数情况下,对于一个很大的表,分配不到连续的空间的,除非是全部重新建立数据库空间
    • 这是ORAcle吧.
      • 不是,但我觉得所有中大型数据库这种方面应该是一样的
        • 对。
          要不要偶发本书给你?
          • 什么书?等你回土狼屯再说吧
    • Let us take an example
      CREATE TABLESPACE tbs_AA
      DATAFILE 'tbsAA.dbf' SIZE 50M
      MINIMUM EXTENT 500K
      DEFAULT STORAGE (INITIAL 128K NEXT 128K).

      My understand is this tablespace will grow as unit of 500k. For example 1000k, 1500k,) as need. Any table using this tablespace will have default extent at 128k. It may depend on each table's specification.
      Hope its help.
      • 谢谢,但好象我那里建表的语法和你的不一样。按你的例子来说,那个NEXT 后面的128K是什么意思?好象也不是NEXT EXTENT 的SIZE
        • 我觉得你的和我用过的很象阿,不过我都忘了:P
        • 你怎么不去doors open?偶念念不忘咱们去年看见的小火车,你待会要是去的话,给偶的小火车们问个好。
          • 呵呵,不会再去了
            我喜欢自然的东西,不喜欢人文的
            • 这年头,熊都很挑剔啊,显然有点歧视偶们人类的说。 :(((
        • one more sample
          本文发表在 rolia.net 枫下论坛Previous example is for create tablespace

          example for create table
          CREATE TABLE divisions
          (div_no NUMBER(2),
          div_name VARCHAR2(14),
          location VARCHAR2(13) )
          STORAGE ( INITIAL 100K NEXT 50K
          MINEXTENTS 1 MAXEXTENTS 50 PCTINCREASE 5);

          Oracle allocates space for the table based on the STORAGE parameter values as follows:
          · The MINEXTENTS value is 1, so Oracle allocates 1 extent for the table upon creation.
          · The INITIAL value is 100K, so the first extent's size is 100 kilobytes.
          · If the table data grows to exceed the first extent, then Oracle allocates a second extent. The NEXT value is 50K, so the second extent's size would be 50 kilobytes.
          · If the table data subsequently grows to exceed the first two extents, then Oracle allocates a third extent. The PCTINCREASE value is 5, so the calculated size of the third extent is 5% larger than the second extent, or 52.5 kilobytes. If the data block size is 2 kilobytes, then Oracle rounds this value to 52 kilobytes.
          If the table data continues to grow, then Oracle allocates more extents, each 5% larger than the previous one.
          · The MAXEXTENTS value is 50, so Oracle can allocate as many as 50 extents for the table.
          So the extent size for this table is grow every time. The table storage extent will be set as
          100k, 50k, 52.5, … 50(1+5%)**50). Oracle rounds the calculated size of each new extent to the nearest multiple of the data block size.

          You can find more details from SQL refrence.更多精彩文章及讨论,请光临枫下论坛 rolia.net
          • 非常谢谢你,把ORACLE里面建表的方式搞懂了。
            我那个问题应该也差不多的