posts - 2, comments - 27, trackbacks - 0, articles - 60
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Oracle10g数据库导入导出(跨字符集)

Posted on 2010-07-25 11:53 ZhouFeng 阅读(3118) 评论(0)  编辑  收藏 所属分类: 转载DataBase
一导出:
#!/bin/bash
su - oracle -c "exp system/fakepass tables=$1 file=/data/$1.dmp"

[root@web oracle8i]# dmp album

Export: Release 10.1.0.3.0 - Production on 星期一 2月 5 01:56:55 2007

Copyright (c) 1982, 2004, Oracle.  All rights reserved.


连接到: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
已导出 ZHS16CGB231280 字符集和 AL16UTF16 NCHAR 字符集
服务器使用 ZHS16GBK 字符集 (可能的字符集转换)

即将导出指定的表通过常规路径...
. . 正在导出表                           ALBUM导出了         590 行
EXP-00091: 正在导出有问题的统计信息。
EXP-00091: 正在导出有问题的统计信息。
EXP-00091: 正在导出有问题的统计信息。
导出成功终止, 但出现警告。
二导入
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开
[oracle@dev ~]$ imp system/fit2007 file=blogcat.dmp tables=blogcat

Import: Release 10.2.0.1.0 - Production on 星期一 2月 5 01:44:39 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

经由常规路径由 EXPORT:V10.01.00 创建的导出文件
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入
导入服务器使用 AL32UTF8 字符集 (可能的字符集转换)
导出客户机使用 ZHS16CGB231280 字符集 (可能的字符集转换)
. 正在将 SYSTEM 的对象导入到 SYSTEM
. 正在将 SYSTEM 的对象导入到 SYSTEM
. . 正在导入表                       "BLOGCAT"导入了        1938 行
成功终止导入, 没有出现警告。
[oracle@dev ~]$ imp system/topsecret file=blogcat.dmp tables=blogcat
三总结
   2个oracle10g服务器,导出的在北京, 版本10.1.0.3.0, 使用 ZHS16GBK 字符集。
  导入的在宝鸡,临时开发测试用,版本 10.2.0.1.0,AL32UTF8 字符集。
  主要问题是2个服务器字符集不同,解决的关键是:在导入前,设置导入机器的NLS_LANG 与导出机器的NLS_LANG相同,为Simplified Chinese_china.ZHS16GBK
  全部导出的dmp文件有1.8G,学校服务器带宽有限,所以采用了导出常用数据表的最新数据方法。

转:http://www.zhuoda.org/hofman/78332.html

只有注册用户登录后才能发表评论。


网站导航: