Patching DST for Solaris and Oracle

Patching DST for Solaris and Oracle

1. Solaris:

1.1. copy last tzdata from http://www.iana.org/time-zones
1.2. unpack the archive into temporary directory
1.3. as root: #zic europe
this command compiles and installs updated timezone database
1.4. check that tz update applied

#! /usr/bin/perl
use POSIX qw(mktime),qw(strftime);
# Oct 26 02:00:00 MSD 2041
$t = mktime(0,10,1,26,9,2014-1900,-1,-1,1);
print strftime(“%c %Z\n”,localtime($t));
$t += 60*60;
print strftime(“%c %Z\n”,localtime($t));
$t += 60*60;
print strftime(“%c %Z\n”,localtime($t));

 

2. Oracle RDBMS:

2.1. download
DBMS_DST_scriptsV1.9.zip
p19396455_112030_SOLARIS64.zip

2.2. check current version of DST patch
  SELECT version FROM v$timezone_file;
  SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE ‘DST_%’
ORDER BY PROPERTY_NAME;

2.3. Unpack patch archive and copy files:

For 11.2.0.1 and 11.2.0.2 :
* Download the 11.2.0.3 or 11.2.0.4 DSTv23 Patch 19396455 for your platform.
* Unzip the RDBMS DSTv23 Patch 19396455
* Copy the 2 *.dat files (timezlrg_23.dat and timezone_23.dat ) and the readme_23.txt from the unzipped patch 19396455/files/oracore/zoneinfo directory to the server $ORACLE_HOME/oracore/zoneinfo directory
Note: in 11.2 and up there is no need to shut down or stop the database or other processes seen you are simply adding new files, not replacing used ones.
* Copy the 2 dat files from the patch 19396455/files/oracore/zoneinfo/big directory to the server $ORACLE_HOME/oracore/zoneinfo/big directory
* Copy the 2 dat files from the patch 19396455/files/oracore/zoneinfo/little directory to the server $ORACLE_HOME/oracore/zoneinfo/little directory
* Then update all databases using this home by:

  • or using the scripts in note 1585343.1 Scripts to automatically update the RDBMS DST (timezone) version in an 11gR2 or 12cR1 database .
  • or following Note 977512.1 Updating the RDBMS DST version in 11g Release 2 (11.2.0.1 and up) using DBMS_DST from step 3a) using 23 as (<the new DST version number>) in that note.

2.4. apply DST patch

  upg_tzv_check.sql
  upg_tzv_apply.sql

 

2.5. Check that DST applied

select
to_char(cast (SYS_EXTRACT_UTC (FROM_TZ (CAST (sysdate + XX AS TIMESTAMP), ‘Europe/Moscow’) ) as date), ‘DD.MM.YYYY HH24:MI’)
from dual

 

3. If you have physical standby instances,

then check that DTS patch propagated there and if not (in my case it did not) than switch roles and apply patch on each standby.