Skip to content

Commit 8fdb0ed

Browse files
Merge pull request #1152 from oracle-devrel/uschwinn_dbreplay
Uschwinn dbreplay
2 parents a54d29c + 6d5e296 commit 8fdb0ed

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Database Replay (DB Replay)
2+
3+
Database Replay can be used to capture a real workload on the production system and replay it on a test system with the exact timing, concurrency, and transaction characteristics of the original workload. This enables you to test the effects of a system change without affecting the production system. Database Replay supports workload capture on a system running Oracle Database 10g Release 2 and newer releases. Because the database workload capture is stored in a platform-independent format, you can capture a workload on one OS platform, e.g. Windows, and replay on a different one, e.g. Linux. Keep in mind it should be used only within the Oracle Database. Other external components like application server, middleware, or client software cannot be considered when testing with Real Application Testing. Either the graphical interface via Enterprise Manager Cloud Control or the command-line API can be used.
4+
5+
6+
Reviewed: 02.07.2024
7+
8+
# When to use this asset?
9+
10+
To learn about Database Replay using the command line API.
11+
12+
# How to use this asset?
13+
14+
See the README in the files folder.
15+
16+
Please note: Database Replay for Autonomous Database (ADB) works differently. It can be used e.g. to replay a recorded (captured) workload from On-Premises or cloud installations in an Autonomous Database.
17+
For more details on the usage in ADB refer to the [documentation](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/autonomous-real-application-testing.html#GUID-EB8F065E-5FBB-480D-BAF6-5A0446740073) or the posting [Autonomous Database Replay](https://blogs.oracle.com/coretec/post/adb-database-replay).
18+
19+
# Useful Links
20+
21+
## Documentation
22+
23+
- [Testing Guide](https://docs.oracle.com/en/database/oracle/oracle-database/19/ratug/database-replay.html#GUID-C5CAF3E6-0F1C-4BD6-BC03-F71744AD600E)
24+
- [PL/SQL Packages and Types Reference - DBMS_WORKLOAD_CAPTURE](https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_WORKLOAD_CAPTURE.html#GUID-77C6507C-3DE6-4FB4-B180-530BEB840BE8)
25+
- [PL/SQL Packages and Types Reference - DBMS_WORKLOAD_REPLAY](https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_WORKLOAD_REPLAY.html#GUID-FE03A123-2257-41FF-BA90-AD0114DC1A4F)
26+
- [Test Workloads with Oracle Real Application Testing - Autonomous Database](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/autonomous-real-application-testing.html#GUID-EB8F065E-5FBB-480D-BAF6-5A0446740073)
27+
- [PL/SQL Packages and Types Reference for Autonomous Database - DBMS_CLOUD_ADMIN](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/dbms-cloud-admin.html#GUID-D76B229E-781E-45C0-9F14-CAF30F9E6E3B)
28+
29+
30+
## LiveLabs
31+
32+
- [Real Application Testing: SQL Performance Analyzer and Database Replay](https://apexapps.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=858&clear=RR,180&session=112790027738609)
33+
34+
35+
# Team Publication
36+
37+
- [Testing with Oracle Database Replay](https://blogs.oracle.com/coretec/post/testing-with-oracle-database-replay)
38+
- [Real Application Testing Database Replay Demo](https://blogs.oracle.com/coretec/post/rat-demo)
39+
- [Autonomous Database Replay](https://blogs.oracle.com/coretec/post/adb-database-replay)
40+
41+
42+
# License
43+
44+
Copyright (c) 2024 Oracle and/or its affiliates.
45+
46+
Licensed under the Universal Permissive License (UPL), Version 1.0.
47+
48+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
## Database Replay Scripts
2+
3+
This folder provides SQL scripts for the usage of Database Replay (DB Replay). Please adapt and change the scripts to your conditions.
4+
5+
## Scripts
6+
7+
You can find an example workflow, the executed scripts, and a detailed description in the posting [Testing with Oracle Database Replay](https://blogs.oracle.com/coretec/post/testing-with-oracle-database-replay).
8+
9+
Keep in mind that appropriate permissions are required to
10+
- Create directory objects
11+
- Use DBMS_WORKLOAD_CAPTURE and DBMS_WORKLOAD_REPLAY packages
12+
- Act as a replay client user (e.g. wrc someuser/YOUR_PASSWORD or wrc USER=someuser PASSWORD=YOUR_PASSWORD) //PLEASE CHANGE YOUR_PASSWORD TO A REAL PASSWORD!
13+
14+
In the documentation [DBMS_WORKLOAD_CAPTURE Security Model]( https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_WORKLOAD_CAPTURE.html#GUID-77C6507C-3DE6-4FB4-B180-530BEB840BE8) you will get the detailed information about it.
15+
16+
Before starting a workload capture, you should have a strategy in place to restore the database on the test system. Before a workload can be replayed, the logical state of the application data on the replay system should be similar to that of the capture system when replay begins.
17+
18+
In general, please follow the suggested script order.
19+
20+
### 1) Capture the Database Workload in the production environment
21+
22+
Before starting, check the [Workload Capture restrictions](https://docs.oracle.com/en/database/oracle/oracle-database/19/ratug/capturing-a-database-workload.html#GUID-4A1995F1-78F9-4080-8DFC-1E3EBCB3F4B8).
23+
24+
- Provide an empty database directory
25+
- (optional) Use filters: capturefilter.sql
26+
- Start capture: capturestart.sql
27+
- (optional) Stop capture: capturestop.sql
28+
- Check capture results: capturemon.sql
29+
- Export AWR: exportawr.sql
30+
- Capture report: capturereport.sql
31+
32+
(Note: it may be useful to generate an additional AWR spanning the capture period.)
33+
34+
### 2) Preprocess the (captured) Database Workload on the test environment
35+
36+
- Preprocess: processcapture.sql
37+
- (optional) Check duration: processmonitor.sql
38+
39+
### 3) Replay the Database Workload on the test environment
40+
41+
- (optional) Add filters: replayfilter.sql and replayfilterset.sql
42+
- Initialize the replay: replayinitialize.sql
43+
- (optional) Map connections: remapping.sql
44+
- (optional) Use filters: replayusefilterset.sql
45+
- Prepare the replay: replayprepare.sql
46+
47+
- Workload Replay clients: Number estimation and start
48+
49+
Estimate the number of Workload Replay Clients (WRCs) (e.g. $wrc mode=calibrate replaydir=../replay/..)
50+
51+
Start WRCs in the background on the replay machine or a separate machine (e.g. $wrc username/password mode=replay replaydir=../replay/...)
52+
53+
- Start the replay: replaystart.sql
54+
- Monitor the replay: replaymon.sql
55+
56+
### 4) Generate Reports
57+
58+
- (optional) Divergence reports: divergences.sql, divergence_detail.sql
59+
- Replay report: replayreport.sql
60+
- Import capture AWRs: importAWR.sql
61+
- ComparePeriod report: comparereplayreport.sql
62+
63+
(Note: it may be useful to generate an additional AWR spanning the replay period.)
64+
65+
# License
66+
67+
Copyright (c) 2024 Oracle and/or its affiliates.
68+
69+
Licensed under the Universal Permissive License (UPL), Version 1.0.
70+
71+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.

0 commit comments

Comments
 (0)