oracle 更改字符集
事件环境:
服务器A字符集和服务器B字符集不一致.
服务器A exp命令导出 dmp文件后,在服务器B上 imp导入中文出现乱码.
解决问题思路:更改服务器B上面oracle 服务的字符集(实质等同于服务器A oracle的字符集).
1 查看服务器A字符集
sql>conn sys as sysdba sql>select * from v$nls_parameters where parameter='NLS_CHARACTERSET';
2. 删除服务器B上面已经存在的用户表空间,并新建表空间用户
drop user IDHR cascade; drop tablespace IDHRDEVDB;
--初始化数据库信息 create tablespace IDHRDEVDB logging datafile 'D:\oraclexe\app\oracle\oradata\IDHRDEVDB\IDHRDEVDB.DBF' size 32m autoextend on extent management local; CREATE USER IDHR IDENTIFIED BY IDHR _0525 PROFILE DEFAULT DEFAULT TABLESPACE IDHRDEVDB ACCOUNT UNLOCK; grant all privileges to IDHR; grant sysdba to IDHR;
3.修改服务器B的oracle字符集
http://blog.csdn.net/lyn_bigdream/article/details/7473278
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;
4 再次在服务器B上面导入dmp数据
imp IDHR/IDHR_0525 file=F:\AIT\Lottes\DB\初始化数据库语句\Database\ss_hr.dmp log=F:\AIT\Lottes\DB\初始化数据库语句\Database\ss_hr.log fromuser=indonesiaprod2
5 远程连接服务器B 数据库,中文显示正常.