Background Image
조회 수 1390 추천 수 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
번호 분류 제목 글쓴이 날짜 조회 수
86 기타 HA 환경 구성 시 데이터 복제 지연이 발생하는 경우 ECHO(7) port를 확인하자. 손승일 2012.11.29 26440
85 기타 ERwin을 이용한 CUBRID 포워드 엔지니어링 file 민순 2020.07.14 2267
84 기타 ERwin을 이용한 CUBRID 리버스 엔지니어링 file 민순 2020.07.13 3413
83 기타 DB의 스키마와 데이터를 파일로 내려받기 seongjoon 2009.08.17 20008
82 Java DBCP 사용법 1 admin 2008.11.21 48362
81 기타 CUBRID주요 사용 함수 및 연산자 비교 cubebridge 2009.07.28 23450
80 기타 CUBRID인덱스 구성 전략 웁쓰 2009.12.31 22193
79 기타 CUBRID와 타DBMS의 python 사용방법 비교 cubebridge 2009.05.19 29520
78 기타 CUBRID와 타 데이터베이스 기능 비교 9 admin 2008.11.21 36163
77 Java CUBRID와 Oracle의 Clob 타입 사용 방법 비교. seongjoon 2012.06.30 54547
76 Java CUBRID와 MyBATIS 빠르게 연동하기 file 김승훈 2015.05.07 19123
75 기타 CUBRID에서의 BLOB/CLOB 타입 사용법 cubebridge 2011.03.08 30436
74 Java CUBRID에서 log4sql을 사용하자 정병주 2009.06.12 44302
73 Java CUBRID에서 Java AddBatch 사용 엄기호 2016.06.28 8339
72 Linux CUBRID서비스 시스템 재구동시 자동 구동/종료 방법 1 admin 2009.04.01 29799
71 Install CUBRID기반으로 XE 운영하기 – 설치가이드 file cubebridge 2012.04.13 30929
70 PHP CUBRID_기술문서_CUBRID PHP 함수 unisql_ 계열 cubrid_로 변환하기 file 남재우 2009.06.23 22355
69 Install CUBRID6.6 이상에서 CUBRID2008 로 데이터베이스 이전 하기 3 남재우 2008.11.21 26444
68 기타 CUBRID2008데이터타입, 함수와 힌트사용법 및 예약어 cubebridge 2009.07.28 18839
67 기타 CUBRID2008_보안설정[R2.0] seongjoon 2009.08.17 16272
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