一导出:

#!/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

Logo

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。

更多推荐