rac1:/> impdp directory=backupdumpfile=ANQING.DMPtransport_datafiles=/u02/app/oracle/oradata/anqing/ANQING01.DBFremap_schema=anqing:dave logfile=anqing.log
Import: Release 11.2.0.3.0 - Production onMon Feb 20 22:22:17 2012
Copyright (c) 1982, 2011, Oracle and/or itsaffiliates. All rights reserved.
Username: / as sysdba
Connected to: Oracle Database 11gEnterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Miningand Real Application Testing options
ORA-39002: invalid operation
ORA-39322: Cannot use transportabletablespace with timestamp with timezone columns and different timezone version.
测试环境是windows 到 Oracle Linux:
在windows 上查看timezone:
SQL> select * from v$version;
BANNER
----------------------------------------------------------------------------
Oracle Database 11g Enterprise EditionRelease 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 64-bit Windows: Version 11.2.0.1.0- Production
NLSRTL Version 11.2.0.1.0 – Production
SQL> SELECT NAME,VALUE$ FROM PROPS$WHERE NAME='DST_PRIMARY_TT_VERSION';
NAME VALUE$
-----------------------------------------------------------------------
DST_PRIMARY_TT_VERSION 11
在Linux 上查看timezone:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 -Production
NLSRTL Version 11.2.0.3.0 – Production
SQL> SELECT NAME,VALUE$ FROM PROPS$WHERE NAME='DST_PRIMARY_TT_VERSION';
NAME VALUE$
-------------------------------------------------------------------------------
DST_PRIMARY_TT_VERSION 14
rac1:/home/oracle> oerr ora 39322
39322, 00000, "Cannot usetransportable tablespace with timestamp with timezone columns and differenttimezone version."
// *Cause: The source database was at a different timesonze version than the
// target database and there were tables in the dumpfile with
// timestamp with timezone columns.
// *Action: Convert the target database to the same timezone version as the
// source database or use Data Pump without transportable tablespace.
二.解决方法:
MOS 上的说明:
Data Pump TTS Import Fails With ORA-39002And ORA-39322 Due To TIMEZONE Conflict [ID 1275433.1]
导致这个问题是source 和target 端timezones的不兼容,比如我们这里target 端的timezone 是14,高于source端的11. 当Data pump 检查dump 文件中timezones是否改变时,就会失败。
Oracle Database9i includes version 1 of the time zone files, and Oracle Database10g includes version 2. For Oracle Database 11g, release 2, all time zonefiles from versions 1 to 14 are included. Various patches and patch sets, whichare released separately for these releases, may update the time zone fileversion as well.
Oracle 9i 的time zone 文件version是1,10g 是2,到了11gR2,time zone files 可以从1到14.
默认情况下,11.2.0.1 的time zone 是11.
11.2.0.2的time zone 是14
11.2.0.3的time zone 是14.
对应的解决方法有两种:
2.1 解决方法一:创建一个新db 与 source 库 timezone相同
Create a newdatabase with the same timezone as the source database and use that to convertthe tablespace :
Before creatingthe new database set the environment variable, ORA_TZFILE, to match the sourcedatabase