Previous |
Next |
SQL Performance Analyzer supports testing database upgrades of Oracle9i and Oracle Database 10g Release 1 to Oracle Database 10g Release 2 and later releases by executing the SQL tuning set on the upgraded database remotely over a database link, as illustrated in Figure: SQL Performance Analyzer Workflow for Database Upgrade from Oracle9i to Oracle Database 10g Release 2. Because SQL Performance Analyzer only accepts a set of SQL statements stored in a SQL tuning set as its input source, and SQL tuning sets are not supported in Oracle9i, a SQL tuning set must be constructed so that it can be used as an input source for SQL Performance Analyzer if you are upgrading from Oracle9i.
SQL Performance Analyzer Workflow for Database Upgrade from Oracle9i to Oracle Database 10g Release 2
The production system which you are upgrading from should be running Oracle9i or Oracle Database 10g Release 1. The test system which you are upgrading to should be running Oracle Database 10g Release 2 or a newer release. The database version can be release 10.2.0.2 or higher. If you are upgrading to Oracle Database 10g release 10.2.0.2, 10.2.0.3, or 10.2.0.4, you will also need to install a one-off patch before proceeding.
To ensure that the analysis made by SQL Performance Analyzer is accurate, the test system should contain an exact copy of the data found on the production system because the performance on both systems will be compared to each other. Furthermore, the hardware configurations on both systems should also be as similar as possible.
Next, you will need to set up a separate SQL Performance Analyzer system running Oracle Database 11g Release 1 or a newer release. The database version should be release 11.1.0.7 or higher. You will be using this system to build a SQL tuning set and to run SQL Performance Analyzer. Neither your production data or schema need to be available on this system, since the SQL tuning set will be built using statistics stored in the SQL trace files from the production system. SQL Performance Analyzer tasks will be executed remotely on the test system to generate the execution plan and statistics for the SQL trial over a database link that you specify. The database link must be a public database link that connects to a user with the EXECUTE
privilege for the DBMS_SQLPA
package and the ADVISOR
privilege on the test system. You should also drop any existing PLAN_TABLE
from the user's schema on the test system.
Once the upgrade environment is configured as described, perform the steps as described in the following procedure to use SQL Performance Analyzer in a database upgrade from Oracle9i or Oracle Database 10g Release 1 to a newer release.
Enable the SQL Trace facility on the production system, as described in "Enabling SQL Trace on the Production System".
To minimize the performance impact on the production system and still be able to fully capture a representative set of SQL statements, consider enabling SQL Trace for only a subset of the sessions, for as long as required, to capture all important SQL statements at least once.
On the production system, create a mapping table, as described in "Creating a Mapping Table".
This mapping table will be used to convert the user and object identifier numbers in the SQL trace files to their string equivalents.
Move the SQL trace files and the mapping table from the production system to the SQL Performance Analyzer system, as described in "Creating a Mapping Table".
On the SQL Performance Analyzer system, construct a SQL tuning set using the SQL trace files, as described in "Building a SQL Tuning Set".
The SQL tuning set will contain the SQL statements captured in the SQL trace files, along with their relevant execution context and statistics.
On the SQL Performance Analyzer system, use SQL Performance Analyzer to create a SQL Performance Analyzer task and convert the contents in the SQL tuning set into a pre-upgrade SQL trial that will be used as a baseline for comparison, then remotely test execute the SQL statements on the test system over a database link to build a post-upgrade SQL trial, as described in "Running SQL Performance Analyzer to Test a Database Upgrade from Oracle9i Database and Oracle Database 10g Release 1".
Compare SQL performance and fix regressed SQL.
SQL Performance Analyzer compares the performance of SQL statements read from the SQL tuning set during the pre-upgrade SQL trial to those captured from the remote test execution during the post-upgrade SQL trial. A report is produced to identify any changes in execution plans or performance of the SQL statements.
If the report reveals any regressed SQL statements, you can make further changes to fix the regressed SQL, as described in "Tuning Regressed SQL Statements After Testing a Database Upgrade".
Repeat the process of executing the SQL tuning set and comparing its performance to a previous execution to test any changes made until you are satisfied with the outcome of the analysis.