Professional Documents
Culture Documents
11g Real Application Testing
11g Real Application Testing
Price (?)
Business Benefit
Faster technology adoption Lower risk
Change
Remediate
Database Replay
Database Replay
Recreate actual production database workload in test environment Identify, analyze and fix potential instabilities before making changes to production Capture Workload in Production
Capture full production workload with real load & concurrency info Move the captured workload to test system Make the desired changes in test system Replay workload with production load & concurrency Honor commit ordering Errors Data divergence Performance divergence
Client
Changes Unsupported
Middle Tier
Changes Supported
Database Upgrades, Patches Schema, Parameters RAC nodes, Interconnect
OS Platforms, OS Upgrades
CPU, Memory Storage Etc.
60 40 20
24 4 0
Understand Application Usage
20 0
Identify Key Transactions
20 5 2
Generate Workload LoadRunner DB Replay
5
Run Test
Why DB Replay?
From:
Artificial workloads Partial workflows Months of development Manual intensive 150 Days High risk
To:
Production workloads Complete workflows Days of development
Automated
Low risk 10 Days
10
File System
Middle Tier
File 1
File 2
File n
Storage
11
Capture Options
Workload can be filtered to customize what is captured
Filter Types Inclusion Filters: Specifies which sessions should be captured Exclusion Filters: Specifies which sessions should NOT be captured Filter Attributes: Workload capture can be filtered using any of the following session attributes User Program Module Action Service Session ID
12
Test System
Processing transforms captured data into replay files and generates necessary meta-data Must be done on same version of database as replay system Recommended to process on test system Once processed, workload can be replayed many times For RAC, if using local file system, copy all capture files to single location for replay
File n
File n
13
Replay Driver
Replay Client Replay Client
File 1 File 2
File n
Metadata
Replay Files
14
Replay Options
Synchronized Replay
Workload is replayed in full synchronized mode Exact same concurrency and timing as production workload Transaction commit order is honored Ensures minimal data divergence Workload can be replayed in unsynchronized mode Useful for load/stress testing High Data Divergence Three (3) parameters provided to control degree of synchronization
Think time synchronization Commit order synchronization Connect (logon) time synchronization
Unsynchronized Replay
15
Replay Options
Unsynchronized Replay Parameters
Think time synchronization
Controls think time between database calls Auto (Default): Adjusts think time so as to maintain captured request rate Percentage
0% No think time, highest possible request rate <100% Higher request rate 100% Exact think time >100% Lower request rate
16
Replay Options
Number of Replay Clients
Configurable by user Client Calibration Advisor recommends number of replay clients needed for specific workload Replay clients are multithreaded clients that can drive multiple workload sessions each
17
18
19
20
Best Practices
Capture
Provide adequate disk space for captured workload (binary files) Database restart (Optional): Recommended to minimize divergence during replay For RAC, use shared file system
Ensure data in test is identical to production as of capture start time to minimize data divergence during replay Use RMAN backup/restore or Snapshot Standby feature to setup test system Reset system clock to same time as production if application logic involves SYSDATE usage
Processing workload has performance overhead and can possibly take a long time Process workload on test system after rather than production system
Process Workload
Replay
Use Client Calibration Advisor to identify number of replay clients needed to replay workload properly
21
DBMS_WORKLOAD_REPLAY
PROCESS_CAPTURE,INITIALIZE_REPLAY, PREPARE_REPLAY(), START_REPLAY(), CANCEL(), REPORT, ADD_FILTER, REMAP_CONNECTION
Capture and Replay user can be different if they have appropriate privileges
22
23
Client
Middle Tier
Capture SQL
Oracle DB
Storage
24
SPA Benefits
Enables identification of SQL performance regressions before end-users can be impacted SPA can help with any change that impacts SQL execution plan
DB upgrades Optimizer statistics refresh New indexes, Materialized Views, Partitions, etc.
Fix regressed SQL with SQL Tuning Advisor and SQL Plan Baselines Integrated with query optimizer Captures SQL workload with low overhead
25
Initial Environment
Post-Change Environment
Tuned Environment
Re-execute SQL
Compare Performance
26
Cursor Cache
Incremental Capture
Incremental capture used to populate STS from cursor cache over a time period
SQL tuning sets filtering and ranking capabilities filters out undesirable SQL
Production Database
27
Cursor Cache
Export/Import
Production Database
Test Database
Copy SQL tuning set to staging table (pack) Transport staging table to test system (datapump, db link, etc.) Copy SQL tuning set from staging table (unpack)
28
Before change SQL performance version is the SQL workload performance baseline
SQL Performance = execution plans + execution statistics Test-Execute SQL in SQL tuning set: produce execution plans and statistics execute SQL serially (no concurrency) every SQL is executed only once skip DDL/DML effects Explain plan SQL in SQL tuning set to generate SQL plans only
Test Execute
29
Test Execute
30
Analysis Report
Tune regressed SQL using SQL Tuning Advisor Analysis results can be used to seed SQL Plan Management repository
31
32
33