The size of the bitmap management area for the unified size localization admin table space

Source: Internet
Author: User

Starting with Oracle8i, Oracle supports two types of tablespace: The Data Dictionary management table space and the localized managed table space. And Oracle has been recommending users to use the locally managed tablespace. We know that in a localized managed table space, the data file space is managed by a bitmap in the file header of the document itself. The header of the data file uses 0 and 1 to represent the unused and already used areas of the file without having to maintain the system tables. The benefit of this is obvious, Oracle in the allocation of new zones, only need to scan the file headers, to find available space, for the merging of adjacent space, it is easy, as long as the adjacent location map code is 0 can be.

So in the localized managed table space, how much space does the bitmap management in the header of the data file file occupy? Let's take a look at the following examples separately.

A non-Uniform size localization management table space

Create a localized management table space of a non uniform size.
sql> Create Tablespace ts_test_2
2 datafile ' D:\ORACLE\ORADATA\LEGEND\ts_test_2_01.ORA ' size 100M
3 extent management Local;
The table space has been created.

sql> select sum (bytes/1024/1024) free_space
2 from Dba_free_space
3 Where tablespace_name = ' ts_test_2 ';
Free_space
----------
99.9375

From the above we can see that the table space is used (100-99.9375) x1024 = 64K.

Two unified size localization management table space
Create a uniform size localized management table space.
sql> Create Tablespace Ts_test
2 DataFile ' D:\ORACLE\ORADATA\LEGEND\ts_test01. ORA ' Size 100M
3 Extent Management Local
4 Uniform size 5M;
The table space has been created.

sql> select sum (bytes/1024/1024) free_space
2 from Dba_free_space
3 Where tablespace_name = ' ts_test ';
Free_space
----------
95

Is the table file used 5M.

Then create a look at the size of the 10M area.
sql> Create Tablespace Ts_test_3
2 datafile ' D:\ORACLE\ORADATA\LEGEND\ts_test_3_01.ORA ' size 100M
3 Extent Management Local
4 Uniform size 10M;
The table space has been created.

sql> select sum (bytes/1024/1024) free_space
2 from Dba_free_space
3 Where tablespace_name = ' ts_test_3 ';
Free_space
----------
90

was used 10M. This means that the first area of file allocation is occupied by administrative files. Is it true.

Why is a non uniform size localized management table space occupied by 64K, while a unified size localized management table space occupies the first area. I tried to modify the size of the data file and something unexpected happened.
Sql> ALTER DATABASE
2 DataFile ' D:\ORACLE\ORADATA\LEGEND\ts_test01. ORA ' Resize 102464k;
The database has changed.

Increase the 64K size of the data file for a unified size localized management table space. Query again.
sql> select sum (bytes/1024/1024) free_space
2 from Dba_free_space
3 Where tablespace_name = ' ts_test ';
Free_space
----------
100

The unused space is 100M.

Visible, in the uniform size of the localized management table space data files, bitmap management occupies the space and the non-standard size of the localized management table space data files, like the 64K.

Paste: http://blog.sina.com.cn/s/blog_55844be4010002ki.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.