Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS)...
-
Upload
mackenzie-tattersall -
Category
Documents
-
view
215 -
download
2
Transcript of Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS)...
![Page 1: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/1.jpg)
Advanced Oracle DB tuning
• Performance can be defined in very different ways (OLTP versus DSS)
• Specific goals and targets must be set => clear recognition of success
• Factors include response time and throughput
• Oracle specific tuning
![Page 2: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/2.jpg)
Response time
• Sum of service time + wait time
• Processing strategy has key effect on response time– Eg: Sequential processing– In a queue, wait time for a job = sum of
service time of all previous jobs
• If queue gets longer parallel processing required
![Page 3: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/3.jpg)
response time in Sequential and Parallel processing
time
jobs
Wait time
Service time
jobs
![Page 4: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/4.jpg)
System Throughput
• Amount of work completed in a given time• Reduced service time = increased throughput• Increase in resources = reduced response time• Under load, contention increases…
– Service may remain the same– But queues get longer
• In practice, wait time raises exponentially– O/S scheduler– DB dispatcher
Wait time
contention
arbitration
![Page 5: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/5.jpg)
Critical resources
• CPU, memory, I/O capacity, network broadband– Capacity (how many?)– Demand (how many?)– Wait time (how long?)– Consumption (how long?)
• Software issue as much as hardware issue– Quality of design / programming– Prioritise jobs Performance loss
demand
Resource sh
ift
![Page 6: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/6.jpg)
Performance adjustments
• Reduce consumption (use fewer resources & reduce I/O per transac.)
• Demand (reschedule / redistribute work)
• Capacity (increase / relocate res. – eg: move to parallel proc, increase mem.)
![Page 7: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/7.jpg)
Problems for DBAs
• Many performance parameters are set at design stage => limited scope to adjust
• Important targets set at outset => bottlenecks can be identified
• Administer trade-offs– More $$$– Else reschedule to limit contention
• Properly manage user expectations– Eg DB versus network problems
• Never sacrifice ability to recover data!
![Page 8: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/8.jpg)
Performance tuning
• Always better pro-active =>DBA in development team
• On-going tasks minimised by good planning– Service time – marginal improvements only– Eg SOCRATE case study
• Oracle prioritised tuning steps for application dev.
![Page 9: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/9.jpg)
Oracle tuning methodology
• Tune business rules• Tune data design• Tune application design• Tune logical structure• Tune database operations• Tune access paths• Tune memory allocation• Tune I/O and physical structure• Tune resource contention• Tune platform
![Page 10: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/10.jpg)
Business rules
• Normally other direction, but sometime business rule changed for better perf.
• Also, IT deployment strategy– Distributed– Centralised
• Stick to high level analysis of req. => more freedom (!?)– Cheque printing versus direct deposit– Threshold value for automatic approuval
• More flexibility in design
![Page 11: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/11.jpg)
Data Design
• Structure for data consistency AND performance
• Denormalisation– FAReports– Summary values
• Data “hot spot”
![Page 12: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/12.jpg)
Application Design
• In view of DB
• In view of Oracle
• Data entry acceleration
+ Refer to business rules and notes on critical db operations
![Page 13: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/13.jpg)
Logical DB structure
• Mostly indexing
• Also locking strategy
![Page 14: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/14.jpg)
DB operations
• Post relational DBs – eg: oracle
• Extended SQL functions
• New DB functions
• See Oracle stats on query execution
• Also pl/sql server side programming better than application code
• Query optimiser may provide clues– Eg: Temporary index on non key attribute
![Page 15: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/15.jpg)
Memory allocation
• Dynamic process in Oracle
• Shared pool
• Parameters can be set manually– Make sure to keep decent SGA
• See notes on DB creation
![Page 16: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/16.jpg)
I/O and physical design
• Use multiple disks + parallel controllers
• Optimise block size (see notes on DB creation)
• Use extents large enough for indexes
• Avoid use of pctincrease in OLTP tables
• Use raw device
![Page 17: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/17.jpg)
Resource contention
• Block contention
• Shared pool contention
• Lock contention
• All these can be diagnosed with Oracle stats
![Page 18: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/18.jpg)
Platform
• Need to talk to specialist– Eg: oracle staff
• Different for different OS
• Cache size
• Paging strategies etc…
![Page 19: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/19.jpg)
Application
• Always start with specific objectives else never achieve anything!– Max response times for inquiry– maximum processing time for document
• Picking list• Invoice• Month end
• Goals may conflict, DBA arbitrates
![Page 20: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/20.jpg)
Create repeatable tests
• SQL statements– New versus old in SQL +– SQL Trace enabled
• Trial and error in a trial environment
• Use multiple scenarios to test effect of each change
• Also test in combination
• Test for scalability (growth)
![Page 21: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/21.jpg)
Keep records and automate testing
• Write recording into your scripts (table)
• Run scripts on a timer
• Measure against objectives and past perf.
• Stop when goals achieved
![Page 22: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/22.jpg)
Oracle diagnostic tool
• Explain plan
• Oracle trace
• Can be run in combination to compare actuals to estimates
![Page 23: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/23.jpg)
Oracle Enterprise Manager
• Common interface for all utilities
• Diagnosis + implementation of changes
• See table 17.4
![Page 24: Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518a061550346b31f8b482a/html5/thumbnails/24.jpg)
Benchmarking
• Use in product selection– Vendor bias?– Env tuned for test only– Not repeatable without access to unlimited resources– Hidden cost of table maintenance outside the test.
• Cited by every DB vendor on this planet• Creation of the TPC (Transaction Processing
Performance Council)– TPC – C: order entry benchmark– TPC – H and TCP – R: decision support benchmark– TPC – A: web transaction benchmark
• Open source DB benchmark