oracle修改中文,oracle修改英文字符集to中文字符集

转自: http://blog.csdn.net/chssheng2007/archive/2010/09/15/5886161.aspx

按如下方式修改:

查看当前字符集

引用

SQL> select * from nls_database_parameters where parameter like '%SET%';

PARAMETER                      VALUE

------------------------------ ----------------------------------------

NLS_CHARACTERSET               WE8ISO8859P1

NLS_NCHAR_CHARACTERSET         AL16UTF16

引用

SQL> select userenv('language') from dual;

USERENV('LANGUAGE')

----------------------------------------------------

AMERICAN_AMERICA.WE8ISO8859P1

尝试直接修改字符集

引用

SQL> ALTER DATABASE CHARACTER SET ZHS16GBK;

ALTER DATABASE CHARACTER SET ZHS16GBK

*

ERROR at line 1:

ORA-12712: new character set must be a superset of old character set

采用Oracle内部命令修改字符集(注意:此流程仅用于测试,在Oracle 10g中建议用CSALTER修改!)

引用

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

Total System Global Area  167772160 bytes

Fixed Size                  1218316 bytes

Variable Size              62916852 bytes

Database Buffers          100663296 bytes

Redo Buffers                2973696 bytes

Database mounted.

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;

Database altered.

修改时alert日志显示:

引用

Completed:  ALTER DATABASE OPEN

Tue May 18 10:56:43 2010

ALTER DATABASE CHARACTER SET INTERNAL_USE zhs16gbk

Tue May 18 10:56:47 2010

Updating character set in controlfile to ZHS16GBK

Synchronizing connection with database character set information

Refreshing type attributes with new character set information

Completed: ALTER DATABASE CHARACTER SET INTERNAL_USE zhs16gbk

查看修改后结果:

引用

SQL> select * from nls_database_parameters where parameter like '%SET%';

PARAMETER

------------------------------

VALUE

--------------------------------------------------------------------------------

NLS_CHARACTERSET

ZHS16GBK

NLS_NCHAR_CHARACTERSET

AL16UTF16

引用

SQL> select userenv('language') from dual;

USERENV('LANGUAGE')

----------------------------------------------------

AMERICAN_AMERICA.ZHS16GBK

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值