注:如果从AL32UTF8字符集的数据库expdp/exp的数据,impdp/imp到WE8MSWIN1252字符集的库,所有的中文字符都是以???的形式存在。即使已经导入后,把WE8MSWIN1252字符的库按照如下改为AL32UTF8也不可以,必须重新impdp/imp导入才ok。
很好用。
1、WE8MSWIN1252转换成AL32UTF8
shutdown immediate; STARTUP MOUNT; ALTER SESSION SET SQL_TRACE=TRUE; ALTER SYSTEM ENABLE RESTRICTED SESSION; ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0; ALTER SYSTEM SET AQ_TM_PROCESSES=0; ALTER DATABASE OPEN; ALTER DATABASE character set INTERNAL_USE AL32UTF8; ALTER SESSION SET SQL_TRACE=FALSE; shutdown immediate; startup; select * from nls_database_parameters;
2、AL32UTF8转换成ZHS16GBK
shutdown immediate; STARTUP MOUNT; ALTER SESSION SET SQL_TRACE=TRUE; ALTER SYSTEM ENABLE RESTRICTED SESSION; ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0; ALTER SYSTEM SET AQ_TM_PROCESSES=0; ALTER DATABASE OPEN; ALTER DATABASE character set INTERNAL_USE ZHS16GBK; --设置INTERNAL_USE指令不对字符集超集进行检查: ALTER SESSION SET SQL_TRACE=FALSE; shutdown immediate; startup; select * from nls_database_parameters;