一、导出:
有时需要统一字符集:
查下系统的字符集:
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