To transport a SQL profile:
- Connect SQL*Plus to the database with the appropriate privileges, and then use the
CREATE_STGTAB_SQLPROFprocedure to create a staging table to hold the SQL profiles.The following example createsmy_staging_tablein thedba1schema:BEGIN DBMS_SQLTUNE.CREATE_STGTAB_SQLPROF ( table_name => 'my_staging_table' , schema_name => 'dba1' ); END; / - Use the
PACK_STGTAB_SQLPROFprocedure to export SQL profiles into the staging table.The following example populatesdba1.my_staging_tablewith the SQL profilemy_profile:BEGIN DBMS_SQLTUNE.PACK_STGTAB_SQLPROF ( profile_name => 'my_profile' , staging_table_name => 'my_staging_table' , staging_schema_owner => 'dba1' ); END; / - Move the staging table to the database where you plan to unpack the SQL profiles.Move the table using your utility of choice. For example, use Oracle Data Pump or a database link.
- On the database where you plan to import the SQL profiles, use
UNPACK_STGTAB_SQLPROFto unpack SQL profiles from the staging table.The following example shows how to unpack SQL profiles in the staging table:BEGIN DBMS_SQLTUNE.UNPACK_STGTAB_SQLPROF( replace => true , staging_table_name => 'my_staging_table' ); END; /
No comments:
Post a Comment