Toad / Import Utility / Import User to User 仍然在触发器中引用旧用户的模式

Toad / Import Utility / Import User to User still refer old User's schema in triggers

到目前为止,我知道将模式导入另一个数据库的最快方法是通过 Toad for Oracle "Import/Export Utility"。

但是,每次我们从模式 A 导入到模式 B(选择导入用户)时,触发器仍然引用旧模式。

例如,导入过程试图运行这个代码:

CREATE OR REPLACE TRIGGER B.CONTACT_DETAILS_bir 
 BEFORE INSERT ON A.CONTACT_DETAILS FOR EACH ROW
BEGIN
   SELECT A.CONTACT_DETAILS_seq.NEXTVAL
   INTO   :new.id
   FROM   dual;
 END;
/

不用说,脚本失败了,因为 A.CONTACT_DETAILS 在目标数据库中不存在。

有没有办法避免这种不匹配?

我已经询问了负责 Toad 这一领域的开发人员,这是他的回复;他不在 Whosebug 上。

The Import Utility is actually an Oracle product. Toad just gives you a GUI to create the command to run it. There's no parameter for IMP that I know of which will parse your triggers and change them so they point to the new schema. I don't know for sure, but I don't think that Oracle would consider it a bug. One way you could prevent the problem is by not specifying schema names at all in your trigger code. In that case, the trigger will assume that the table is in the same schema.