extent--Minimum Space allocation unit--tablespace management
Block-min I/O Unit--segment Management
Create tablespace James
DataFile '/export/home/oracle/oradata/james.dbf '
Size 100M--Initial file size
Autoextend on-Automatic growth
Next 10M-Each auto-grow size
MaxSize 2048M--Maximum file size
Extent management local--table space using local surface space management
Uniform size 128k--uniform set extent each time the allocation is uniform to 128k (if the db_block_size=8k
, then allocate 16 blocks at a time)
--If the size is not specified, it is 1M, which is 1024/8 blocks
--autoallocate setting extent size is automatically assigned by the system
--no matter how much the system is allocated, the uniform size is 64k (the size of the marker bit in bitmap).
--autoallocate is displayed as Sysrtem in Allocation_type in dba_extents
Segment Space management auto;
There are two types of block management in--segment: MSSM (Manual Segment Space Management),
ASSM (Auto systemt Space Management)
Only Pctfree parameters work when--auto mode
The freelist,pctfree,pctused parameter works when--manual mode.
There are two ways of tablespace management: (Management extent)
1 Data Dictionary Space management dictionary managed tablespace
By managing two major data dictionary tables, uet$ (used EXtends) and fet$ (free EXtends) implement
Eliminated after 9i
Cons: 1 Concurrent access contention
2 generate a lot of redo undo
3 Space debris
2 Local surface space management local managed Tablespace
Bitmap Management
Data file header added to bitmap area
Extent Management Local
Specific space allocation method:
1 autoallocate----Allocation_type=system
2 Uniform----allocation_type=uniform
Allocation_type This value has 3 options:
1, System: Once this value is set, Next_extent will be empty, only the extents value. The value is the default value. The minimum of this option is 64K
2, User: Once this value is set, we are allowed to control the next_extent. There are only two cases where the users: first, the TS is a data dictionary management, and the other is that TS is transferred from data dictionary management to local (with dbms_space_admin.tablespace_migrate_to_local)
3, Uniform: will be marked all the size of the extent will be consistent, the temp table space can only be used in this way; the size of the extent of the above two cases will be inconsistent; The default value in uniform is 1M
New first table in unused tablespace t1
[Email protected]>create table T1 (x int);
Table created.
[Email protected]>select extent_id,file_id,blocks,block_id,owner from dba_extents where owner= ' JAMES ';
extent_id file_id BLOCKS block_id OWNER
---------- ---------- ---------- ---------- ------------------------------
0 7 9 JAMES
BOLCK_ID directly from 9, the front of the 8 blocks reserved for his
1-2 Guestsis the file header information
3-8 bits is bitmap information
Dump out this file head and see
The main information is as follows
File Space Bitmap Block:
BitMap Control:
Relfno:7, Beginblock:9, flag:0,first:1, free:63487
1 extent have been allocated and 63487 are available for free.
There are two ways to manage Segment: (Manage block)
1 MSSM (Manual Segment Space Management)
2 ASSM (Auto systemt Space Management)
1 MSSM (Manual Segment Space Management)
Manage blocks by assigning a free list (freelist) to the segment header in segment
Manage how blocks get in and out of freelist with two parameters Pctfree pctused
The Pctfree value indicates how much of the block space is reserved for updating
The pctused value indicates that the block will rejoin the freelist if it is below this value.
View settings for parameters such as freelist,pctfree,pctused via Dba_tables,dba_indexes
2 ASSM (Auto systemt Space Management)
Manage blocks by assigning bitmaps (bitmap) to the segment header in segment
No longer need freelist
No need to pctused, because there is no need to remove the block from the freelist.
As mentioned earlier in the data file Block1-2 is the data header file, Block3-8 is the extent bitmap.
Block9-10 is a level and level two bitmap of the ASSM block.
ASSM supports up to three levels, but it is generally very difficult to see the use of level three directories
Oracle Table Space Management