ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle修改字符集

oracle修改字符集

原创 Linux操作系统 作者:流浪的野狼 时间:2013-07-03 17:14:08 0 删除 编辑
oracle修改字符集
 
查看oracle服务端编码:select * from sys.nls_database_parameters;
查看client编码:select * from sys.nls_session_parameters;
 
修改客户端编码:
翻开运转器进入注册表编辑
运转--》regedit
找到
HKEY_LOCAL_MACHINE/
 SOFTWARE/  www.2cto.com  
 ORACLE/KEY_OraDb10g_home1
 的变量NLS_LANG的值
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
改动成以下的值
SIMPLIFIED CHINESE_CHINA.AL32UTF8(效劳端编码)
 
服务端:
1. 在你的listener配置文件中增加实例信息
SID_LIST_LISTENER =  
  (SID_LIST =  
    (
SID_DESC =  
       (SID_NAME = PLSExtProc)  
       (ORACLE_HOME = F:\oracle\product\10.1.0\Db_1)  
       (PROGRAM = extproc)  
     )  
    (
SID_DESC =  
      (SID_NAME = orcl)  
      (ORACLE_HOME = F:\oracle\product\10.1.0\Db_1)  
    )  
  )
 
2. 修改oracle字符集
SQL> startup mount;
SQL> alter system enable restricted session;
SQL> alter system set job_queue_processes=0;
SQL> alter database open;  www.2cto.com  
SQL> alter database character set internal_use UTF8;
SQL> shutdown immediate;
SQL> startup
 
oracle查看字符集
select userenv('language') from dual;
     
Oracle10G,xe修改可以采用下面的方法
 
connect system as sysdba ;
shutdown immediate ;
startup mount ;
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 ; 
shutdown immediate ;
startup ;
       
老版本可以参考
 
STARTUP MOUNT; 
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 UTF8; 
ALTER DATABASE national CHARACTER SET UTF8; 
SHUTDOWN IMMEDIATE; 
STARTUP;  www.2cto.com  
Database character set (UTF8) and Client character set (ZHS16GBK) are different.
Character set conversion may cause unexpected results.
 
Note: you can set the client character set through the NLS_LANG environment variable or the NLS_LANG registry key in
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb11g_home1.
 
1)C:\Documents and Settings\Administrator>set NLS_LANG=american_america.AL32UTF8
2)
C:\Documents and Settings\Administrator>set NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
 
注册表  HKEY_LOCAL_MACHINE->software->oracle-》key_oradb11g_home1左侧的NLS_Lang
 
SIMPLIFIED CHINESE_CHINA.ZHS16GBK与SIMPLIFIED CHINESE_CHINA.AL32UTF8
转自:http://www.sogou.com/websnapshot?ie=utf8&url=http%3A%2F%2Fwww.2cto.com%2Fdatabase%2F201205%2F133453.html&did=cdcee220c0fdea58-118739695b133e15-407ded0b11061a4d731e3c35d69b81e2&k=d72a394f6b7462b21d35ae39365d977d&encodedQuery=%E4%BF%AE%E6%94%B9oracle%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86&query=%E4%BF%AE%E6%94%B9oracle%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86&&pid=AQxRG-3354&duppid=1&p=50040113&dp=1&w=01020400&m=0&st=1

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28612416/viewspace-765419/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-04-10

  • 博文量
    151
  • 访问量
    1507528