问题描述
用EXP导出时报错:
[oracle@testrac1 ~]$ exp \"/ as sysdba\" file=/home/oracle/audit_log.dmp tables=audit_log
Export: Release 11.2.0.4.0 - Production on Mon Jun 1 10:16:03 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Tes
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table AUDIT_LOG 22491788 rows exported
EXP-00091: Exporting questionable statistics.
Export terminated successfully with warnings.
问题原因
引起此问题的原因是数据库字符集和操作系统的NLS_LANG不一致导致
解决方法
指定Linux系统的NLS_LANG环境变量为数据库的数据集
1.查询数据库的字符集信息:
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
------------------------------------------
AMERICAN_AMERICA.AL32UTF8
2.设置Linux操作系统的NLS_LANG环境变量
[oracle@testrac1 ~]$ export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
3.重新EXP导出
[oracle@testrac1 ~]$ exp \"/ as sysdba\" file=/home/oracle/audit_log.dmp tables=audit_log
Export: Release 11.2.0.4.0 - Production on Mon Jun 1 10:41:03 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Tes
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table AUDIT_LOG 22491788 rows exported
Export terminated successfully without warnings.