进行数据库expdp full=y时,就报 :
[oracle@rac01 trace]$ expdp \'/ as sysdba\' directory=exp_dir dumpfile=full.dmp full=y
Export: Release 11.2.0.3.0 - Production on Tue Aug 23 22:40:02 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORA-39001: invalid argument value
ORA-01775: looping chain of synonyms
进行其他非full=y导出数据,又没有问题,开始怀疑有同义词没有对应表,这个问题,网上类似案例,都是指同义词和本身的对象不一致,但检查发现,又没有类似的情况出现,好像问题陷入僵局了。
能否看一下到底是哪个同义词有问题呢,如果能把具体的执行sql语句发出来看看就好了,答案是肯定的:
我们在执行expdp之前,先执行以下语句:
sql> alter system set events '1775 trace name ERRORSTACK level 3';
之后,再去执行expdp full=y, 这个时候肯定报错。
之后,关闭错误跟踪:
SQL> alter system set events '1775 trace name errorstack off';
然后,去检查$ORACLE_BASE/diag/rdbms/orcl/orcl1/下面的日志文件,
[oracle@rac01 trace]$ more orcl1_ora_20391.trc
Trace file /u01/app/oracle/diag/rdbms/orcl/orcl1/trace/orcl1_ora_20391.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1
System name: Linux
Node name: rac01
Release: 2.6.18-238.el5
Version: #1 SMP Tue Jan 4 15:41:11 EST 2011
Machine: x86_64
Instance name: orcl1
Redo thread mounted by this instance: 1
Oracle process number: 151
Unix process pid: 20391, image: oracle@rac01 (TNS V1-V3)
*** 2016-08-23 22:21:57.819
*** SESSION ID:(447.29885) 2016-08-23 22:21:57.819
*** CLIENT ID:() 2016-08-23 22:21:57.819
*** SERVICE NAME:(SYS$USERS) 2016-08-23 22:21:57.819
*** MODULE NAME:(ude@rac01 (TNS V1-V3)) 2016-08-23 22:21:57.819
*** ACTION NAME:() 2016-08-23 22:21:57.819
dbkedDefDump(): Starting a non-incident diagnostic dump (flags=0x0, level=3, mask=0x0)
----- Error Stack Dump -----
ORA-01775: looping chain of synonyms
----- Current SQL Statement for this session (sql_id=3d5vma7wxy003) -----
SELECT COUNT(*) FROM SYS_EXPORT_FULL_01
----- PL/SQL Stack -----
----- PL/SQL Call Stack -----
object line object
handle number name
0x7dab867e0 158 package body SYS.DBMS_DATAPUMP
0x7dab867e0 5213 package body SYS.DBMS_DATAPUMP
0x7c6cfcde0 1 anonymous block
----- Call Stack Trace -----
calling call entry argument values in hex
location type point (? means dubious value)
-------------------- -------- -------------------- ----------------------------
skdstdst()+36 call kgdsdst() 000000000 ? 000000000 ?
7FFF247AF378 ? 000000001 ?
000000001 ? 000000002 ?
...
找到问题语句为:
SELECT COUNT(*) FROM SYS_EXPORT_FULL_01
察看一下,这个sys_export_full_01是否有同义词:
SQL> r
1 select owner, object_name, object_type, status,CREATED , LAST_DDL_TIME from dba_objects where object_name like '%SYS_EXPORT_FULL_01%'
2*
OWNER OBJECT_NAME OBJECT_TYPE STATUS CREATED LAST_DDL_TIME
-------------------- ------------------------------ ------------------- ------- ----------------------- -----------------------
PUBLIC SYS_EXPORT_FULL_01 SYNONYM VALID 10-DEC-2013 16:15:18 10-DEC-2013 16:15:18
BACKUPUSER SYS_EXPORT_FULL_01 TABLE VALID 03-MAY-2011 01:37:03 03-MAY-2011 01:38:41
发现确实有一个同义词,把这个同义词删除,
SQL> drop public SYNONYM SYS_EXPORT_FULL_01;
再去执行 expdp full=y的数据导出 ,没有问题了 :
[oracle@rac01 trace]$ expdp \'/ as sysdba\' directory=exp_dir dumpfile=full.dmp full=y
Export: Release 11.2.0.3.0 - Production on Tue Aug 23 22:44:08 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_FULL_01": "/******** AS SYSDBA" directory=exp_dir dumpfile=full.dmp full=y
Estimate in progress using BLOCKS method...
说明,该问题参见metalink 文档 :459151.1
总结:
这个问题的关键点,就是如何对expdp,impdp 等之类的工具执行过程进行跟踪,解决了这个问题,基本问题就好处理了 。
|