sijms / go-ora

Pure go oracle client
MIT License
771 stars 169 forks source link

Driver Character Set support Issue #481

Closed HSJANG3 closed 7 months ago

HSJANG3 commented 7 months ago

Hi. I`m trying to build Oracle database Monitoring system using Prometheus and oracledb_exporter.

But, when I deployed oracledb_exporter , I encountered following error message.

Errorpingingoracle:="the server use charset with id: 840 which is not supported by the driver"

https://github.com/sijms/go-ora/v2/connection_string.go

    "AR8ARABICMAC":     0x235,
    "AR8ARABICMACS":    0x236,
    "AR8ARABICMACT":    0x237,
    "LA8ISO6937":       0x24E,
    "JA16VMS":          0x33D,
    "JA16EUC":          0x33E,
    "JA16EUCYEN":       0x33F,
    "JA16SJIS":         0x340,
    //"JA16DBCS" : 833,
    //"JA16SJISYEN" : 834,
    //"JA16EBCDIC930" : 835,
    //"JA16MACSJIS" : 836,
    //"JA16EUCTILDE" : 837,
    //"JA16SJISTILDE" : 838,
    //"KO16KSC5601" : 840,    <-- here is the issue. I guess 
    //"KO16DBCS" : 842,
    //"KO16KSCCS" : 845,
    "KO16MSWIN949":      846,

It seems that because of the code, oracledb_exporter can`t support "KO16KSC5601" Charset.

So. Can it be modified?

sijms commented 7 months ago

why you pass CHARSET / CLIENT CHARSET in connection string? if charset of the server is the one you want to use no need to pass this url parameter. if your charset is not supported you can create custom string converter as mentioned here

HSJANG3 commented 7 months ago

Sorry for short explaination. I mean, Charset 840 is strict subset of 846. (KSC5601(840) + additional character = WIN949 (846)) So, if charset 846 is supported by the version, then charset 840 also can be supported without any custom string converter.

version 2.7.18

sijms commented 7 months ago

fixed v2.8.1

HSJANG3 commented 7 months ago

Thank you so much. Using v2.8.1, most of databases that use KO16KSC5601 can be monitored by Prometheus (oracledb_exporter).

It is great advance in terms of cost effective monitoring.