将一个模式的数据导出后,完全导入到另一个模式中,这个过程可能会出错,这是由于对于一些对象会参考其他的对象,而且通过schema.object_name的方式明确指出了所参考的对象,这种情况就有可能造成问题。但是现在碰到的这个问题更加奇怪,应该是Oracle的bug。
测试如下:
SQL> conn / as sysdba
Connected.
SQL> create user a identified by a;
User created.
SQL> grant resource, connect to a;
Grant succeeded.
SQL> grant create materialized view to a;
Grant succeeded.
SQL> create user b identified by b;
User created.
SQL> grant create materialized view to b;
Grant succeeded.
SQL> grant connect , resource to b;
Grant succeeded.
SQL> conn a/a
Connected.
SQL> select * from tab;
no rows selected
SQL> create table t (id number primary key);
Table created.
SQL> create materialized view log on t;
Materialized view log created.
SQL> create materialized view mv_t as select * from t;
Materialized view created.
SQL> insert into t values (1);
1 row created.
SQL> col change_vector$$ format a40
SQL> select * from mlog$_t;
ID SNAPTIME$$ D O CHANGE_VECTOR$$
---------- ---------- - - ----------------------------------------
1 01-1月 -00 I N FE
SQL> commit;
Commit complete.
SQL> exec dbms_mview.refresh('mv_t');
PL/SQL procedure successfully completed.
SQL> commit;
Commit complete.
SQL> select * from mv_t;
www.ixdba.net
ID
----------
1
SQL> host exp a/a file=test.dmp
Export: Release 9.2.0.4.0 - Production on 星期三 4月 6 18:03:58 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user A
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user A
About to export A's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export A's tables via Conventional Path ...
. . exporting table MLOG$_T 0 rows exported
. . exporting table MV_T 1 rows exported
. . exporting table RUPD$_T
. . exporting table T 1 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
SQL> host imp b/b file=test.dmp full=y
Import: Release 9.2.0.4.0 - Production on 星期三 4月 6 18:04:23 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.