프린트 하기 URL 복사

OS 환경 : Oracle Linux 8.7 (64bit)

 

DB 환경 : Oracle Database 19.32.0.0

 

방법 : 오라클 19c 타임존 업그레이드 가이드

19c 환경에서 ru 패치를 하게 되면 타임존 파일도 새로 $ORACLE_HOME에 저장됨
하지만 자동으로 타임존이 업그레이드 되지 않기 때문에 수동으로 업그레이드 해줘야함
본문에서는 2개의 스크립트로 업그레이드 하는 방법을 설명함(@?/rdbms/admin/utltz_upg_check.sql, @?/rdbms/admin/utltz_upg_apply.sql)
utltz_upg_apply.sql 스크립트 내에 있는 명령으로 수동으로 PLSQL을 하나씩 입력하여 패치할수도 있지만 이 스크립트를 사용하는것이 편함

 

 

테스트
현재 환경은 19.31에서 19.32로 패치한 상황임

 

 

타임존 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
SQL> select * from v$timezone_file;
 
FILENAME                VERSION     CON_ID
-------------------- ---------- ----------
timezlrg_44.dat              44          0
 
SQL>
set lines 200 pages 1000
col property_name for a30
col value for a30
select property_name, substr(property_value, 1, 30) value
from database_properties
WHERE PROPERTY_NAME LIKE 'DST_%'
order by property_name;
 
PROPERTY_NAME                  VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION         44
DST_SECONDARY_TT_VERSION       0
DST_UPGRADE_STATE              NONE

현재 타임존 버전은 44임

 

 

타임존 업그레이드전 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
SQL> @?/rdbms/admin/utltz_upg_check.sql
 
Session altered.
 
INFO: Starting with RDBMS DST update preparation.
INFO: NO actual RDBMS DST update will be done by this script.
INFO: If an ERROR occurs the script will EXIT sqlplus.
INFO: Doing checks for known issues ...
INFO: Database version is 19.0.0.0 .
INFO: Database RDBMS DST version is DSTv44 .
INFO: No known issues detected.
INFO: Now detecting new RDBMS DST version.
A prepare window has been successfully started.
INFO: Newest RDBMS DST version detected is DSTv45 .
INFO: Next step is checking all TSTZ data.
INFO: It might take a while before any further output is seen ...
A prepare window has been successfully ended.
INFO: A newer RDBMS DST version than the one currently used is found.
INFO: Note that NO DST update was yet done.
INFO: Now run utltz_upg_apply.sql to do the actual RDBMS DST update.
INFO: Note that the utltz_upg_apply.sql script will
INFO: restart the database 2 times WITHOUT any confirmation or prompt.
 
Session altered.

이 단계에서 현재 타임존 버전은 몇인지, ORACLE_HOME에 존재하는 최신 타임존 버전은 몇인지를 확인함
*이 단계에서 문제가 나오는 경우 MOS 노트를 보고 꼭 해결한뒤 타임존 업그레이드를 진행해야함

 

 

타임존 업그레이드
*타임존 업그레이드시 자동으로 db가 2번 재기동됨
*1번은 OPEN MIGRATE 모드(UPGRADE 모드)로 open 되고 여기서 타임존이 업데이트 되고 이후 SHUTDOWN 후 정상 모드로 다시 open 됨(alert log를 보면 확인 가능함)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
SQL> @?/rdbms/admin/utltz_upg_apply.sql
 
Session altered.
 
INFO: If an ERROR occurs, the script will EXIT SQL*Plus.
INFO: The database RDBMS DST version will be updated to DSTv45 .  <<--!! 타임존이 45로 업데이트될 예정임
WARNING: This script will restart the database 2 times  <<--!! db가 2번 자동 재기동됨을 알림
WARNING: WITHOUT asking ANY confirmation.
WARNING: Hit control-c NOW if this is not intended.  <<--!! 여기 적힌것 처럼 의도한 패치가 아니라면 Ctrl+C를 입력해 즉시 중단 해야함
 
SCRIPT
--------------------------------------------------------------------------------------------------------------------------------
?/rdbms/admin/utltz_upg_apply_patch.sql
INFO: Restarting the database in UPGRADE mode to start the DST upgrade.
Database closed.
Database dismounted.
ORACLE instance shut down.  <<--!! db 종료됨
ORACLE instance started.  <<--!! startup upgrade로 기동 시도
 
Total System Global Area 2499802216 bytes
Fixed Size                  8942696 bytes
Variable Size             973078528 bytes
Database Buffers         1509949440 bytes
Redo Buffers                7831552 bytes
Database mounted.
Database opened.  <<--!! upgrade 모드로 기동됨
INFO: Starting the RDBMS DST upgrade.  <<--!! 타임존 업그레이드 시작
INFO: Upgrading all SYS owned TSTZ data.  <<--!! onwer가 SYS인 TSTZ data가 업그레이드됨
INFO: It might take time before any further output is seen ...
An upgrade window has been successfully started.
INFO: Restarting the database in NORMAL mode to upgrade non-SYS TSTZ data. 
Database closed.  <<--!! db 다시 종료됨
Database dismounted.
ORACLE instance shut down.
ORACLE instance started.  <<--!! normal 모드로 startup 시도
 
Total System Global Area 2499802216 bytes
Fixed Size                  8942696 bytes
Variable Size             973078528 bytes
Database Buffers         1509949440 bytes
Redo Buffers                7831552 bytes
Database mounted.
Database opened.  <<--!! normal 모드로 기동됨
INFO: Upgrading all non-SYS TSTZ data.  <<--!! owner가 non-SYS인 TSTZ data가 업그레이드됨
INFO: It might take time before any further output is seen ...
INFO: Do NOT start any application yet that uses TSTZ data!
INFO: Next is a list of all upgraded tables:
Table list: "SYSTEM"."DICTIONARY_TABLE_STATS"
Number of failures: 0
Table list: "SYSTEM"."FIXED_TABLE_STATS"
Number of failures: 0
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_S"
Number of failures: 0
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_L"
Number of failures: 0
INFO: Total failures during update of TSTZ data: 0 .
An upgrade window has been successfully ended.
INFO: Your new Server RDBMS DST version is DSTv45 .  <<--!! 정상적으로 타임존이 업그레이드됨
INFO: The RDBMS DST update is successfully finished.
INFO: Make sure to exit this SQL*Plus session.
INFO: Do not use it for timezone related selects.
 
Session altered.

완료됨

 

 

타임존 재확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
SQL> select * from v$timezone_file;
 
FILENAME                VERSION     CON_ID
-------------------- ---------- ----------
timezlrg_45.dat              45          0
 
SQL>
set lines 200 pages 1000
col property_name for a30
col value for a30
select property_name, substr(property_value, 1, 30) value
from database_properties
WHERE PROPERTY_NAME LIKE 'DST_%'
order by property_name;
 
PROPERTY_NAME                  VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION         45
DST_SECONDARY_TT_VERSION       0
DST_UPGRADE_STATE              NONE

타임존이 44에서 45로 업그레이됨

 

 

참고로 타임존 파일은 $ORACLE_HOME/oracore/zoneinfo에 존재함

타임존 단일 패치를 하게 되면 이 경로에 새로운 타임존.dat 파일이 생성됨

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ cd $ORACLE_HOME/oracore/zoneinfo
$ ls
big            readme_43.txt    timezlrg_17.dat  timezlrg_28.dat  timezlrg_39.dat  timezlrg_8.dat   timezone_1.dat   timezone_30.dat  timezone_41.dat
little         readme_44.txt    timezlrg_18.dat  timezlrg_29.dat  timezlrg_3.dat   timezlrg_9.dat   timezone_20.dat  timezone_31.dat  timezone_42.dat
readme_33.txt  readme_45.txt    timezlrg_19.dat  timezlrg_2.dat   timezlrg_40.dat  timezone_10.dat  timezone_21.dat  timezone_32.dat  timezone_43.dat
readme_34.txt  readme.txt       timezlrg_1.dat   timezlrg_30.dat  timezlrg_41.dat  timezone_11.dat  timezone_22.dat  timezone_33.dat  timezone_44.dat
readme_35.txt  timezdif.csv     timezlrg_20.dat  timezlrg_31.dat  timezlrg_42.dat  timezone_12.dat  timezone_23.dat  timezone_34.dat  timezone_45.dat
readme_36.txt  timezlrg_10.dat  timezlrg_21.dat  timezlrg_32.dat  timezlrg_43.dat  timezone_13.dat  timezone_24.dat  timezone_35.dat  timezone_4.dat
readme_37.txt  timezlrg_11.dat  timezlrg_22.dat  timezlrg_33.dat  timezlrg_44.dat  timezone_14.dat  timezone_25.dat  timezone_36.dat  timezone_5.dat
readme_38.txt  timezlrg_12.dat  timezlrg_23.dat  timezlrg_34.dat  timezlrg_45.dat  timezone_15.dat  timezone_26.dat  timezone_37.dat  timezone_6.dat
readme_39.txt  timezlrg_13.dat  timezlrg_24.dat  timezlrg_35.dat  timezlrg_4.dat   timezone_16.dat  timezone_27.dat  timezone_38.dat  timezone_7.dat
readme_40.txt  timezlrg_14.dat  timezlrg_25.dat  timezlrg_36.dat  timezlrg_5.dat   timezone_17.dat  timezone_28.dat  timezone_39.dat  timezone_8.dat
readme_41.txt  timezlrg_15.dat  timezlrg_26.dat  timezlrg_37.dat  timezlrg_6.dat   timezone_18.dat  timezone_29.dat  timezone_3.dat   timezone_9.dat
readme_42.txt  timezlrg_16.dat  timezlrg_27.dat  timezlrg_38.dat  timezlrg_7.dat   timezone_19.dat  timezone_2.dat   timezone_40.dat

 

 

결론 :
db 업그레이드 또는 ru 패치 후에는 타임존 업그레이드를 진행해줘야함
하지않을 경우 추후 특정 작업시 문제가 발생할수 있음
다운타임을 가질수 있는 ru 패치 시간에 같이 하는것이 좋음

 

 

참조 : 

1585343.1

https://docs.oracle.com/en/database/oracle/oracle-database/19/spuss/upgrading-time-zone-file-version-after-upgrading-oracle-db.html

https://docs.oracle.com/en/database/oracle/oracle-database/19/spmsu/upgrading-time-zone-file-version-after-upgrading-oracle-db.html

오라클 11gR2 Raw Device RAC to 19c ASM RAC Rman 백업셋 이용 업그레이드 방법 ( https://positivemh.tistory.com/1236 )

오라클 11g to 19c 업그레이드 시 restore point 이용 복원 테스트 ( https://positivemh.tistory.com/1280 )

https://khyup.tistory.com/319

https://khyup.tistory.com/320

https://checktech.tistory.com/38