Oracle 参数 NLS_TIMESTAMP_TZ_FORMAT 官方解释,作用,如何配置最优化建议

本站中文解释

:

NLS_TIMESTAMP_TZ_FORMAT参数控制显示TIMESTAMPTZ和TIMESTAMP WITH TIME ZONE类型字段值的格式。

该参数使用比特序列来设置格式。以下是设置比特序列的一些示例:

1.YYYY-MM-DD HH24:MI:SSXFF:这将显示年月日、小时、分钟、秒和时区偏移量;

2.DD-MON-YYYY HH24:MI:SSXFF:将显示日月年、小时、分钟、秒和时区偏移量;

3.HH24:MI:SSXFF:将显示小时、分钟、秒和时区偏移量。

正确设置NLS_TIMESTAMP_TZ_FORMAT参数的方法是:

1.通过ALTER SYSTEM语句动态设置参数:alter system set nls_timestamp_tz_format = ‘YYYY-MM-DD HH24:MI:SSXFF’;

2.如果需要在包括参数在内停机时也有效,那么还需要编辑ORACLE数据库的参数文件,将参数值加入到文件中。

官方英文解释

NLS_TIMESTAMP_TZ_FORMAT defines the default timestamp with time zone format to use with the TO_CHAR and TO_TIMESTAMP_TZ functions.

Property Description

Parameter type

String

Syntax

NLS_TIMESTAMP_TZ_FORMAT = "format"

Default value

Derived from NLS_TERRITORY

Modifiable

ALTER SESSION

Modifiable in a PDB

Yes

Range of values

Any valid datetime format mask

Basic

No

The value must be surrounded by quotation marks as follows:

NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH:MI:SS.FF TZH:TZM'

You can specify the value of NLS_TIMESTAMP_TZ_FORMAT by setting it in the initialization parameter file. You can specify its value for a client as a client environment variable.

You can also alter the value of NLS_TIMESTAMP_TZ_FORMAT by changing its value in the initialization parameter and then restarting the instance. To alter the value during a session use the ALTER SESSION SET statement.

Note:

The value of this initialization parameter NLS_TIMESTAMP_TZ_FORMAT is used to initialize the session value of this parameter, which is the actual value referenced by the SQL query processing. This initial value is overridden by a client-side value if the client uses the Oracle JDBC driver or if the client is OCI-based and the NLS_LANG client setting (environment variable) is defined. The initialization parameter value is, therefore, usually ignored.

See Also:

Oracle Database
Globalization Support Guide
for more information about this parameter


数据运维技术 » Oracle 参数 NLS_TIMESTAMP_TZ_FORMAT 官方解释,作用,如何配置最优化建议