Background Image
조회 수 1391 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

1. 큐브리드 10.1 에서 윤초(leap second)지원이 가능

설정 파일 CUBRID/conf/cubrid.conf 에 아래와 같이 윤초 지원 옵션을 yes 로 설정한다.

tz_leap_second_support=yes


아래 표는 윤초 지원 옵션을 사용할 경우와 그렇지 않을 경우를 비교한 것이다. 


표1 . tz_leap_second_support 를 적용할 경우와 그렇지 않을 경우 비교

 

 

tz_leap_second_support=yes

tz_leap_second_support=no

비고



csql> SELECT TIMESTAMPLTZ'2016-12-31 23:59:59 UTC';
=== <Result of SELECT Command in Line 1> ===
  timestampltz '2016-12-31 23:59:59 UTC'
=============================================
 08:59:59 AM 01/01/2017 Asia/Seoul KST
1 row selected. (0.009868 sec) Committed.
1 command(s) successfully processed.



csql> SELECT TIMESTAMPLTZ'2016-12-31 23:59:59 UTC';
=== <Result of SELECT Command in Line 1> ===
  timestampltz '2016-12-31 23:59:59 UTC'
=============================================
 
08:59:59 AM 01/01/2017 Asia/Seoul KST
1 row selected. (0.011462 sec) Committed.
1 command(s) successfully processed.

unix timestamp = 1483196399

csql> SELECT TIMESTAMPLTZ'2016-12-31 23:59:59 UTC'+1;
=== <Result of SELECT Command in Line 1> ===
  timestampltz '2016-12-31 23:59:59 UTC'+1
=============================================
 
08:59:59 AM 01/01/2017 Asia/Seoul KST
1 row selected. (0.009906 sec) Committed.
1 command(s) successfully processed.

csql> SELECT TIMESTAMPLTZ'2016-12-31 23:59:59 UTC'+1;
=== <Result of SELECT Command in Line 1> ===
  timestampltz '2016-12-31 23:59:59 UTC'+1
=============================================
 09:00:00 AM 01/01/2017 Asia/Seoul KST
1 row selected. (0.010832 sec) Committed.
1 command(s) successfully processed.

+1 을 해도 같은 시간 1483196400을 무시하고 같은 시간으로 취급
tz_leap_second_support=no
일 경우 그냥 1초 증가



csql> SELECT TIMESTAMPLTZ'2016-12-31 23:59:59 UTC'+2;
=== <Result of SELECT Command in Line 1> ===
  timestampltz '2016-12-31 23:59:59 UTC'+2
=============================================
 
09:00:00 AM 01/01/2017 Asia/Seoul KST
1 row selected. (0.011239 sec) Committed.
1 command(s) successfully processed.

csql> SELECT TIMESTAMPLTZ'2016-12-31 23:59:59 UTC'+2;
=== <Result of SELECT Command in Line 1> ===
  timestampltz '2016-12-31 23:59:59 UTC'+2
=============================================
 
09:00:01 AM 01/01/2017 Asia/Seoul KST
1 row selected. (0.010025 sec) Committed.
1 command(s) successfully processed.

+2를 해야 1초 증가한 시간
즉 윤초가 적용되었기 때문에 유닉스 타임스탬프 보정

 




2. 윤초가 발생한 시간은 실제 발생한 것이 아닌 가상의 시간이다.  

SELECT TO_DATETIME_TZ ('2016-12-31 23:59:60 UTC') ;  

Conversion error in timestamp format.

 

실제로 타임스탬프의 초가 60이 되는 경우는 없기 때문에 위 에러는 정상입니다.

 

Mysql 의 경우

SELECT * FROM t1 WHERE ts = '2008-12-31 23:59:60';

Empty set, 2 warnings (0.00 sec)

Warning 처리함.

참고 :  https://dev.mysql.com/doc/refman/5.7/en/time-zone-leap-seconds.html


3. 윤초를 사용하려면 OS 의 타임존 데이터 값을  먼저 업데이트 해야 한다.

리눅스에서 사용하는 타임존 패키지는 두가지가 있다.

tzdata 패키지와 tzdata-java 이다.

 

3.1 tzdata

Name        : tzdata                       Relocations: (not relocatable)

Version     : 2017b                             Vendor: CentOS

Release     : 1.el6                         Build Date: Mon 03 Apr 2017 11:15:25 PM KST

Install Date: Wed 21 Jun 2017 10:22:44 AM KST      Build Host: c1bm.rdu2.centos.org

Group       : System Environment/Base       Source RPM: tzdata-2017b-1.el6.src.rpm

Size        : 1785109                          License: Public Domain

Signature   : RSA/SHA1, Wed 05 Apr 2017 01:33:48 AM KST, Key ID 0946fca2c105b9de

Packager    : CentOS BuildSystem <http://bugs.centos.org>

URL         : https://www.iana.org/time-zones

Summary     : Timezone data

Description :

This package contains data files with rules for various timezones around the world.

 

 

The Time Zone Database (often called tz or zoneinfo) contains code and

data that represent the history of local time for many representative

locations around the globe.  It is updated periodically to reflect

changes made by political bodies to time zone boundaries, UTC offsets,

and daylight-saving rules.

 

https://www.iana.org/time-zones/repository/tz-link.html

 

tzdata 패키지의 내용

/usr/share/doc/tzdata-2017b

/usr/share/doc/tzdata-2017b/README

/usr/share/doc/tzdata-2017b/Theory

/usr/share/doc/tzdata-2017b/tz-link.html

/usr/share/zoneinfo

/usr/share/zoneinfo/Africa

...

...

/usr/share/zoneinfo/right/Universal

/usr/share/zoneinfo/right/W-SU

/usr/share/zoneinfo/right/WET

/usr/share/zoneinfo/right/Zulu

/usr/share/zoneinfo/zone.tab

/usr/share/zoneinfo/zone1970.tab

 

 

3.2. tzdata-java

Name        : tzdata-java                  Relocations: (not relocatable)

Version     : 2017b                             Vendor: CentOS

Release     : 1.el6                         Build Date: Mon 03 Apr 2017 11:15:25 PM KST

Install Date: Wed 21 Jun 2017 10:23:50 AM KST      Build Host: c1bm.rdu2.centos.org

Group       : System Environment/Base       Source RPM: tzdata-2017b-1.el6.src.rpm

Size        : 371020                           License: Public Domain

Signature   : RSA/SHA1, Wed 05 Apr 2017 01:33:48 AM KST, Key ID 0946fca2c105b9de

Packager    : CentOS BuildSystem <http://bugs.centos.org>

URL         : https://www.iana.org/time-zones

Summary     : Timezone data for Java

Description :

This package contains timezone information for use by Java runtimes.

 

tzdata-java

/usr/share/javazi

/usr/share/javazi-1.8

/usr/share/javazi-1.8/tzdb.dat

/usr/share/javazi/Africa

/usr/share/javazi/Africa/Abidjan

/usr/share/javazi/Africa/Accra

/usr/share/javazi/Africa/Algiers

...

...

/usr/share/javazi/SystemV/MST7MDT

/usr/share/javazi/SystemV/PST8

/usr/share/javazi/SystemV/PST8PDT

/usr/share/javazi/SystemV/YST9

/usr/share/javazi/SystemV/YST9YDT

/usr/share/javazi/WET

/usr/share/javazi/ZoneInfoMappings

 

tzdata 패키지를 최신으로 설치하면 아래와 같은 정보를 확인할 수 있습니다.

 

[user_xx@rndpv100 zoneinfo]$  zdump -v right/Asia/Seoul  | grep 2017 | grep Sat

right/Asia/Seoul  Sat Dec 31 23:59:60 2016 UTC = Sun Jan  1 08:59:60 2017 KST isdst=0 gmtoff=32400

 

2016 à 2017 이동시 발생했던 윤초 정보를 확인할 수 있습니다. 

 

ntp, ptp 를 사용하는 리눅스 서버는 윤초 보정에 대응 할 필요없음

ntp 또는 ptp 를 사용하지 않을 경우 윤초에 대응할 수 있는 tzdata 와 커널로 업데이트해야 함

 참고 :  https://access.redhat.com/articles/15145

 

커널의 경우 2012년 리눅스 커널 버그로 인해 문제 (윤초가 추가된 후 CPU 사용량 증가와 Kernel Deadlock)가 발생함.

따라서 최신 리눅스 커널 버전인지 확인하는 것이 중요함

(이 문제는 2012년에 처리되어 2015년 이후 발생하지 않음)

 

3.3 큐브리드에서 타임존 라이브러리를 사용하기 위해서는 아래 붉은색으로 표시된 것처럼 타임존을 먼저 업데이트 하고 큐브리드의 타임존 라이브러리를 컴파일 후 데이터베이스를 다시 시작해야 한다. 

CUBRID supports IANA timezone, and a user can use the IANA timezone library in the CUBRID installation package as it is.

If you want to update as the recent timezone, update timezone first,

compile timezone library, and restart the database.


 




  1. 트랜잭션과 LOCK 초급과정

    Date2010.07.01 Category기타 By정만영 Views20760
    Read More
  2. 큐브리드10.1 에서 윤초 지원 옵션 사용하기

    Date2017.09.13 Category기타 By최광일 Views1391
    Read More
  3. 콘솔에서 마이그레이션 하기.

    Date2015.06.19 Category기타 By권호일 Views13428
    Read More
  4. 조인 방법(Join Method) 설명

    Date2009.12.31 Category기타 By웁쓰 Views27990
    Read More
  5. 제로보드 XE 사용하기

    Date2008.11.21 Category기타 Byadmin Views33068
    Read More
  6. 자주 발생하는 큐브리드(cubrid) 에러 메시지 정리

    Date2011.07.14 Category기타 Byadmin Views81364
    Read More
  7. 자동증가 속성 사용 방법 및 주의 사항

    Date2010.02.26 Category기타 By남재우 Views35663
    Read More
  8. 윈도우즈 환경에서 배치화일을 이용하여 백업 또는 데이터베이스 정리 수행하기

    Date2010.03.03 CategoryWindows By남재우 Views27479
    Read More
  9. 오래 걸리는 질의 및 동일 시간에 수행 중인 질의 추출하기

    Date2009.05.26 Category기타 By손승일 Views20058
    Read More
  10. 오라클 개발자를 위한 CUBRID 개발 안내

    Date2009.04.01 Category기타 Byadmin Views49817
    Read More
  11. 예제로 배우는 CUBRID 스터디

    Date2009.12.29 Category기타 By문학청년 Views18546
    Read More
  12. 에러 메시지(error) 설명 및 조치 가이드

    Date2009.07.11 Category기타 ByCUBRID_DEV Views24420
    Read More
  13. 알고 보면 쉬운 cubrid lockdb 유틸리티

    Date2015.12.08 Category기타 By김승훈 Views12018
    Read More
  14. 시스템 카다로그

    Date2008.11.21 Category기타 Byadmin Views22333
    Read More
  15. 스칼라 서브쿼리 사용 가이드

    Date2009.12.31 Category기타 By웁쓰 Views28268
    Read More
  16. 서비스 오픈을 위한 CUBRID 구성 가이드

    Date2009.11.28 Category기타 By손승일 Views23204
    Read More
  17. 복제 따라하기

    Date2008.11.21 CategoryLinux Byadmin Views29094
    Read More
  18. 보안 설정

    Date2008.11.21 Category기타 Byadmin Views22838
    Read More
  19. 멀티미디어 데이터 관리를 위한 CUBRID GLO Method 활용

    Date2009.12.11 Category기타 Byjanus Views16191
    Read More
  20. 리소스를 제한(limits.conf) 하여 DB서버를 관리하자

    Date2015.12.31 CategoryLinux By주현 Views26552
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales