安装oracle11g 选择什么字符集,oracle 11g 更改字符集
工作需要,安裝裝了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窗口。
總結
以上是生活随笔為你收集整理的安装oracle11g 选择什么字符集,oracle 11g 更改字符集的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PhotoSwipe之参数options
- 下一篇: 74ls160 24进制异步计数器