After AWR data is exported from the capture system, you can import the AWR data into another system, such as a test system where the captured workload will be replayed. Importing AWR data enables detailed analysis of the workload. This data is also required if you plan to run the Replay Compare Period report or the AWR Compare Period report on a pair of workload captures or replays.
To import AWR data:
Use the IMPORT_AWR
function, as shown in the following example:
CREATE USER capture_awr SELECT DBMS_WORKLOAD_CAPTURE.IMPORT_AWR (capture_id => 2, staging_schema => 'capture_awr') FROM DUAL;
In this example, the AWR snapshots that correspond to the workload capture with a capture ID of 2 are imported using a staging schema named capture_awr
.
The IMPORT_AWR
procedure in this example uses the following parameters:
The capture_id
required parameter specifies the ID of the capture whose AWR snapshots will be import. The value of the capture_id
parameter is displayed in the ID
column of the DBA_WORKLOAD_CAPTURES
view.
The staging_schema
required parameter specifies the name of a valid schema in the current database which can be used as a staging area while importing the AWR snapshots from the capture directory to the SYS
AWR
schema.
This function fails if the schema specified by the staging_schema
parameter contains any tables with the same name as any of the AWR tables.
Oracle Database Reference for information about the DBA_WORKLOAD_CAPTURES
view