Capture-Replay Workloads between non-Autonomous and Autonomous Databases

You can Capture and Replay from a non-Autonomous Database instance into an Autonomous Database.

This enables you to compare workloads between an on-prem database or other cloud service database and an Autonomous Database instance.

Topics

Capture a Workload

The first step in using Database Replay is to capture the production workload.

When you begin workload capture on the production system, all requests from external clients directed to Oracle Database are tracked and stored in binary files called capture files.

A workload capture results in the creation of two subdirectories, cap and capfiles, which contain the capture files.

The capture files provide all pertinent information about the client request, including transaction details, bind values, and SQL text.

These capture files are platform independent and can be transported to another system.

See Workload Capture to capture a workload on an on-premises database.

Replay a Workload on an Autonomous Database Instance

After you complete a workload capture, you can replay it on a test system. Oracle replays on the test system the actions recorded during workload capture, with the same timing , concurrency, and transaction dependencies of the production system.

Run DBMS_CLOUD_ADMIN.REPLAY_WORKLOAD to initiate workload replay on your database. You must be logged in as the ADMIN user or have the EXECUTE privilege on DBMS_CLOUD_ADMIN to run REPLAY_WORKLOAD.

Example to replay on an Autonomous Database instance a workload captured from an on-premises database:

BEGIN 
   DBMS_CLOUD_ADMIN.REPLAY_WORKLOAD(
      location_uri    => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname/o',
      credential_name => 'CRED_TEST',   
      synchronization => TRUE,
      process_capture => TRUE);    
END;
/

This downloads the capture files contained in the Object Storage location specified in the location_uri parameter, and replays the workload capture from the capture files. The replay generates and uploads the replay and Automatic Workload Repository reports to the Object Storage location specified in the location_uri parameter.

In this example, namespace-string is the Oracle Cloud Infrastructure object storage namespace and bucketname is the bucket name. See Understanding Object Storage Namespaces for more information.

See Upload Files to Your Oracle Cloud Infrastructure Object Store Bucket for more information on uploading files to Object Storage.

See Navigate to Oracle Cloud Infrastructure Object Storage and Create Bucket for more information on Object Storage.

The credential_name parameter specifies the credential to access the object storage bucket. The credential that you supply must have the write privileges to write into the Object Storage bucket. The write privileges are required to upload the replay report to the bucket.

If you do not specify a credential_name value, then DEFAULT_CREDENTIAL is used.

You don't need to create a credential to access Oracle Cloud Infrastructure Object Store if you enable resource principal credentials. See Use Resource Principal to Access Oracle Cloud Infrastructure Resources for more information.

The synchronization parameter specifies the synchronization method used during workload replay. A TRUE value indicates that the synchronization is SCN based.

The process_capture specifies whether you need to specify process_capture value or not. A TRUE value indicates that the replay includes process_capture.

Note:

You must maintain the same logical state of the capture and replay databases at the start of the capture time.

See REPLAY_WORKLOAD Procedure for more information.

Workload Replay Events

You can subscribe to the Information event com.oraclecloud.databaseservice.autonomous.database.information to be notified about the WorkloadReplayBegin and WorkloadReplayEnd events. These events provide information about:

  • Start and completion of the REPLAY_WORKLOAD.

  • The replayDownloadURL field that contains the PAR URL to access the reports in Object Store. The PAR URL is valid for 7 days from the date of generation.

See Information Events on Autonomous Database for more information.

Workload Capture and Replay Views

You can query the DBA_CAPTURE_REPLAY_STATUS and DBA_CAPTURE_REPLAY_HISTORY views to check the workload replay status.

See DBA_CAPTURE_REPLAY_STATUS View and DBA_CAPTURE_REPLAY_HISTORY View for more information.