Thursday, September 10, 2015

Get Oracle Version and NLS_LANG via SQL

For one of the applications I support, we have to pull the appropriate Oracle client. So I need the Oracle version. Second, we have to set the Oracle Client NLS_LANG value to match the database's settings. So here is a simple query to get that information.

select DECODE(parameter, 'NLS_CHARACTERSET', 'CHARACTER SET',
'NLS_LANGUAGE', 'LANGUAGE',
'NLS_TERRITORY', 'TERRITORY') name,
value from v$nls_parameters
WHERE parameter IN ( 'NLS_CHARACTERSET', 'NLS_LANGUAGE', 'NLS_TERRITORY')
NAMEVALUE
LANGUAGEAMERICAN
TERRITORYAMERICA
CHARACTER SETUTF8
VERSION11.2.0.4.0

No comments: