create sql-plan baselines(export and import in new db):
connect as user1/@lan
BEGIN
DBMS_SPM.CREATE_STGTAB_BASELINE(
table_name => 'stage1');
END;
/
var x number;
begin
:x := DBMS_SPM.PACK_STGTAB_BASELINE('STAGE1','user1');
end;
expdp tables=user1.stage1 directory=DATA_PUMP file=baseline_lan.dmp logfile=baseline_lan.log
on lan2 database
alter USERS tablespace of whatever default tablespace for import user to at least 8G size
impdp tables=user1.stage1 directory=DATA_PUMP file=baseline_lan.dmp logfile=baseline_lan_imp.log
connect as user/@lan2
CREATE INDEX user1.wcc1 ON user1.STAGE1 (SQL_HANDLE, PLAN_ID,category,obj_type) tablespace USERS nologging;
var x number;
begin
:x := DBMS_SPM.UNPACK_STGTAB_BASELINE('STAGE1', 'user1');
end;
connect as user1/@lan
BEGIN
DBMS_SPM.CREATE_STGTAB_BASELINE(
table_name => 'stage1');
END;
/
var x number;
begin
:x := DBMS_SPM.PACK_STGTAB_BASELINE('STAGE1','user1');
end;
expdp tables=user1.stage1 directory=DATA_PUMP file=baseline_lan.dmp logfile=baseline_lan.log
on lan2 database
alter USERS tablespace of whatever default tablespace for import user to at least 8G size
impdp tables=user1.stage1 directory=DATA_PUMP file=baseline_lan.dmp logfile=baseline_lan_imp.log
connect as user/@lan2
CREATE INDEX user1.wcc1 ON user1.STAGE1 (SQL_HANDLE, PLAN_ID,category,obj_type) tablespace USERS nologging;
var x number;
begin
:x := DBMS_SPM.UNPACK_STGTAB_BASELINE('STAGE1', 'user1');
end;