问题描述
如何在Oracle中配置UTF8字符集?我尝试更新如下:
How to configure UTF8 character set in Oracle? I've tried to update as follow :
UPDATE NLS_DATABASE_PARAMETERS SET VALUE = 'UTF8' WHERE PARAMETER='NLS_CHARACTERSET';
但是这样的错误显示
ERROR at line 1:
ORA-01031: insufficient privileges
推荐答案
是的,好东西也失败了……那不是一个好主意...:-)
Yeah, good thing that failed too...that's not a good idea... :-)
首先,要获得Oracle中对UTF-8的支持,您将要使用'AL32UTF8'字符集.
First off, for UTF-8 support in Oracle, you'll want to use the 'AL32UTF8' character set.
这是一个全新的数据库吗?还是已有数据的现有数据库?
Is this a brand new database? Or an existing database with data already in it?
如果我们在谈论新数据库,则应该删除数据库,然后在创建数据库时在DBCA中指定AL32UTF8字符集来再次创建它.
If we're talking new database, you should just drop the database, and create it again, specifying the AL32UTF8 character set in DBCA, when you create the database.
如果它是现有数据库,并且已经有数据,则要复杂一些.当前使用什么字符集? AL32UTF8是该字符集的直接超集吗?
If it's an existing database, with data already in it, it's a bit more complicated. What character set does it currently use? Is AL32UTF8 a direct superset of that character set?
这确实是一个不平凡的话题.简而言之,您需要了解当前的字符集以及要移至的字符集,并且需要运行"CSSCAN"实用程序来检查兼容性和数据转换问题.
This is really a non-trivial subject. In short, you need to know the current character set, and the character set you're moving to, and you'll need to run the 'CSSCAN' utility to check for compatibility and data conversion problems.
有关全文,您应该在MOS上查看以下文档:
For the full story, you should check the following document on MOS:
希望有帮助.
这篇关于如何在Oracle中配置UTF8字符集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!