简体   繁体   English

在Oracle 11g XE上更改NLS字符集参数

[英]Change NLS Character set parameters on Oracle 11g XE

I am using Oracle 11g Express Edition. 我正在使用Oracle 11g Express Edition。 Currently when I check NLS character set parameter using SELECT * FROM nls_database_parameters; 目前,当我使用SELECT * FROM nls_database_parameters;检查NLS字符集参数时SELECT * FROM nls_database_parameters; it gives the default values: 它给出了默认值:

NLS_CHARACTERSET: AL32UTF8
NLS_NCHAR_CHARACTERSET: AL16UTF16

I want to set both these parameters to UTF8. 我想将这两个参数设置为UTF8。 How can I do so? 我怎么能这样做? I have just installed Oracle 11g XE, so there is not data except those required by Oracle itself. 我刚刚安装了Oracle 11g XE,因此除了Oracle本身所需的数据之外,没有数据。

This worked for me where an application was checking for UTF8 rather than AL32UTF8 . 这适用于我的应用程序正在检查UTF8 rather than AL32UTF8

SQL> shutdown immediate;

SQL> startup restrict

SQL> select name from v$database;

SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE UTF8 ;

SQL> select value from NLS_DATABASE_PARAMETERS 
     where parameter=’NLS_CHARACTERSET’;

SQL> shutdown immediate;

SQL> startup

Maybe this works: alter database character set UTF8; 也许这样可行: alter database character set UTF8; --> Not supported anymore on Oracle 10.1 or later. - >在Oracle 10.1或更高版本上不再支持。

However, are you really sure to change it? 但是,你真的确定要改变它吗? AL32UTF8 is UTF-8, actually. 实际上, AL32UTF8 UTF-8。

On Oracle you have also a character set called UTF8 , this is a kind of misnomer and means Character set CESU-8 . 在Oracle上你还有一个名为UTF8的字符集,这是一种用词不当并且意味着字符集CESU-8 As far as I know this is like "UTF-8 as of Unicode version 3 from 1999". 据我所知,这就像“1999年Unicode版本3的UTF-8”。 As long as you use Unicode characters less than 65535 (Basic Multilingual Plane) AL32UTF8 and UTF8 are identical. 只要使用小于65535(基本多语言平面)的Unicode字符, AL32UTF8UTF8就完全相同。

Note, this command works only if the new character set is a strict superset of old character set. 请注意,仅当新字符集是旧字符集的严格超集时,此命令才有效。 Ie you can change from US7ASCII to AL32UTF8 or WE8ISO8859P1 but you cannot change from WE8ISO8859P1 to AL32UTF8 . 即您可以从US7ASCII更改为AL32UTF8WE8ISO8859P1但您无法从WE8ISO8859P1更改为AL32UTF8

You can't change the character set once you set installation. 设置安装后,无法更改字符集 If you want to change then there is long procedure for which you need to raise SR with Oracle. 如果您想要更改,那么您需要使用Oracle提升SR的长程序。

SQL> shutdown immediate;

SQL> startup restrict

SQL> select name from v$database;

SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE WE8MSWIN1252 ;

SQL> select value from NLS_DATABASE_PARAMETERS where parameter=’NLS_CHARACTERSET’;

SQL> shutdown immediate;

SQL> startup

SQL> select value from NLS_DATABASE_PARAMETERS where parameter=’NLS_CHARACTERSET’;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM