Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable NLS query #611

Open
Zegorax opened this issue Oct 18, 2024 · 0 comments
Open

Option to disable NLS query #611

Zegorax opened this issue Oct 18, 2024 · 0 comments

Comments

@Zegorax
Copy link

Zegorax commented Oct 18, 2024

Ciao,

I'm using the Telegraf inputs.sql (https://github.com/influxdata/telegraf/tree/master/plugins/inputs/sql) plugin with go_oracle (v2) to connect to an active/standby Oracle instance. I noticed one problem that I cannot go around when it is connecting.

Prior to executing any statement, it is executing the following request:

        BEGIN
                SELECT
                        MAX(CASE WHEN PARAMETER='NLS_CALENDAR' THEN VALUE END) AS NLS_CALENDAR,
                        MAX(CASE WHEN PARAMETER='NLS_COMP' THEN VALUE END) AS NLS_COMP,
                        MAX(CASE WHEN PARAMETER='NLS_LENGTH_SEMANTICS' THEN VALUE END) AS NLS_LENGTH_SEMANTICS,
                        MAX(CASE WHEN PARAMETER='NLS_NCHAR_CONV_EXCP' THEN VALUE END) AS NLS_NCHAR_CONV_EXCP,
                        MAX(CASE WHEN PARAMETER='NLS_DATE_LANGUAGE' THEN VALUE END) AS NLS_DATE_LANGUAGE,
                        MAX(CASE WHEN PARAMETER='NLS_SORT' THEN VALUE END) AS NLS_SORT,
                        MAX(CASE WHEN PARAMETER='NLS_CURRENCY' THEN VALUE END) AS NLS_CURRENCY,
                        MAX(CASE WHEN PARAMETER='NLS_DATE_FORMAT' THEN VALUE END) AS NLS_DATE_FORMAT,
                        MAX(CASE WHEN PARAMETER='NLS_ISO_CURRENCY' THEN VALUE END) AS NLS_ISO_CURRENCY,
                        MAX(CASE WHEN PARAMETER='NLS_NUMERIC_CHARACTERS' THEN VALUE END) AS NLS_NUMERIC_CHARACTERS,
                        MAX(CASE WHEN PARAMETER='NLS_DUAL_CURRENCY' THEN VALUE END) AS NLS_DUAL_CURRENCY,
                        MAX(CASE WHEN PARAMETER='NLS_TIMESTAMP_FORMAT' THEN VALUE END) AS NLS_TIMESTAMP_FORMAT,
                        MAX(CASE WHEN PARAMETER='NLS_TIMESTAMP_TZ_FORMAT' THEN VALUE END) AS NLS_TIMESTAMP_TZ_FORMAT
                        into :p_nls_calendar, :p_nls_comp, :p_nls_length_semantics, :p_nls_nchar_conv_excep,
                                :p_nls_date_lang, :p_nls_sort, :p_nls_currency, :p_nls_date_format, :p_nls_iso_currency,
                                :p_nls_numeric_chars, :p_nls_dual_currency, :p_nls_timestamp, :p_nls_timestamp_tz
                FROM
                        sys.nls_session_parameters
                ;
        END;

(From the "trace log" URL parameter)
This will result in : PL/SQL: ORA-01219: database not open: queries allowed on fixed tables/views only since the database is in standby mode, and therefore I cannot execute my query.

Since I'm using the Telegraf plugin, I cannot use the SessionParameter that I've seen in the code that could disable this check. Only the URL connection string is used (oracle://user:pass@host/instance?dba%20privilege=SYSDBA).

I've tried as well to add &language=AMERICAN&territory=AMERICA in the URL as an example, but it is not working either.

Is there a possibility to disable this NLS retrieve check via an environment variable or other URL option for example ?

Thanks a lot in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant