• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Techgoeasy

Techgoeasy

Learn Oracle, PHP, HTML,CSS,Perl,UNIX shell scripts

  • Home
  • Oracle
    • Oracle database
    • Oracle Ebusiness Suite
    • Oracle weblogic
    • Oracle Performance Tuning
    • Oracle Hyperion
    • Oracle Cloud Tutorials
  • SQL
  • interview questions
  • Linux
  • PHP and HTML
  • Downloads
  • General
Home » Oracle » Oracle Database » Move SQL Profiles from One Database to Another 

Move SQL Profiles from One Database to Another 

May 10, 2023 by techgoeasy Leave a Comment

In this post, we will check out how to move SQL Profiles from One Database to Another 

How to move the sql profiles

Suppose you have created a sql profile in System A and Now you want to transfer that sql profile to System B.

Step 1
On System A: Creating a staging table to store the SQL Profiles

exec DBMS_SQLTUNE.CREATE_STGTAB_SQLPROF(table_name=>'STAGE',schema_name=>'SCOTT');

Step 2
On System A: Pack the SQL Profiles into the Staging Table

exec DBMS_SQLTUNE.PACK_STGTAB_SQLPROF (staging_table_name =>'STAGE',profile_name=>'my_sql_profile');

Step 3
On System A: Export from Source Database

$ exp scott/tiger file=stage.dmp tables=stage

Step 4
On System B: Import the staging table

$ imp scott/tiger file=stage.dmp full=y

Step 5
On System B: Unpack Staging Table

If importing to the same schema, the schema owner does not need to be specified:

SQL> EXEC DBMS_SQLTUNE.UNPACK_STGTAB_SQLPROF(replace => TRUE,staging_table_name => 'STAGE');

However, if importing to a different schema, the staging schema owner needs to be changed:

SQL> EXEC DBMS_SQLTUNE.UNPACK_STGTAB_SQLPROF(replace => TRUE,staging_table_name => 'STAGE',staging_schema_owner => 'SQLTXPLAIN');

Step 6

On System B: Check if the profile is enabled

select * from table(dbms_xplan.display_cursor('&1', NULL, 'ALL'));

Filed Under: Oracle, Oracle Database

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar



Subscribe to our mailing list

Enter your email address to subscribe to this blog and receive notifications of new posts by email

Recent Posts

  • Move SQL Profiles from One Database to Another 
  • How to compare statistics using stattab for a table in Oracle
  • How to compare statistics using history for a table in Oracle
  • How to create environment variables in Windows
  • How to transfer statistics between databases

Copyright © 2023 : TechGoEasy

  • Hire me
  • Privacy Policy
  • Contact Us
  • New? Start Here
  • About Us
x
x