求救:Oracle 字符集变化如何应对?

[复制链接]
查看11 | 回复8 | 2009-1-4 14:52:28 | 显示全部楼层 |阅读模式
请教各位DX,
在Oracle 9i,某前辈使用US7ASCII来存储中文。现在要升级到Oracle 10g,使用GB2313或者UTF8会不会让原来存储在US7ASCII格式的中文呈现乱码?如何实现数据的正确迁移?通过导入、导出可以吗?
多谢!
回复

使用道具 举报

千问 | 2009-1-4 14:52:28 | 显示全部楼层
I didn't know US7ASCII could store Chinese. Interesting.
Why not use AL32UTF8? Oracle promises to keep it in sync with the latest Unicode standard, currently at version 4, while UTF8 stops at version 3.
Yong Huang
回复

使用道具 举报

千问 | 2009-1-4 14:52:28 | 显示全部楼层
you can use the function :convert
for eg:convert(c1.FGROUP,'ZHS16GBK','UTF8')
回复

使用道具 举报

千问 | 2009-1-4 14:52:28 | 显示全部楼层
yes, by right, US&ASCII can not store Chinese character. But if you define your database character set to US7ASCII and input Chinese character, most of the chinese characters should be ok.
I have to say the DBA who installed Oracle Database couple of years ago made such insane decision, and so far as too many applications running on this DB it's not easy to just shutdown the database and reinstall to make everything right.
other than the convert function, is there any other idea?
回复

使用道具 举报

千问 | 2009-1-4 14:52:28 | 显示全部楼层
To answer your original question, I'm pretty sure you'll be OK to change characterset from US7ASCII to UTF8, and probably OK to change to GB2312. Export and import should be OK too. Why not create a small database of UTF8 or GB2312 and import data into it?
Yong Huang
回复

使用道具 举报

千问 | 2009-1-4 14:52:28 | 显示全部楼层
oracle exp imp工具会自己做US7ASCII——>GB2313的转换
同意楼上的说法,先做测试
回复

使用道具 举报

千问 | 2009-1-4 14:52:28 | 显示全部楼层
Cool! Thanks
Try it soon in the testing environment
回复

使用道具 举报

千问 | 2009-1-4 14:52:28 | 显示全部楼层
US7ASCII几乎是所有字符集的sub set ,应该没问题的。
回复

使用道具 举报

千问 | 2009-1-4 14:52:28 | 显示全部楼层
there is utility called csscan help this, find the detail steps in metalink.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行