You can store captured SQL statements in a SQL tuning set, and use it as an input source when creating a SQL Performance Analyzer task. SQL Performance Analyzer then uses the SQL tuning set as the source for test executing or generating execution plans for SQL trials.
If you use a SQL tuning set that was transported from a non-CDB to a multitenant container database (CDB) as the input source, the CDB identifiers of the SQL statements in the SQL tuning set must be remapped to make the STS usable in the CDB. Remapping CDB identifiers associates each SQL statement in the SQL tuning set with a CDB identifier that can be remapped to the corresponding pluggable databases (PDBs) within the CDB.
Typically, CDB identifiers should be remapped when the SQL tuning set is transported from a non-CDB to a CDB. In this case, you can simply use the SQL tuning set as an input source for SQL Performance Analyzer. However, if you are using a SQL tuning set whose CDB identifiers have not been remapped, you can specify the remapping as a SQL Performance Analyzer task property.
To remap CDB identifiers for an analysis task:
Use the SET_ANALYSIS_TASK_PARAMETER
procedure, as shown in the following example:
EXEC DBMS_SQLPA.SET_ANALYSIS_TASK_PARAMETER(task_name => 'non_cdb_spa1', - parameter => 'CON_DBID_MAPPING', - value => '1234:5678,1357:2468');
In this example, the CDB identifiers 1234
and 1357
are remapped to 5678
and 2468
, respectively.
After the CDB identifiers are remapped, SQL Performance Analyzer uses the new CDB identifier when it finds a match for the old CDB identifier, and executes the SQL statements in the appropriate PDB within the CDB.
Oracle Database SQL Tuning Guide for information about transporting SQL tuning sets
Oracle Database PL/SQL Packages and Types Reference for information about the DBMS_SQLPA.SET_ANALYSIS_TASK_PARAMETER
procedure