D78846GC20 08
D78846GC20 08
8-2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Space Management: Overview
8-3 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Block Space Management
PCTFREE = 10
FS2
FS3
FS1
FS1
FS2
Inserts, Deletes Deletes
updates FS3
FS4
Full block Full block
8-4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Row Chaining and Migration
Example:
• On update: Row length increases,
exceeding the available free space Old
in the block.
• Data needs to be stored in a new block. Original block
• Original physical identifier of row with pointer
(ROWID) is preserved. to migrated
row
• The Oracle Database server needs
to read two blocks to retrieve data.
• The Segment Advisor finds segments New data
containing the migrated rows.
• There is automatic coalescing of fragmented
free space inside the block.
8-5 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Quiz
8-7 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Free Space Management Within Segments
Extent
Segment
8-8 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Types of Segments
8-9 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Allocating Extents
Header
PCTFREE
=0
Uncompressed
Free
data
space
Compressed
data
Data block
Inserts are PCTFREE reached Inserts are again PCTFREE reached
uncompressed. triggers compression. uncompressed. triggers compression.
• Is enabled with
CREATE TABLE … ROW STORE COMPRESS ADVANCED
…;
• Is recommended for active OLTP environments
G Y
Y Y Y Y Y Y
G Y G G Y G
G Y Y G G Y Y G
Uncompressed OLTP compression with symbol table at
block the beginning of the block
MMON
HWM
HWM
DML operations and queries can be issued during compaction.
2 ALTER TABLE employees SHRINK SPACE;
HWM
DML operations are blocked when the HWM is adjusted.
Index
Table Shrink
DBA
A resumable statement:
• Enables you to suspend large operations instead of
receiving an error
• Gives you a chance to fix the problem while the operation
is suspended, rather than starting over
• Is suspended for the following conditions:
– Out of space
– Maximum extents reached
– Space quota exceeded
• A resumable statement can be suspended and resumed
multiple times.
1 SQL statement
Full table
2 Suspended
Continue
SQL 3 4
Optionally
operation
5 Table AFTER
with free SUSPEND Abort
space trigger