Friday, September 10, 2010

Sql Profile Export&Import

Create Staging Table
==================
   exec DBMS_SQLTUNE.CREATE_STGTAB_SQLPROF (table_name=>'&stage_tab_name', schema_name=>'&Schema_Name');

Pack SQL Profile
==================
  EXEC DBMS_SQLTUNE.PACK_STGTAB_SQLPROF (staging_table_name => '&Stage_tab_name',profile_name=>'&Profile_name');

   Add more profile if you want with same command above. For multiple profiles, pl-sql code can be written to pack all profiles in one shot.

Export Staging Table
====================
    exp vazep/abc tables=SPM_0715,SPM_0719 file=spm_0719_exp.dmp log=spm0719_exp.log

Import Staging table on Target DB
=========================
    imp system/password file= file_name.dmp full=y log=mylog.lis

Unpack SQL Profile

    EXEC DBMS_SQLTUNE.UNPACK_STGTAB_SQLPROF(staging_table_name => '&Stage_Tab_Name');
    EXEC DBMS_SQLTUNE.UNPACK_STGTAB_SQLPROF(replace => TRUE,staging_table_name => '&Stage_Tab_Name');

No comments:

Post a Comment