about Set Session Time Zone

1. How to check the session time zone ?

 

The new SESSIONTIMEZONE built-in SQL function returns the value of the current session's time zone.

 

SQL> SELECT SESSIONTIMEZONE FROM DUAL;

 

SESSIONTIMEZONE

---------------

+01:00

 

 

2. How to set the session time zone ?

 

The session time zone can be set to:

- O/S local time zone

- Database time zone

- An absolute offset

- A named region

 

1). The first method consists to use one of the following ALTER SESSION SET TIME_ZONE statements:

SQL> ALTER SESSION SET TIME_ZONE = local;

SQL> ALTER SESSION SET TIME_ZONE = dbtimezone;

SQL> ALTER SESSION SET TIME_ZONE = '-05:00';

SQL> ALTER SESSION SET TIME_ZONE = 'Europe/London';

 

2). As an alternative, the operating system environment variable ORA_SDTZ can also be used to set the session time zone:

ORA_SDTZ = 'OS_TZ' | 'DB_TZ' | '[+ | -] hh:mm' | 'timezone_region'

 

Example:

$ ORA_SDTZ='OS_TZ'

$ export ORA_SDTZ

 

$ ORA_SDTZ='-05:00'

$ export ORA_SDTZ

 

 

3. How to check the database time zone ?

 

The DBTIMEZONE SQL function returns the value of the database time zone.

 

SQL> SELECT DBTIMEZONE FROM DUAL;

 

DBTIMEZONE

--------------

Europe/Lisbon

 

@ Note that the database timezone is also included in both database_properties and props$ views:

@ SQL> SELECT property_name, property_value FROM database_properties WHERE property_name='DBTIMEZONE';

@ and

@ SQL> SELECT name, value$ FROM props$ WHERE name='DBTIMEZONE';

@ Be aware that you should not rely on these views because in case of db time zone

@ change, these views reflect the new db time zone too early: they should reflect

@ it only after database shutdown and restart.

 

 

4. How to set the database time zone ?

 

Note that the database time zone is only relevant for TIMESTAMP WITH LOCAL TIME ZONE columns.

 

1). At creation time

SQL> CREATE DATABASE ...

SET TIME_ZONE='Europe/London';

If not specified with the CREATE DATABASE statement, the database time zone defaults to the server timezone offset.

 

2). After database creation, use the ALTER DATABASE SET TIME_ZONE statement and then shut down and restart the database.

SQL> ALTER DATABASE SET TIME_ZONE = '-05:00';

SQL> ALTER DATABASE SET TIME_ZONE = 'Europe/Lisbon';

The change will not take effect until the database is bounced.

 

 

5. How to list the valid time zone regions ?

 

SQL> SELECT * FROM v$timezone_names;

 

TZNAME TZABBREV

------------------------------ ----------

Pacific/Tahiti LMT

Poland LMT

US/Pacific PST

Europe/Zurich CET

...

 

The result will depend on which timezone file is currently in use. See Q&A 7-8 for further details.

 

 

6. How to retrieve the time zone offset corresponding to a time zone region ?

 

The new 9i TZ_OFFSET() SQL function returns the time zone offset displacement to the input time zone region.

 

SQL> SELECT TZ_OFFSET('Europe/London') FROM DUAL;

 

TZ_OFFS

-------

+01:00

 

The returned offset depends on the date this statement is executed.

For example, in the 'US/Pacific' time zone, it may return '-07:00' or '-08:00' whether daylight saving is in effect or not.

 

SQL> SELECT TZ_OFFSET(SESSIONTIMEZONE), TZ_OFFSET(DBTIMEZONE) FROM DUAL;

returns the time zone offset corresponding to the time zone set for session and database.

 

TZ_OFFS TZ_OFFS

------- -------

+01:00 +00:00

 

 

7. How to use a larger set of defined time zones ?

 

2 different time zone files contain for each zone the offset from UTC, the transition times for daylight savings and abbreviation :

 

- ORACLE_HOME/oracore/zoneinfo/timezone.dat

This is the default and contains the most commonly used time zones. This is the smallest file.

 

- ORACLE_HOME/oracore/zoneinfo/timezlrg.dat

This file contains the larger set of defined time zones and can be used if you require time zones that are not defined in the default time zone file.

 

To enable the use of this larger time zone data file :

 

1). Shutdown the database

 

2).1 On UNIX platforms :

set the ORA_TZFILE environment variable to the full pathname of the location for the timezlrg.dat. By default, this should be $ORACLE_HOME/oracore/zoneinfo/timezlrg.dat:

 

$ setenv ORA_TZFILE $ORACLE_HOME/oracore/zoneinfo/timezlrg.dat

 

2).2 On Windows systems :

You should add an ORA_TZFILE registry subkey for each of your Oracle Homes with the Windows Registry Editor:

Start -> Run...

Type "regedit", and click "ok"

Add or edit the following registry entry:

HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEID\ORA_TZFILE

where ID is the unique number identifying the Oracle home.

 

Set the ORA_TZFILE to the full pathname of the location for the timezlrg.dat:

By default, the value should be %ORACLE_HOME%\oracore\zoneinfo\timezlrg.dat

 

3). Restart the database

 

Once the larger timezlrg.dat is used, it must continue to be used unless the user is sure that none of the non-default zones are used for data that is stored in the database. Also, all databases that share information should use the same time zone data file.

 

Be aware that you can neither create nore alter these timezone definition files !

 

 

8. Which timezone-set is currently used ?

 

Beside checking the UNIX ORA_TZFILE parameter or the Windows registry subkey, you can easily check whether you are using the large or the default timezone file with the following query:

 

SQL> SELECT COUNT(*) FROM v$timezone_names;

 

If the default-smallest timezone region file is in use, it will return:

 

COUNT(*)

----------

616 (in 9.0.1.x and 9.2.x)

 

or

 

COUNT(*)

----------

1250 (in 9.0.1.x and 9.2.x)

 

if the largest file is in use.

 

 

9. Can customers rely on Oracle time zones ?

 

Timezone.dat and timezlrg.dat are based on information maintained by the U.S. Navy Observatory.

 

--End--

 

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/chenabing/archive/2010/06/12/5666844.aspx

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24850250/viewspace-688520/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24850250/viewspace-688520/

基于SSM框架的智能家政保洁预约系统,是一个旨在提高家政保洁服务预约效率和管理水平的平台。该系统通过集成现代信息技术,为家政公司、家政服务人员和消费者提供了一个便捷的在线预约和管理系统。 系统的主要功能包括: 1. **用户管理**:允许消费者注册、登录,并管理他们的个人资料和预约历史。 2. **家政人员管理**:家政服务人员可以注册并更新自己的个人信息、服务类别和服务时间。 3. **服务预约**:消费者可以浏览不同的家政服务选项,选择合适的服务人员,并在线预约服务。 4. **订单管理**:系统支持订单的创建、跟踪和管理,包括订单的确认、完成和评价。 5. **评价系统**:消费者可以在家政服务完成后对服务进行评价,帮助提高服务质量和透明度。 6. **后台管理**:管理员可以管理用户、家政人员信息、服务类别、预约订单以及处理用户反馈。 系统采用Java语言开发,使用MySQL数据库进行数据存储,通过B/S架构实现用户与服务的在线交互。系统设计考虑了不同用户角色的需求,包括管理员、家政服务人员和普通用户,每个角色都有相应的权限和功能。此外,系统还采用了软件组件化、精化体系结构、分离逻辑和数据等方法,以便于未来的系统升级和维护。 智能家政保洁预约系统通过提供一个集中的平台,不仅方便了消费者的预约和管理,也为家政服务人员提供了一个展示和推广自己服务的机会。同时,系统的后台管理功能为家政公司提供了强大的数据支持和决策辅助,有助于提高服务质量和管理效率。该系统的设计与实现,标志着家政保洁服务向现代化和网络化的转型,为管理决策和控制提供保障,是行业发展中的重要里程碑。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值