NLS parameters are categorized into database-level parameters and session-level parameters.
Database-level NLS parameters
You can view the settings of the database-level NLS parameters in the following two ways:
- Obtain the settings from the sys.nls_database_parameters view.
obclient> select * from nls_database_parameters;
+-------------------------+------------------------------+
| PARAMETER | VALUE |
+-------------------------+------------------------------+
| NLS_DATE_FORMAT | DD-MON-RR |
| NLS_TIMESTAMP_FORMAT | DD-MON-RR HH.MI.SSXFF AM |
| NLS_TIMESTAMP_TZ_FORMAT | DD-MON-RR HH.MI.SSXFF AM TZR |
| NLS_TERRITORY | AMERICA |
| NLS_SORT | BINARY |
| NLS_COMP | BINARY |
| NLS_CHARACTERSET | AL32UTF8 |
| NLS_NCHAR_CHARACTERSET | AL16UTF16 |
| NLS_DATE_LANGUAGE | AMERICAN |
| NLS_LENGTH_SEMANTICS | BYTE |
| NLS_NCHAR_CONV_EXCP | FALSE |
| NLS_CALENDAR | GREGORIAN |
| NLS_NUMERIC_CHARACTERS | ., |
+-------------------------+------------------------------+
13 rows in set (0.00 sec)
obclient>
- Execute the SHOW GLOBAL VARIABLES statement.
obclient> show global variables like 'nls_%';
+-------------------------+------------------------------+
| VARIABLE_NAME | VALUE |
+-------------------------+------------------------------+
| nls_calendar | GREGORIAN |
| nls_characterset | AL32UTF8 |
| nls_comp | BINARY |
| nls_date_format | DD-MON-RR |
| nls_date_language | AMERICAN |
| nls_length_semantics | BYTE |
| nls_nchar_characterset | AL16UTF16 |
| nls_nchar_conv_excp | FALSE |
| nls_numeric_characters | ., |
| nls_sort | BINARY |
| nls_territory | AMERICA |
| nls_timestamp_format | DD-MON-RR HH.MI.SSXFF AM |
| nls_timestamp_tz_format | DD-MON-RR HH.MI.SSXFF AM TZR |
+-------------------------+------------------------------+
13 rows in set (0.01 sec)
The settings of the database-level NLS parameters under an Oracle tenant of an OceanBase database serve as the default values of the NLS parameters for each session of the tenant. The settings of the database-level NLS parameters are used for a session if you do not modify them.
The database-level NLS parameters can be modified. The NLS parameters for different tenants can be different, without affecting each other.
Session-level NLS parameters
You can view the settings of the session-level NLS parameters in the following two ways:
- Obtain the settings from the sys.nls_session_parameters view.
obclient> select * from nls_session_parameters;
+-------------------------+------------------------------+
| PARAMETER | VALUE |
+-------------------------+------------------------------+
| NLS_DATE_FORMAT | DD-MON-RR |
| NLS_TIMESTAMP_FORMAT | DD-MON-RR HH.MI.SSXFF AM |
| NLS_TIMESTAMP_TZ_FORMAT | DD-MON-RR HH.MI.SSXFF AM TZR |
| NLS_LANGUAGE | AMERICAN |
| NLS_TERRITORY | AMERICA |
| NLS_SORT | BINARY |
| NLS_COMP | BINARY |
| NLS_DATE_LANGUAGE | AMERICAN |
| NLS_LENGTH_SEMANTICS | BYTE |
| NLS_NCHAR_CONV_EXCP | FALSE |
| NLS_CALENDAR | GREGORIAN |
| NLS_NUMERIC_CHARACTERS | ., |
+-------------------------+------------------------------+
12 rows in set (0.00 sec)
obclient>