Oracle DB Tuning-2
Oracle DB Tuning-2
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
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
time jobs
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
contention
Critical resources
CPU, memory, I/O capacity, network broadband
Capacity (how many?) Demand (how many?) Wait time (how long?) Consumption (how long?)
demand
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.)
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
Business rules
Normally other direction, but sometime business rule changed for better perf. Also, IT deployment strategy
Distributed Centralised
Data Design
Structure for data consistency AND performance Denormalisation
FAReports Summary values
Application Design
In view of DB In view of Oracle Data entry acceleration + Refer to business rules and notes on critical db operations
Logical DB structure
Mostly indexing Also locking strategy
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
Memory allocation
Dynamic process in Oracle Shared pool Parameters can be set manually
Make sure to keep decent SGA
Resource contention
Block contention Shared pool contention Lock contention All these can be diagnosed with Oracle stats
Platform
Need to talk to specialist
Eg: oracle staff
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
Trial and error in a trial environment Use multiple scenarios to test effect of each change Also test in combination Test for scalability (growth)
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