Professional Documents
Culture Documents
Managing Storage
Copyright 2008, Oracle. All rights reserved.
Space
Objectives
After completing this lesson, you should be able to: Describe how the Oracle database automatically manages space Proactively monitor and manage tablespace space usage se the Segment Advisor !eclaim wasted space from tables and inde"es by using the segment shrin# functionality Manage resumable space allocation Describe the concepts of transportable tablespaces and databases
11 - 2 Copyright 2008, Oracle. All rights reserved.
Management Proactive Monitoring Seg$ Advisor % Seg$Shrin# !esumable Allocation &ransportable &'S and D'
11 - 3
Segment
11 - 4 Copyright 2008, Oracle. All rights reserved.
{
0"tent
Data bloc#
Automatic 0nabled by the use of locally managed tablespaces &rac#ed by bitmaps in segments 'enefits: More fle"ible space utili1ation !un,time adjustment Multiple process search of 'M's
&ypes of Segments
A segment is a set of e"tents allocated for a certain logical structure$ &he different types of segments are:
Data segment (nde" segment &emporary segment !ollbac# segment
11 - 5
Allocating 0"tents
Searching the data file3s bitmap for the re4uired number of adjacent free bloc#s Si1ing e"tents with storage clauses:
UNIFORM AUTOALLOCATE
11 - !
Deletes
Deletes
)ull bloc#
(e& data
11 - 8
Space Management 9 Proactive $ Monitoring Seg$ Advisor % Seg$Shrin# !esumable Allocation &ransportable &'S and D'
11 - )
Alert
D'A !esolve space problem
!esolve space problem by: Adding or resi1ing data file Setting AUTOEXTEND ON Shrin#ing objects !educing UNDO_RETENTION /hec#ing for long,running 4ueries in temporary tablespaces
11 - 10 Copyright 2008, Oracle. All rights reserved.
MMOA
!ead,only and offline tablespaces: Do not set up alerts$ &emporary tablespace: &hreshold corresponds to space currently used by sessions$ ndo tablespace: &hreshold corresponds to space used by active and une"pired e"tents$ Autoe"tensible files: &hreshold is based on the ma"imum file si1e$
Copyright 2008, Oracle. All rights reserved.
11 - 11
Shrin#ing Segments
Space Management Proactive Monitoring 9 Seg$ Advisor % Seg$Shrin# !esumable Allocation &ransportable &'S and D'
CBM
SPACE COMPACT!
CBM
SPACE!
CBM
&able
Shrin#
D'A
11 - 14
11 - 15
Segment Advisor
11 - 1!
11 - 1"
(mplementing !ecommendations
11 - 18
11 - 1)
SPACE #CASCADE$
MATERIALI&ED %IEW LO'
MATERIALI&ED %IEW
MODIF( PARTITION
MODIF( SUBPARTITION
MODIF( LOB
ALTER TABLE employees ENABLE ROW MO%EMENT! ALTER TABLE employees SHRIN SPACE CASCADE!
8 6
SPACE,!7
ALTER TABLE employees MODIF( LOB)*es+me, )SHRIN ALTER TABLE employees O%ERFLOW SHRIN SPACE!
11 - 20
A resumable statement: 0nables you to suspend large operations instead of receiving an error Fives you a chance to fi" the problem while the operation is suspended, rather than starting over (s suspended for the following conditions:
Out of space Ma"imum e"tents reached Space 4uota e"ceeded
Space Management Proactive Monitoring Seg$ Advisor % Seg$Shrin# 9 !esumable Allocation &ransportable &'S and D'
11 - 21
ALTER SESSION ENABLE RESUMABLE! INSERT INTO s-les_.e/ SELECT 0 FROM s12s-les! ALTER SESSION DISABLE RESUMABLE!
11 - 22 Copyright 2008, Oracle. All rights reserved.
11 - 23
Optionally
Abort
11 - 24
11 - 25
&ransporting &ablespaces
/oncept: /ross,platform transportable tablespaces: Simplify data distribution between data warehouse and data marts Allow database migration from one platform to another Supported platforms:
*olaris?t'@ OA 932-$it: *olaris?t'@ OA 9!4-$it: 0icroso1t 2i#do&s 6A 932-$it: <i#,; 6A 932-$it: A67-8ased *yste's 9!4-$it: 4--.7 9!4-$it: 4- >r,!4 .(67 4--.7 6A 9!4-$it: <i#,; 6A 9!4-$it: 4- Ope# 50* 0icroso1t 2i#do&s 6A 9!4-$it: 680 =*eries 8ased <i#,; <i#,; !4-$it 1or A03 Apple 0ac O* 0icroso1t 2i#do&s !4-$it 1or A03 *olaris Operati#g *yste' 9;8!:
11 - 2! Copyright 2008, Oracle. All rights reserved.
COMPATIBLE=102020
Ship data files and dump file to target$ se Data Pump to import metadata$ &arget
11 - 28
Source
&arget
11 - 2)
&ransporting Databases
Fenerali1e the transportable tablespace feature$ Data can easily be distributed from a data warehousing environment to data marts, which are usually on smaller platforms$ A database can be migrated from one platform to another very 4uic#ly$
Platform K Same -endianness. Platform I
Aew database
Open database in READ ONL( mode and COMPATIBLE=102020 !ead, only !ead, only Ship files !ead, only !ead, only
Source system
&arget system
11 - 31
Open database in READ ONL( mode and COMPATIBLE=102020 !ead, only Ship files !ead, only !ead, only !ead, only
Source system
&arget system
11 - 32
11 - 33
Summary
(n this lesson, you should have learned how to: se the Oracle database to automatically manage space Proactively monitor and manage tablespace space usage se the Segment Advisor !eclaim wasted space from tables and inde"es by using the segment shrin# functionality Manage resumable space allocation Describe the concepts of transportable tablespaces and databases
11 - 34
11 - 35
11 - 3!