11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

50 CHAPTER 1 ■ INSTALLING, UPGRADING, AND MANAGING CHANGEdbms_sqltune.load_sqlset(sqlset_name => 'upgrade_set',populate_cursor => cur);end;/PL/SQL procedure successfully completed.SQL>Now that you have captured a representative SQL workload from the production system,it’s time to export this STS to the test system where you’ll conduct the performance analysis.Transporting the SQL Tuning SetYou must first create a staging table using the create_stgtab_sqlset procedure before you canexport the STS you created in the previous step. This staging table is where you export the STSfrom the production database and subsequently import it from there to the test database. Hereare the steps in transporting the STS you captured from the production system:SQL> exec dbms_sqltune.create_stgtb_sqlset ( table_name => 'stagetab');The previous code creates a new staging table named stagetab.Once you create your staging table, it’s time to export the STS into that table by using thepack_stgtab_sqlset procedure:SQL> exec dbms_sqltune.pack_stgtab_sqlset(sqlset_name => 'upgrade_set',staging_table_name => 'stagetab');After the export of the STS from the production system is complete, you’re ready to importthe STS into the test system.Import the STS into the Test SystemAfter you use the Data Pump Export utility to export the staging table stagetab (which containsthe STS), use the Data Pump Import utility to load the staging table into your test system. Afteryou import the staging table, you must run the unpack_stgtab_sqlset procedure in order toimport the STS into the replay database:SQL> exec dbms_sqltune.unpack_stgtab_sqlset (sqlset_name = '%',replace => true, staging_table_name => ('stagetab');Once you successfully import the STS into the replay database, your next step is to createa SQL Performance Analyzer task, as explained in the next section.Creating a SQL Performance Analyzer TaskTo compare the execution of the captured production workload on the pre- and post-upgradetest environments, you must first create a SQL Performance Analyzer task, using the DBMS_SQLPApackage. Use the create_analysis_task procedure to create a tuning task for the STS youcreated earlier:SQL> exec dbms_sqlpa.create_analysis_task(sqlset_name => 'upgrade_set',task_name=> 'spa_task1');

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!