IMP-00003

来源:互联网 发布:淘宝运营怎么 编辑:程序博客网 时间:2024/05/16 15:40

"BEGIN   SYS.DBMS_SNAPSHOT_UTL.SYNC_UP_LOG('HIS3BZ','MZ_GUAHAODY'); END;"
IMP-00003: 遇到 ORACLE 错误 1435
ORA-01435: 用户不存在
ORA-06512: 在 "SYS.DBMS_ISNAPSHOT", line 108
ORA-06512: 在 "SYS.DBMS_SNAPSHOT_UTL", line 1666
ORA-06512: 在 line 1
IMP-00000: 未成功终止导入


http://forums.oracle.com/forums/thread.jspa?threadID=669940

Import FROMUSER TOUSER errors with ORA-942 (Table does not Exist) in SYS.DBMS_SNAPSHOT_UTL.SYNC_UP_LOG [ID 294625.1]     
________________________________________
     Modified 19-FEB-2009     Type PROBLEM     Status PUBLISHED     

The information in this article applies to:
- Oracle Server - Enterprise Edition - Version: 8.1.7.0 to 10.2.0.0
- Oracle Server - Personal Edition   - Version: 8.1.7.0 to 10.2.0.0
- Oracle Server - Standard Edition   - Version: 8.1.7.0 to 10.2.0.0
This problem can occur on any platform.


ERRORS
------

IMP-00017: following statement failed with ORACLE error 942:
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT_UTL", line 1589
ORA-06512: at line 1


SYMPTOMS
--------

You have created a snapshot log:

SQL> connect system/manager
SQL> grant create snapshot to scott;

SQL> connect scott/tiger
SQL> create snapshot my_snap as select * from emp;
SQL> create snapshot log on scott.emp;


You run a user level export:

% exp system/manager file=exp_s.dmp log=exp_s.log owner=scott

Export: Release 9.2.0.6.0 - Production on Tue Dec 28 08:06:12 2004
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
...
Export terminated successfully without warnings.


You run a user level import, e.g. in a different database:

SQL> connect system/manager
SQL> create user hugo identified by hugo default tablespace
       users temporary tablespace temp
       quota unlimited on users;
SQL> grant create session, create table, create snapshot
     to hugo;

% imp system/manager file=exp_s.dmp log=imp_s.log fromuser=scott touser=hugo

Import: Release 9.2.0.6.0 - Production on Tue Dec 28 08:08:16 2004
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
...
. importing SCOTT's objects into HUGO
. . importing table                        "BONUS"          0 rows imported
. . importing table                         "DEPT"          4 rows imported
. . importing table                          "EMP"         14 rows imported
. . importing table                    "MLOG$_EMP"          0 rows imported
. . importing table                      "MY_SNAP"         14 rows imported
. . importing table                     "SALGRADE"          5 rows imported
IMP-00017: following statement failed with ORACLE error 942:
 "BEGIN   SYS.DBMS_SNAPSHOT_UTL.SYNC_UP_LOG('SCOTT','EMP'); END;"
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT_UTL", line 1589
ORA-06512: at line 1

Note that the line number in the first ORA-6512 error my differ between
versions:
- in  8.1.7.4.0: ORA-06512: at "SYS.DBMS_SNAPSHOT_UTL", line 1033
- in  9.2.0.6.0: ORA-06512: at "SYS.DBMS_SNAPSHOT_UTL", line 1589
- in 10.1.0.3.0: ORA-06512: at "SYS.DBMS_SNAPSHOT_UTL", line 1599
- in 10.2.0.4.0: ORA-06512: at "SYS.DBMS_SNAPSHOT_UTL", line 1666

Also note that the same errors occur when the export was done with a table
level export.

If the user SCOTT (FROMUSER) does not exist in the target database,
import aborts with:

 "CREATE SNAPSHOT LOG ON "SCOTT"."EMP" WITH PRIMARY KEY EXCLUDING NEW VALUES"
 "USING ("MLOG$_EMP", (...left_out...))"
IMP-00003: ORACLE error 1435 encountered
ORA-01435: user does not exist
IMP-00000: Import terminated unsuccessfully


CAUSE
-----

Snapshots, snapshot logs, and related items are exported with the schema name
explicitly given in the DDL statements; therefore, snapshots and their related
items cannot be imported into a different schema.

If you attempt to use FROMUSER and TOUSER to import snapshot data, an error
will be written to the Import log file and the items will not be imported.


FIX
---

It is expected behavior that the snapshot log cannot be imported with a
FROMUSER and TOUSER import. Therefore the errors should either be prevented
from happening, or be ignored:

1. Either delete the snapshot logs before the export takes place. Then run
the export and import. After import completes, re-create the snapshot logs
manually, and if necessary, perform a refresh of the snapshot.

2. Or ensure that the FROMUSER (SCOTT in this example) exists in the target
database, so the import session does not abort with the IMP-0 error
(Import terminated unsuccessfully). During the import, ignore the errors
that are related to the snapshot logs. After import completes, re-create
the snapshot logs manually, and if necessary, perform a refresh of the
snapshot.


REFERENCE
---------
Manual "Oracle9i Database Utilities Release 2 (9.2)", Chapter 2 "Import",
       section "Materialized Views and Snapshots"
Bug:2517178 "IMP-17 AND ORA-942 ERROR DURING IMPORT"