Characterset字符集

来源:互联网 发布:java super 编辑:程序博客网 时间:2024/05/21 22:09
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

Characterset字符集



作者:zyqin



创建:2005-03-25



英文:http://www.dbonline.cn




 


Ifthedatabasehasbeencreatedwiththewrongcharacterset,usethefollowingtochangethecharacterset



UPDATESYS.PROPS$



SETVALUES$='WE8ISO8859P1'



WHERENAME='NLS_CHARACTERSET';



ItisVERYimportanttospecifythecharactersetnamecorrectly.IftheNLS_CHARACTERSETisupdatedtoaninvalidvalue,itwillnotthenbepossibletorestartthedatabaseonceithasbeenshutdown.





如果已经创建的使用了错误的字符集,你可以使用下面的方法修改字符集



UPDATESYS.PROPS$



SETVALUES$='WE8ISO8859P1'



WHERENAME='NLS_CHARACTERSET';



注意:确保字符集名称的准确性是非常重要的。如果NLS_CHARACTERSET被更新成一个错误的值,数据库关闭后就无法重新启动了。



Update



――――――――――――――――――――――――――――――――――――

Fromversion8youcannowupdatethecharactersetusingthealterdatabasecommand.Anextractfromthedocumentationisincludedbelow,thebasicrulebeingthatthenewcharactersetmustbeasupersetofthecurrentset.Interestinglyenough,Itriedtheaboveupdatewithacharactersetthatviolatedthatrule,itstillworks-ofcourse,anycharactercodedifferenceswillwouldinevitablycausesomeproblems,soitwouldbesafesttousethesupportedsyntax.



Quotefromthe(8.1.6)documentationreveals:





8以后的数据库可以通过使用alterdatabase命令修改字符集。引用文档中的一句话:新的字符集必须是原来字符集的一个超集。有意思的是,我曾经更新字符集是违反了这一原则,数据库照样工作;当然了,任何字符码都可能导致同样的问题,所以最的方法还是遵照规则办事。



――――――――――――――――――――――――――――――――――――

"ChangingtheCharacterSetAfterDatabaseCreation



Insomecases,youmaywishtochangetheexistingdatabasecharacterset.Forinstance,youmayfindthatthenumberoflanguagesthatneedtobesupportedinyourdatabasehaveincreased.Inmostcases,youwillneedtodoafullexport/importtoproperlyconvertalldatatothenewcharacterset.However,ifandonlyif,thenewcharactersetisastrictsupersetofthecurrentcharacterset,itispossibletousetheALTERDATABASECHARACTERSETtoexpeditethechangeinthedatabasecharacterset.





有时候,你可能需要修改当前数据库的字符集。这时你会发现你需要增加数据库支持的原因的种类。多数情况下,你可能需要通过完全的export/import导入/导出来实现。如果,仅仅是如果,新的字符集是当前字符集的一个严格的超集,使用ALTERDATABASECHARACTERSET命令是一个可行的方法。



Thetargetcharactersetisastrictsupersetifandonlyifeachandeverycodepointinthesourcecharactersetisavailableinthetargetcharacterset,withthesamecorrespondingcodepointvalue.ForinstancethefollowingmigrationscenarioscantakeadvantageoftheALTERDATABASECHARACTERSETcommandsinceUS7ASCIIisastrictsubsetofWE8ISO8859P1,AL24UTFFSS,andUTF8:



CurrentCharacterSetNewCharacterSetNewCharacterSetisstrictsuperset?



US7ASCIIWE8ISO8859P1yes



US7ASCIIALT24UTFFSSyes



US7ASCIIUTF8yes1
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击