snippetMinor
Oracle extents - How can I have so many with this small size?
Viewed 0 times
thiscanwithsizeextentssmallmanyhoworaclehave
Problem
This is a different question than the one with the almost-identical title.
Again, this is more curiosity about how Oracle Database works than anything I need to change (yes I know multiple extents are fine, I read Tom Kyte too).
I have a table with the following characteristics:
In this case, I got the size by scanning 10% of the table rows. With an initial extent size so high, and the data so low, how did further extents get added? I am certain that the table did not become huge, then shrink drastically back down again.
Thank you.
Again, this is more curiosity about how Oracle Database works than anything I need to change (yes I know multiple extents are fine, I read Tom Kyte too).
I have a table with the following characteristics:
Initial Ext: 1.44GB
Next Ext: 1MB
Num Extents: 26
Size: 4.18MBIn this case, I got the size by scanning 10% of the table rows. With an initial extent size so high, and the data so low, how did further extents get added? I am certain that the table did not become huge, then shrink drastically back down again.
Thank you.
Solution
The data you're getting from Toad appears to be incorrect or, at least, misleading. If you are using a locally managed tablespace with automatic extent allocation, Oracle will determine your initial and next extent sizes automatically. In 11.2, the first 16 extents are going to be 64k in size (for a total of 1 MB). The next 63 extents are going to be 1 MB in size. So if you have 26 extents, that implies that the table occupies 11 MB of space on disk. An initial extent of 1.44 GB makes no sense and a size of 4.18 MB seems rather low if you're saying it hasn't shrunk.
What does
show you? If you have 26 extents, you should see that extents 0-15 are 64 kb in size and extents 16-25 are 1 MB in size.
will show you the total size of the table's extents on disk.
What does
SELECT tablespace_name,
extent_id,
bytes/1024 kb
FROM user_extents
WHERE segment_name = >show you? If you have 26 extents, you should see that extents 0-15 are 64 kb in size and extents 16-25 are 1 MB in size.
SELECT SUM(bytes)/1024/1024 size_in_mb
FROM user_extents
WHERE segment_name = >will show you the total size of the table's extents on disk.
Code Snippets
SELECT tablespace_name,
extent_id,
bytes/1024 kb
FROM user_extents
WHERE segment_name = <<name of table>>SELECT SUM(bytes)/1024/1024 size_in_mb
FROM user_extents
WHERE segment_name = <<name of table>>Context
StackExchange Database Administrators Q#17433, answer score: 3
Revisions (0)
No revisions yet.