The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data,...
-
Upload
clifford-walters -
Category
Documents
-
view
215 -
download
0
Transcript of The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data,...
![Page 1: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/1.jpg)
![Page 2: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/2.jpg)
The Self-managing Database: Proactive Space and Schema Object Management
Amit GaneshDirector,
Data, Space and Transaction Processing
Oracle Corporation
Session id: 40170
![Page 3: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/3.jpg)
Agenda
Proactive Space Management– Alerts– Size estimation and growth trending– Segment Advisor and Shrink
Proactive Undo Management– Alerts– Auto-sizing– Auto-tuning
![Page 4: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/4.jpg)
Automatic Space Management
Oracle9i No external space
fragmentations – Locally Managed
Tablespace No space allocation
contention– Automatic Segment
Space Management No Rollback Segments
– Automatic Undo Management
Intelligent Infrastructure
Application & SQLManagement
System ResourceManagement
SpaceManagement
Backup & RecoveryManagement
StorageManagement
Database Management
![Page 5: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/5.jpg)
Intelligent Infrastructure
Application & SQLManagement
System ResourceManagement
SpaceManagement
Backup & RecoveryManagement
StorageManagement
Database Control
Database Management
Oracle Database 10g – Self-Managing Database
![Page 6: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/6.jpg)
10g: Always working for you
Collects continuously Records periodically to disk Learns from historical data Adapts to changing workload Alerts DBA when problems occur Advises proactively on problems
Integrated with the Enterprise Manager
![Page 7: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/7.jpg)
Proactive Space
Management
![Page 8: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/8.jpg)
Proactive Space Management in 10g
Growth Trending
Size Estimation
$$
Segment
Advisor
PlanningPlanning
Tablespace
Alerts
OperationsOperations
ActionsActions
Shrink
Add file
Re-org/ rebuildResumable
![Page 9: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/9.jpg)
Object Size Estimation
![Page 10: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/10.jpg)
Tablespace Alerts
Database Generated Warning, Critical Out of the box
Tablespaces can be provisioned with more disk space before out-of-space conditions occur
![Page 11: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/11.jpg)
Tablespace Thresholds
85% Warning97% Critical
Alert
Add files
Freeing up space
97% Critical97% Critical
85% Warning85% WarningLocally Locally Managed Managed
TablespaceTablespace
Add FilesAdd Files
Free up spaceFree up space
Resolve SpaceResolve Space
ProblemProblem
![Page 12: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/12.jpg)
Alert Computation
Read only/Offline tablespaces: Do not setup alerts Temporary tablespace: Threshold corresponds to space
currently used by sessions. Undo tablespace: Threshold corresponds to space used
by active and unexpired extents. AUTOEXTENSIBLE files: Threshold is based on the
maximum file size.
MMON
85% Warning
97% Critical
Check every 10 mns
Alert
Alert Cleared
Cleared
In-Memory
Calculation
![Page 13: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/13.jpg)
Threshold Alert Tracking
SCNt210MB50MB
SCNt1 60MB100MBFile1
File2
Filen
…
…
File SizeAllocated Space
Change SCN
…
Instance1
SCNt210MB50MB
SCNt1 60MB100MBFile1
File2
Filen
…
……
Instance2
MMON MMON
Data aggregated
through GV$
Tablespace Size: 150M Allocated: 70M File1 File2
Tablespace
![Page 14: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/14.jpg)
Setting Thresholds Using EM
Changing database default thresholds Changing a particular tablespace thresholds
– Directly in the context of the tablespace– From the Edit Metric Thresholds page
![Page 15: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/15.jpg)
Tablespace Threshold Page
![Page 16: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/16.jpg)
Receiving Alerts in EM
![Page 17: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/17.jpg)
Growth Trend Report
Based on Automatic Workload Repository Data
Indicates past growth trend and predicts future growth pattern
![Page 18: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/18.jpg)
Growth Trend Report
![Page 19: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/19.jpg)
Segment Advisor
Determines whether an object is a good candidate for a shrink operation
– Based on unused space that can be released– Considers estimated future space requirements
EM allows you to apply the recommended shrink Can be invoked at the segment or tablespace level
![Page 20: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/20.jpg)
Segment Shrink
HWM
HWM
ShrinkOperation
Data UnusedSpace
UnusedSpace
Reclaimed Space
Online and Online and In-placeIn-place
ShrinkShrink
OperationOperation
![Page 21: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/21.jpg)
Benefits
ShrunkSegment
Faster access
Better space utilization
Online & In-place
![Page 22: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/22.jpg)
Candidate Segments
Auto Segment Space ManagedTablespace
Tables
IOTs
MaterializedViews
LOBs
Indexes
Row MovementEnabled
![Page 23: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/23.jpg)
Dependency Maintenance
DBA
Shrink
Index
Table
Trigger
Triggers are not fired
Indexes are maintained
Shrink
![Page 24: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/24.jpg)
How Can I Shrink Segments?
ALTER TABLE employees SHRINK SPACE CASCADE;
ALTER TABLE employees ENABLE ROW MOVEMENT; 1
2
ALTER … SHRINK SPACE [CASCADE]
TABLE INDEX MATERIALIZED VIEW MATERIALIZED VIEW LOG
MODIFY PARTITION MODIFY LOBMODIFY SUBPARTITION
![Page 25: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/25.jpg)
How Does it Work?
HWM
ALTER TABLE employees SHRINK SPACE COMPACT;
HWM
HWM
ALTER TABLE employees SHRINK SPACE;
1
2
![Page 26: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/26.jpg)
EM Interface
![Page 27: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/27.jpg)
Space Management : Before and Now
Before
Check to see which objects in the tablespace have pockets of wasted space due to deletion:
1. Create a script that looks at DBA_TABLES view to compare the total space allocated for each object (BLOCKS * DB_BLOCK_SIZE) in a tablespace to the estimated space used by the object (AVG_ROW_LEN * NUM_ROWS)
(assumes objects have been analyzed)
2. Review script output and identify target objects for reorganization
3. Identify/Create “scratch” tablespace
4. For each object to be reorganized, use the Enterprise Manager Reorg wizard to recreate each object along with its dependencies
Oracle10G
1. Launch Segment Advisor to advise on which object(s) to shrink
2. Accept the recommendations to shrink the objects online and in-place
Scenario: Reclaim Wasted Space
![Page 28: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/28.jpg)
Proactive Undo
Management
![Page 29: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/29.jpg)
Oracle Database 10g
Auto-sizing Undo Tablespace Auto-tuning Undo Retention Proactive Monitoring Undo Advisor
![Page 30: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/30.jpg)
Auto-sizing Undo Tablespace
A self-learning system– Create Undo tablespace with autoextensible files
– Run your workload
– Done!
(undo tablespace size adapts to the application)
![Page 31: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/31.jpg)
Auto-tuning Undo Retention
OLTP DSS
0
2000
4000
6000
TimeTu
ned U
R, se
cond
s Tuned UR
Query Length
Before Oracle 10g: Auto-tuning
Small RBS/UR = 15 min
Large RBS/UR = 5 hrs
![Page 32: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/32.jpg)
Proactive Monitoring: Alerts
Out of Undo Space Alert Long query warning Alert
Out of space Warning
Out of space Critical
7:00am 7:10 7:20 7:30 7:40…
ORA-1555 Failure
![Page 33: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/33.jpg)
Undo Advisor
Automatically analyzes the undo usage to advice optimal:
– Undo tablespace size to support your longest running query
– Undo tablespace size for a given undo retention period to support Undo based Flashback toolset
![Page 34: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/34.jpg)
Undo Home: Automatic Advice
![Page 35: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/35.jpg)
Undo Advisor: What if?
![Page 36: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/36.jpg)
Summary
Self-management engineered into the core of Oracle Database 10g
Self-management through:– Auto-sizing and size estimation– Built-in statistics gathering– Server-driven Alerts– Automatic Advisers– Auto-tuning to adapt to changing workload– Integration with the Enterprise Manager
![Page 37: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/37.jpg)
Next Steps….
Recommended sessions– The Self-Managing Database : Automatic Health
Monitoring (Thursday, Sept. 11, 11 AM)– Enterprise Manager : Scalable Oracle Management
(Thursday, Sept. 11, 1 PM) Recommended demos and/or hands-on labs
– Oracle Database 10g : Manage the Oracle Environment Hands-On Lab
– Campground Demo : “The Self-Managing Database: Space Management”
Relevant web sites to visit for more information– http://otn.oracle.com/products/manageability/database/
content.html
![Page 38: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/38.jpg)
Reminder: Please complete the OracleWorld online session survey
Session # 40170
Thank you.
![Page 39: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/39.jpg)
AQ&Q U E S T I O N SQ U E S T I O N S
A N S W E R SA N S W E R S
![Page 40: The Self-managing Database: Proactive Space and Schema Object Management Amit Ganesh Director, Data, Space and Transaction Processing Oracle Corporation.](https://reader035.fdocuments.us/reader035/viewer/2022062805/5697bff11a28abf838cbb31a/html5/thumbnails/40.jpg)