Background Image
조회 수 1389 추천 수 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.


 




List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
166 기타 트랜잭션과 LOCK 초급과정 정만영 2010.07.01 20760
» 기타 큐브리드10.1 에서 윤초 지원 옵션 사용하기 최광일 2017.09.13 1389
164 기타 콘솔에서 마이그레이션 하기. file 권호일 2015.06.19 13427
163 기타 조인 방법(Join Method) 설명 file 웁쓰 2009.12.31 27989
162 기타 제로보드 XE 사용하기 file admin 2008.11.21 33068
161 기타 자주 발생하는 큐브리드(cubrid) 에러 메시지 정리 admin 2011.07.14 81363
160 기타 자동증가 속성 사용 방법 및 주의 사항 남재우 2010.02.26 35661
159 Windows 윈도우즈 환경에서 배치화일을 이용하여 백업 또는 데이터베이스 정리 수행하기 남재우 2010.03.03 27479
158 기타 오래 걸리는 질의 및 동일 시간에 수행 중인 질의 추출하기 손승일 2009.05.26 20058
157 기타 오라클 개발자를 위한 CUBRID 개발 안내 1 admin 2009.04.01 49817
156 기타 예제로 배우는 CUBRID 스터디 문학청년 2009.12.29 18546
155 기타 에러 메시지(error) 설명 및 조치 가이드 file CUBRID_DEV 2009.07.11 24420
154 기타 알고 보면 쉬운 cubrid lockdb 유틸리티 file 김승훈 2015.12.08 12018
153 기타 시스템 카다로그 2 admin 2008.11.21 22333
152 기타 스칼라 서브쿼리 사용 가이드 웁쓰 2009.12.31 28268
151 기타 서비스 오픈을 위한 CUBRID 구성 가이드 손승일 2009.11.28 23204
150 Linux 복제 따라하기 admin 2008.11.21 29094
149 기타 보안 설정 admin 2008.11.21 22838
148 기타 멀티미디어 데이터 관리를 위한 CUBRID GLO Method 활용 janus 2009.12.11 16191
147 Linux 리소스를 제한(limits.conf) 하여 DB서버를 관리하자 1 주현 2015.12.31 26551
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