设为首页 收藏本站
查看: 456|回复: 0

[经验分享] Oracle TTS ORA-39322: Cannot use transportable tablespace with different timezon

[复制链接]

尚未签到

发表于 2015-11-8 08:12:17 | 显示全部楼层 |阅读模式
  
一.问题描述
  
  Oracle 11.2.0.3 做TTS 测试,在impdp时报错,信息如下:
  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.
  
  Oracle 传输表空间的相关说明,参考:
  Oracle Transportable TableSpace(TTS) 传输表空间 说明
  http://blog.iyunv.com/tianlesoftware/article/details/7267582
  
  测试环境是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 timezone version by setting it to the appropriate value, for example:-


  $ export ORA_TZFILE=$ORACLE_HOME/oracore/zoneinfo/timezlrg_13.dat
  
- Import the source table space into the newly created database, for example:


  $ impdp userid=\&quot;/ as sysdba\&quot;directory=DATA_PUMP_EXADATA dumpfile=<SOURCE_DATA.dmp>
  
- Use the 'dbms_dst' package to upgrade the new database timezone to version 14( in this example).
- Note: The default timezone version for 11.2.0.2 is14..
  --注意11.2.0.2 的timezone 默认是14.
  
2.2 解决方法二:升级source db的Timezone
  Upgrade the thesource database Time Zone File and Timestamp with Time Zone Data (TSTZ) to thesame version as the target database version and redo the export.
  
  For the steps todo this upgrade see the &quot;Oracle Database Globalization Support Guide,11gRelease 2 (11.2)&quot; steps under &quot;Upgrading the Time Zone File andTimestamp with Time Zone Data&quot; here:
  http://download.oracle.com/docs/cd/E11882_01/server.112/e10729/ch4datetime.htm#CACFFHCJ
  
2.3 MOS 上的升级time zone 说明
  
  TSLTZ (TIMESTAMP WITH LOCAL TIME ZONE) dataand DST updates [ID 756454.1]
  How To Upgrade The Timezone File Older ThanVersion 11 Using DBMS_DST Package [ID 944122.1]
  Updating the RDBMS DST version in 11gR2(11.2.0.1 and up) using DBMS_DST [ID 977512.1]
  Actions For DST Updates When Upgrading ToOr Applying The 11.2.0.3 Patchset [ID 1358166.1]
  Actions For DST Updates When Upgrading ToOr Applying The 11.2.0.2 Patchset [ID 1201253.1]
  Actions For DST Updates When Upgrading To11.2.0.1 Base Release [ID 815679.1]
  
  
  官网上提到的方法是对于oracle 8i,9i,10g的time zone 升级到11g的方法,基本是运行utltzver.sql脚本,或对于11.2.0.1到11.2.0.3则是直接升级DB.
  我这里也直接升级DB,不采用其他的操作了。
  
这个问题引出的表空间传输的注意事项:
  TTS 要求source 和 Target 数据库版本一致,否则就出出现Time zone 的问题,导致impdp 无法成功进行。
  
  
  
  
  
  
  -------------------------------------------------------------------------------------------------------
  版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!
  Skype:  tianlesoftware
  Email:   tianlesoftware@gmail.com
  Blog:     http://www.tianlesoftware.com
  Weibo:  http://weibo.com/tianlesoftware
  Twitter: http://twitter.com/tianlesoftware
  Facebook: http://www.facebook.com/tianlesoftware
  Linkedin: http://cn.linkedin.com/in/tianlesoftware
  
  -------加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请----
  DBA1 群:62697716(满);   DBA2 群:62697977(满)  DBA3 群:62697850(满)  
  DBA 超级群:63306533(满);  DBA4 群:83829929   DBA5群: 142216823
  DBA6 群:158654907    DBA7 群:172855474   DBA总群:104207940
             版权声明:本文为博主原创文章,未经博主允许不得转载。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-136427-1-1.html 上篇帖子: ORA-19606: Cannot copy or restore to snapshot control file 下篇帖子: ORA-00265: instance recovery required, cannot set ARCHIVELOG mode
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表