Background Image
조회 수 1416 추천 수 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
번호 분류 제목 글쓴이 날짜 조회 수
146 기타 CUBRID Migration방법(by unloaddb & loaddb) 주현 2015.07.01 21888
145 기타 콘솔에서 마이그레이션 하기. file 권호일 2015.06.19 13431
144 PHP CUBRID HA 환경에서 Apache-PHP 설정 가이드 이용미 2015.06.16 10664
143 기타 CUBRID isolation level & Dirty Read 정만영 2015.05.29 11314
142 Windows Windows 에 설치 된 JRE 설치 위치 확인 하기. file 성진 2015.05.28 12571
141 Java CUBRID와 MyBATIS 빠르게 연동하기 file 김승훈 2015.05.07 19137
140 Linux CUBRID Linux 부팅시 자동시작 서비스 설정 방법 정만영 2013.09.16 25468
139 PHP phpize를 이용한 PHP 모듈 연동 방법(CUBRID2008 R4.3 버전) file 이용미 2013.05.16 20857
138 PHP Apache, PHP 설치 방법 file 이용미 2013.05.16 41246
137 기타 HA 환경 구성 시 데이터 복제 지연이 발생하는 경우 ECHO(7) port를 확인하자. 손승일 2012.11.29 26440
136 ODBC/OLEDB VB에서 CUBRID ODBC/OLEDB 사용하는 방법 및 샘플코드. file seongjoon 2012.06.30 26926
135 Java CUBRID와 Oracle의 Clob 타입 사용 방법 비교. seongjoon 2012.06.30 54557
134 Install CUBRID기반으로 XE 운영하기 – 설치가이드 file cubebridge 2012.04.13 30931
133 기타 select .. for update 처리를 위한 Stored Procudure 등록 및 사용법 남재우 2011.12.10 24871
132 Install LINUX CUBRID 4.0 매니저 설치방법 file 정만영 2011.07.19 23654
131 Install CUBRID Ubuntu Launchpad Installation 방법 file 정만영 2011.07.19 29604
130 기타 자주 발생하는 큐브리드(cubrid) 에러 메시지 정리 admin 2011.07.14 81417
129 기타 [주의사항] CUBRID에서의 BLOB/CLOB 사용시 백업 및 복구에 대한 주의 점 admin 2011.07.14 52774
128 기타 CUBRID 매니저 R3.1에서 웹호스팅 서버의 CUBRID R2.1 접속하는 방법 (큐브리드 매니저에서 다른 버전의 큐브리드 서버 접속 방법) file admin 2011.07.14 31507
127 기타 동시 접속자에 따른 파라미터 설정 admin 2011.07.14 25684
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