Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Presented by
Joel Goodman
Oracle University EMEA
Agenda
ALLOCATION_TYPE = USER
Use of Converted Locally Managed Tablespaces
ALLOCATION_TYPE = USER
Less with Autoallocate Locally Managed Tablespaces
ALLOCATION_TYPE = SYSTEM
Tablespace Attributes
Look at DBA_TABLESPACES
EXTENT_MANAGEMENT
----------------LOCAL
DICTIONARY
LOCAL
LOCAL
LOCAL
ALLOCATON_TYPE
-------------USER
USER
SYSTEM
UNIFORM
SYSTEM
Caused by DML
Inserts may grow the segment
Deletes may or may not shrink segments
Eventually the extents may be partially used
More extents may exist than are required
This affects query performance
ASSM has less Internal fragmentation than Free List Managed
Segments
PDDL
10
Extent 1
Highwater
mark
Empty blocks
(rows deleted)
Extent 2
11
Inserts
Inserts
Inserts
13
PCTFREE
Default is 10
Zero if no UPDATE activity
14
Old
Original block
with pointer
to migrated
row
New data
Chaining
Index
16
Table
Table Statistics
Populate the table statistics using the dbms_stats
package and then query the values in dba_tables:
SQL> EXECUTE dbms_stats.gather_table_stats >
('HR','EMPLOYEES');
PL/SQL procedure successfully completed.
SQL> SELECT num_rows, blocks, empty_blocks as
empty,
2
avg_space, chain_cnt, avg_row_len
3 FROM
dba_tables
4 WHERE
owner = 'HR'
5 AND
table_name = 'EMPLOYEES';
NUM_ROWS BLOCKS EMPTY AVG_SPACE CHAIN_CNT
AVG_ROW_LEN
-------- ------ ----- --------- ------------------13214
615
35
1753
946
184
17
ASSM Segments
19
Ease of use
Better space utilization
Better concurrency handling
Better performance
Fewer Buffer Busy Waits on inserts
BMB
BMB
BMB
BMB
Data
block
Extent
Automatic
Enabled by the use of
locally managed
tablespaces
Tracked by bitmaps in
segments
Benefits:
More flexible space
utilization
Run-time adjustment
Multiple process
search of BMBs
Segment
20
BMB
S
E
G
M
E
N
T
BMB
BMB
BMB
BMB
BMB
BMB
BMB
Block
DATA
Extent
21
BMB
PCTFREE = 10
FS2
FS3
FS1
FS1
FS2
Inserts,
updates
FS3
Deletes
Deletes
FS4
Full block
22
Full block
23
PQ1
PQ3
PQ2
HWM
HWM
PQ4
HWM
Internal Fragmentation
HWM
External Fragmentation
HWM
Data
24
Free space
Defragmenting Tables
26
Coalesces
Also Moves the Table Segment High Watermark
May Free up Extents
Maintains Indexes
Is an On-Line Operation
Or use
27
28
INDEX
MODIFY PARTITION
29
MATERIALIZED VIEW
MODIFY SUBPARTITION
MODIFY LOB
30
Shrinking Segments
HWM
HWM
HWM
Index
Table
Shrink
DBA
33
34
35
Export/Import
Export the table.
Drop or truncate the table.
Import the table.
36
Types of Indexes
Types of Indexes
These are several types of index structures available to
you, depending on the need:
A B-tree index is in the form of a binary tree and is the
default index type.
Reverse Key indexes use the same structure
38
B-Tree Index
Index entry
Root
Branch
39
Schema
Constraints
>
Indexes
Views
Sequences
Temp Tables
Data Dict
Indexes
WHERE key = 22
Row
pointer
Key
22
22
Index
40
Table
Bitmap Indexes
File 3
Table
Block 10
Block 11
Block 12
Index
Start
End
Key ROWID ROWID
<Blue,
<Green,
<Red,
<Yellow,
41
10.0.3,
10.0.3,
10.0.3,
10.0.3,
12.8.3,
12.8.3,
12.8.3,
12.8.3,
Bitmap
1000100100010010100>
0001010000100100000>
0100000011000001001>
0010001000001000010>
43
45
Defragmenting Indexes
Index Reorganization
47
49
Rebuild
Coalesce
50
Segment Advisor
52
53