源库:
[oracle@redhat31 ~]$ env |grep LANG
LANG=en_US.UTF-8
[oracle@redhat31 ~]$
SQL> select * from database_properties;
PROPERTY_NAME PROPERTY_VALUE
------------------------------ ----------------------------------------------------------------------------------------------------------------------------
DICT.BASE 2
DEFAULT_TEMP_TABLESPACE TEMP
DEFAULT_PERMANENT_TABLESPACE USERS
DEFAULT_TBS_TYPE SMALLFILE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET ZHS16GBK
NLS_CALENDAR GREGORIAN
PROPERTY_NAME PROPERTY_VALUE
------------------------------ ----------------------------------------------------------------------------------------------------------------------------
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
PROPERTY_NAME PROPERTY_VALUE
------------------------------ ----------------------------------------------------------------------------------------------------------------------------
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 10.2.0.1.0
GLOBAL_DB_NAME PROD.REGRESS.RDBMS.DEV.US.ORACLE.COM
EXPORT_VIEWS_VERSION 8
DBTIMEZONE 00:00
27 rows selected.
SQL>
SQL> exit
目标库:
[oracle@redhat32 ~]$ env |grep LANG
LANG=en_US.UTF-8
[oracle@redhat32 ~]$
SQL> select * from database_properties;
rows will be truncated
PROPERTY_NAME PROPERTY_VALUE
------------------------------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DICT.BASE 2
DEFAULT_TEMP_TABLESPACE TEMP
DEFAULT_PERMANENT_TABLESPACE USERS
DEFAULT_TBS_TYPE SMALLFILE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET ZHS16GBK
NLS_CALENDAR GREGORIAN
PROPERTY_NAME PROPERTY_VALUE
------------------------------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
PROPERTY_NAME PROPERTY_VALUE
------------------------------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 10.2.0.1.0
GLOBAL_DB_NAME PROD.REGRESS.RDBMS.DEV.US.ORACLE.COM
EXPORT_VIEWS_VERSION 8
DBTIMEZONE 00:00
27 rows selected.
未设置 NLS_LANG 时的导出:
[oracle@redhat31 ~]$ exp file=new4.dmp TABLESPACES=new TRANSPORT_TABLESPACE=y
Export: Release 10.2.0.1.0 - Production on Wed Aug 22 12:38:47 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: system/oracle as sysdba
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)
Note: table data (rows) will not be exported
About to export transportable tablespace metadata...
For tablespace NEW ...
. exporting cluster definitions
. exporting table definitions
. . exporting table NEW
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.
[oracle@redhat31 ~]$
未设置 NLS_LANG 时的导入:
[oracle@redhat32 ~]$ imp file=new4.dmp TRANSPORT_TABLESPACE=y TABLESPACES=new datafiles='/u01/app/oracle/oradata/omss/new01.dbf'
Import: Release 10.2.0.1.0 - Production on Wed Aug 22 09:37:51 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: sys/oracle as sysdba
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
About to import transportable tablespace(s) metadata...
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses ZHS16GBK character set (possible charset conversion)
. importing SYS's objects into SYS
. importing SYS's objects into SYS
IMP-00017: following statement failed with ORACLE error 604:
"BEGIN sys.dbms_plugts.commitPluggable; END;"
IMP-00003: ORACLE error 604 encountered
ORA-00604: error occurred at recursive SQL level 1
ORA-16000: database open for read-only access
ORA-06512: at "SYS.DBMS_PLUGTS", line 2119
ORA-06512: at line 1
IMP-00000: Import terminated unsuccessfully
[oracle@redhat32 ~]$
设置 NLS_LANG 时的导出:
[oracle@redhat31 ~]$ export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
[oracle@redhat31 ~]$
[oracle@redhat31 ~]$ env |grep LANG
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
LANG=en_US.UTF-8
[oracle@redhat31 ~]$
[oracle@redhat31 ~]$ exp file=new5.dmp TABLESPACES=new TRANSPORT_TABLESPACE=y
Export: Release 10.2.0.1.0 - Production on Wed Aug 22 12:53:26 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: system/oracle as sysdba
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
Note: table data (rows) will not be exported
About to export transportable tablespace metadata...
For tablespace NEW ...
. exporting cluster definitions
. exporting table definitions
. . exporting table NEW
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.
[oracle@redhat31 ~]$
设置 NLS_LANG 时的导入:
[oracle@redhat32 ~]$ export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
[oracle@redhat32 ~]$ env |grep LANG
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
LANG=en_US.UTF-8
[oracle@redhat32 ~]$
[oracle@redhat32 ~]$ scp 192.168.11.31:/home/oracle/new5.dmp .
password:
new5.dmp 100% 16KB 16.0KB/s 00:00
[oracle@redhat32 ~]$
[oracle@redhat32 ~]$ export ORACLE_SID=omss
[oracle@redhat32 ~]$ imp file=new5.dmp TRANSPORT_TABLESPACE=y TABLESPACES=new datafiles='/u01/app/oracle/oradata/omss/new01.dbf'
Import: Release 10.2.0.1.0 - Production on Wed Aug 22 10:15:43 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: sys/oracle as sysdba
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
About to import transportable tablespace(s) metadata...
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing SYS's objects into SYS
. importing SYS's objects into SYS
. importing SCOTT's objects into SCOTT
. . importing table "NEW"
. importing SYS's objects into SYS
Import terminated successfully without warnings.
[oracle@redhat32 ~]$
更多参考: