首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

WebSphere+Oracle乱码有关问题解决

2013-12-05 
WebSphere+Oracle乱码问题解决SQL conn /as sysdba Connected. SQL shutdown immediate Database close

WebSphere+Oracle乱码问题解决
SQL> conn /as sysdba Connected. SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area 236000356 bytes Fixed Size 451684 bytes Variable Size 201326592 bytes Database Buffers 33554432 bytes Redo Buffers 667648 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 ZHS16GBK; ALTER DATABASE CHARACTER SET ZHS16GBK * ERROR at line 1: ORA-12712: new character set must be a superset of old character set --提示我们的字符集:新字符集必须为旧字符集的超集,这时我们可以跳过超集的检查做更改:SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK; Database altered. SQL> select * from v$nls_parameters; PARAMETER VALUE---------------------------------------------------------------- ----------------------------------------------------------------NLS_LANGUAGE SIMPLIFIED CHINESENLS_TERRITORY CHINANLS_CURRENCY ¥NLS_ISO_CURRENCY CHINANLS_NUMERIC_CHARACTERS .,NLS_CALENDAR GREGORIANNLS_DATE_FORMAT DD-MON-RRNLS_DATE_LANGUAGE SIMPLIFIED CHINESENLS_CHARACTERSET ZHS16GBKNLS_SORT BINARYNLS_TIME_FORMAT HH.MI.SSXFF AMNLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AMNLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZRNLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZRNLS_DUAL_CURRENCY ¥NLS_NCHAR_CHARACTERSET AL16UTF16NLS_COMP BINARYNLS_LENGTH_SEMANTICS BYTENLS_NCHAR_CONV_EXCP FALSE19 rows selected-- 此时可以看到,字符集已经改好。--重启检查是否更改完成:SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 236000356 bytes Fixed Size 451684 bytes Variable Size 201326592 bytes Database Buffers 33554432 bytes Redo Buffers 667648 bytes Database mounted. Database opened. SQL> select * from v$nls_parameters; 略 19 rows selected.

?
我们看到这个过程和之前ALTER DATABASE CHARACTER SET操作的内部过程是完全相同的,也就是说INTERNAL_USE提供的帮助就是使Oracle数据库绕过了子集与超集的校验。

?

注意:如果是操作生产库,一定要慎重。最好不要动字符集。

?

?

二是在WebSphere端调整:

1.在网页控制台中修改(这个比较直观,建议使用这种,如果控制台打不开,可以看第2种方法):?

??????输入用户名和密码进到WebSphere控制台,操作如下:Servers -> Server Types -> WebSphere application servers -> server1 -> Java and process Management -> Process definition -> Java Virtual Machine -> Generic JVM arguments : -Dfile.encoding=GBK -Ddefault.client.encoding=GBK

?

2.修改Server.xml文件(注意,在修改任何服务器文件时,一定要先做好备份):

server.xml路径如下:C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\config\cells\testNode01Cell\nodes\testNode01\servers\server1.xml?

?

找到文件后,定位到这个字符串 genericJvmArguments=""? 修改为? genericJvmArguments="-Dfile.encoding=GBK -Ddefault.client.encoding=GBK"

?

?

?

?

?

热点排行