oracle 11g更改字符集
来源:互联网 发布:淘宝商城服装质检报告 编辑:程序博客网 时间:2024/04/29 06:02
oracle 11g更改字符集
http://shiguanghui.iteye.com/blog/1931667工作需要,安装装了Oracle 11g,在导入其他机器上的备份数据的时间,发生一个错误:
IMP-00019: 由于 ORACLE 错误 12899 而拒绝行
IMP-00003: 遇到 ORACLE 错误 12899
ORA-12899: 列 "ZHENG"."D_DIC"."DICEXPLAIN" 的值太大 (实际值: 140, 最大值: 100)
这个数据表结构是直接注入的,根本不会这样子的啊。后来在网上查了才知道原来是字符集的问题:
在日志文件里,开始导入时候有这样一个提示:"
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入
导入服务器使用 AL32UTF8 字符集 (可能的字符集转换)
"原来在我的Windows server 2003系统上安装oracle,默认的字符集跟操作系统一致,是AL32UTF8。
AL32UTF8里,一个汉字是占用3个字符位,而一般我们用Windows XP中默认的是ZHS16GBK ,一个汉字用2个字符位。这样,直接导入数据就直接溢出了。
查看数据库的字符集
select * from v$nls_parameters;
select * from nls_database_parameters;
oracle数据库的字符集更改
[root@server183 /]# sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 7 23:50:56 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> conn / as sysdba --需要使用SYSDBA帐户
Connected.
SQL> startup mount
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown immediate; --停止数据库
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount --启动数据库到 mount 状态
ORACLE instance started.
Total System Global Area 1686925312 bytes
Fixed Size 2176368 bytes
Variable Size 989858448 bytes
Database Buffers 687865856 bytes
Redo Buffers 7024640 bytes
Database mounted.
SQL> alter session set sql_trace=true;
Session altered.
SQL> alter system enable restricted session;
System altered.
SQL> alter system set job_queue_processes=0;
System altered.
SQL> alter system set aq_tm_processes=0;
System altered.
SQL> alter database open;
Database altered.
SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK; --修改字符集AL32UTF8->ZHS16GBK
Database altered.
SQL> shutdown immediate; --再次关闭数据库
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP --启动数据库
ORACLE instance started.
Total System Global Area 1686925312 bytes
Fixed Size 2176368 bytes
Variable Size 989858448 bytes
Database Buffers 687865856 bytes
Redo Buffers 7024640 bytes
Database mounted.
Database opened.
SQL> select * from v$nls_parameters where parameter = 'NLS_CHARACTERSET';
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
client端字符集修改
在 /home/oracle与 /root用户目录下的.bash_profile中
添加或修改 export NLS_LANG="AMERICAN_AMERICA.UTF8" 语句
关闭当前ssh窗口。
- 上一篇微信公众平台开发者文档
- 下一篇乐视笔试题
- oracle 11g更改字符集
- Oracle 11G 更改字符集
- oracle 11g更改字符集
- oracle 11g更改字符集
- 从oracle 10g转到oracle 11g更改字符集
- ORACLE XE 11G 字符集更改为zhs16gbk
- Oracle 11g + Win Server 2008 R2 (64) + PLSQL使用 + 更改server端字符集
- Oracle 11g + Win Server 2008 R2 (64) + PLSQL使用 + 更改server端字符集
- 有关Oracle 10g 更改字符集的问题
- oracle 更改服务端字符集 更改oracle字符集
- oracle 10g 更改字符集 em资料库中的部分数据不能正确转换成新字符集
- Oracle更改字符集 ZHS16GBK
- oracle更改字符集
- Oracle字符集更改
- 更改oracle字符集
- 更改Oracle字符集
- Oracle更改字符集
- 如何更改Oracle字符集
- roll-pitch-yaw
- 第十三周项目5-拓扑排序算法的验证
- 选择排序-java实现
- c++中类模板详细讲述
- 检测视频中的人脸,并画出矩形框
- oracle 11g更改字符集
- Android资源知识(五)之Layer List
- 简单图片无缝滚动的实现
- SpringMVC常用注解2获取http请求中的cookie,header和ServletAPI
- VS2013(OPENCV、 C++)生成EXE文件在MATLAB上调用
- 第十二周项目1—图基本算法库
- 能力成长模型
- zigbee的网络寻址
- Android资源知识(六)之控件状态State List