Saturday 12 May 2012

Database Replay

DATABASE REPLAY


You can use Database Replay to capture a workload on the production system and replay it on a test system with the exact timing, concurrency, and transaction characteristics of the original workload. Database Replay supports workload capture on a system running Oracle Database 10g Release 2 and newer releases. In order to capture a workload on a system running Oracle Database 10g Release 2, the database version can be 10.2.0.4 or higher. Workload replay is only supported on systems running Oracle Database 11g Release 1 and newer releases.

CAPTURING THE WORKLOAD


Capturing a workload involves recording all requests made by external clients to Oracle Database.The capture files contain all relevant information about the client request, such as SQL text, bind values, and transaction information. Background activities and database scheduler jobs are not captured. These capture files are platform independent and can be transported to another system.

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 state of the application data on the replay system should be similar to that of the capture system when replay begins. To accomplish this, consider using one of the following methods:
  • Recovery Manager (RMAN) DUPLICATE command
  • Snapshot standby
  • Data Pump Import and Export

The following types of client requests are not captured in a workload:
  • Direct path load of data from external files using utilities such as SQL*Loader
  • Shared server requests (Oracle MTS)
  • Oracle Streams
  • Advanced replication streams
  • Non-PL/SQL based Advanced Queuing (AQ)
  • Flashback queries
  • Oracle Call Interface (OCI) based object navigations
  • Non SQL-based object access
  • Distributed transactions (any distributed transactions that are captured will be replayed as local transactions)

The user needs the DBA privilege in order to capture the workload.

PRE-PROCESSING THE WORKLOAD


Preprocessing a captured workload transforms the captured data into replay files and creates all necessary metadata.This must be done once for every captured workload before they can be replayed.AFTER THE CAPTURED WORKLOAD IS PREPROCESSED, IT CAN BE REPLAYED REPEATEDLY ON A REPLAY SYSTEM.


Once the workload has been captured, the information in the capture files need to be preprocessed. Preprocessing transforms the captured data into replay files and creates all necessary metadata needed for replaying the workload. This must be done once for every captured workload before they can be replayed. After the captured workload is preprocessed, it can be replayed repeatedly on a replay system running the same version of Oracle Database. Typically, the capture files should be copied to another system for preprocessing. As workload preprocessing can be time consuming and resource intensive, it is recommended that this step be performed on the test system where the workload will be replayed.

REPLAYING THE PREPROCESSED WORKLOAD


After the workload capture is preprocessed and the test system is properly prepared, the replay data can be initialized.Initializing replay data loads the necessary metadata into tables required by workload replay.

After the replay data is initialized, connection strings used in the workload capture need to be remapped so that user sessions can connect to the appropriate databases and perform external interactions as captured during replay.

After the replay data is initialized and the connections are appropriately remapped, you need to prepare the database for workload replay.

Before a workload can be replayed, the application data state should be logically equivalent to that of the capture system at the start time of workload capture.The primary purpose of Database Replay is to test the effect of system changes on a captured workload.

It is recommended that the SYSTEM TIME ON THE REPLAY SYSTEM HOST be changed to a value that approximately matches the capture start time just before replay is started.Otherwise, an invalid data set may result when replaying time-sensitive workloads.

A captured workload may contain REFERENCES TO EXTERNAL SYSTEMS, such as database links or external tables, Directory Objects , URLs and Emails. Typically, you should reconfigure these external interactions to avoid impacting other production systems during replay

The replay user needs the DBA role and cannot be the SYS user.

After a captured workload has been preprocessed, it can be replayed on a test system. During the workload replay phase, Oracle Database performs the actions recorded during the workload capture phase on the test system by re-creating all captured external client requests with the same timing, concurrency, and transaction dependencies of the production system.

Database Replay uses a client program called the replay client to re-create all external client requests recorded during workload capture. Depending on the captured workload, you may need one or more replay clients to properly replay the workload. A CALIBRATION TOOL is provided to help determine the number of replay clients needed for a particular workload.


No comments:

Post a Comment