您的位置:首页

数据导入/导出

2013-05-17 15:39 239 查看
一、导出:

有时需要统一字符集:

查下系统的字符集:

SQL> select userenv('language') from dual;

USERENV('LANGUAGE')
-----------------------------
AMERICAN_AMERICA.ZHS16GBK


在客户端统一:

export LANG=zh_CN.GBK
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
单表导入:exp scott/tiger@test buffer=64000 file=/home/oracle/fd.dmp tables=table1
多表导入:
1)exp scott/tiger@test buffer=64000 file=/home/oracle/zw.dmp tables="(table1,table2,table3,table4)"
2)exp scott/tiger@test buffer=64000 file=/home/oracle/zw.dmp tables=table1,table2,table3,table4;

注:可以加log=/home/oracle/user1.log

二、导入:

单表导入:imp scott/tiger@test file=/home/oracle/fd.dmp tables=table1
多表导入:imp scott/tiger@test file=/home/oracle/hljjghd.dmp tables="(table1,table2,table3,table4)"

三、可能会遇到的问题:

错误一:
exp test/test file=test.dmp wner=test log=exp.log
出错
EXP-00056: Oracle error 29275 encountered
ORA-29275: partial multibyte character
EXP-00000: Export terminated unsuccessfully

原因:字符集不一致

oracle@MDSWEBDB01:>sqlplus/ as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Aug 29 15:35:12 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select value from NLS_DATABASE_PARAMETERS where parameter='NLS_CHARACTERSET';
VALUE
--------------------------------------------------------------------------------
AL32UTF8
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@MDSWEBDB01:>echo$NLS_LANG
AMERICAN_AMERICA.UTF8

解决方法:
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
再继续exp

错误二:ORA-12533:
TNS:illegal ADDRESS parameters

原因: 在tnsnames.ora 文件的ADDRESS 节指定不 正确。
措施:根据ADDRESS语法进行改正。 http://blog.csdn.net/xiaomai469933891/article/details/5387227
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: