среда, 27 февраля 2013 г.

Делегирование административных полномочий в Solaris

 Для того, чтобы обычный пользователь имел привилегии монтировать и размонтировать файловые системы,  ему необходимо назначить соответствующий профиль.

Посмотреть, какой профиль содержит команду  mount  можно так:

# grep "mount" /etc/security/exec_attr


Смотрим что еще позволяет делать этот профиль:

# grep "File System Management" /etc/security/exec_attr


Назначим этот профиль пользователю oragrid:

# usermod -P 'File System Management' oragrid

После этого пользователь oragrid может монтировать файловые системы используя  pfexec:

$ pfexec umount /u09/acfs

$ pfexec mount -F acfs /dev/asm/acfs_v1-27  /u09/acfs

ACFS

1. Создаем точки монтирования:

# mkdir  /u09/acfs
# cd /u09
# chown oradb:oinstall acfs
# chmod g+w acfs


2. Создаем тома на дисковой группе:

(sqlplus)

alter diskgroup acfsdg add  volume acfs_v1 size 100g;
select volume_name, volume_device from v$asm_volume;

(asmcmd)

ASMCMD [+] > volcreate -G acfsdg -s 100G acfs_v1
ASMCMD [+] > volinfo -a


3. Информация о томах:

ASMCMD> volinfo -a
Diskgroup Name: ACFSDG

         Volume Name: ACFS_V1
         Volume Device: /dev/asm/acfs_v1-27
         State: ENABLED
         Size (MB): 3813376
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath:

ASMCMD> exit


4. How to automatically mount the filesystem, after reboots

$ /usr/lib/fs/acfs/acfsutil registry -a  /dev/asm/acfs_v1-27  /u09/acfs
acfsutil registry: ACFS-05062: cannot query CRS resource


This command will add this filesystem in the Grid registry & will mount it after reboot or grid restart.
To unregister a file system from the Oracle Automatic Storage Management volume registry

/usr/lib/fs/acfs/acfsutil registry -d  /u09/acfs
acfsutil registry: ACFS-03143: The specified mount point does not exist and therefore cannot be deleted.



5. Создаем файловые системы на томах:

# mkfs -F acfs /dev/asm/acfs_v1-27 (Solaris)
# mkfs -t acfs /dev/asm/acfs_v1-27 (Linux)
# mkfs -V acfs /dev/asm/acfs_v1-27 (AIX)


# ls -lLh /dev/asm
total 0
brwxrwx---   1 root     asmadmin 308, 13825 Dec  6 14:15 acfs_v1-27
crwxrwx---   1 root     asmadmin 308, 13825 Dec  6 15:26 racfs_v1-27
#

# ls -l /dev/asm
total 2
lrwxrwxrwx   1 oragrid  oinstall      41 Dec  6 14:15 acfs_v1-27 -> /devices/pseudo/oracleadvm@0:acfs_v1-0-27
lrwxrwxrwx   1 oragrid  oinstall      45 Dec  6 14:15 racfs_v1-27 -> /devices/pseudo/oracleadvm@0:acfs_v1-0-27,raw
#


$ mkfs -F acfs /dev/asm/acfs_v1-27

mkfs: version                   = 11.2.0.3.0
mkfs: on-disk version           = 39.0
mkfs: volume                    = /dev/asm/acfs_v1-27
mkfs: ACFS-01010: Volume already contains an ACFS file system.  To reformat the volume, reissue mkfs with the -o f option.
mkfs: ACFS-01004: /dev/asm/racfs_v1-27 was not formatted.


$ mkfs -o f -F acfs /dev/asm/acfs_v1-27
mkfs: version                   = 11.2.0.3.0
mkfs: on-disk version           = 39.0
mkfs: volume                    = /dev/asm/acfs_v1-27
mkfs: volume size               = 3998614552576
mkfs: Format complete.

$

6. Монтируем созданные файловые системы

# mount -F acfs /dev/asm/acfs_v1-27  /u09/acfs (Solaris)
# mount -t acfs /dev/asm/acfs_v1-27  /u09/acfs (linux)
# mount -V acfs /dev/asm/acfs_v1-27  /u09/acfs (AIX)


# mount -F acfs /dev/asm/acfs_v1-27  /u09/acfs


# su - oradb
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
You have new mail.


7. Check and repair an Oracle ACFS file system.

# fsck -a -v -y -F acfs /dev/asm/acfs_v1-27 (Solaris)
# fsck -a -v -y -t acfs /dev/asm/acfs_v1-27 (Linux)
# fsck -a -v -y -V acfs /dev/asm/acfs_v1-27 (AIX)


8. Check

$ cd /u09/acfs

$ touch aaa

$ ls -l
total 128
-rw-r--r--   1 oradb    oinstall       0 Dec  6 16:01 aaa
drwx------   2 root     root       65536 Dec  6 15:40 lost+found


9. Изменять размер тома можно так:

/usr/lib/fs/acfs/acfsutil size -100G  /u09/acfs

$


1. Unmount the file system

# mount  /u09/acfs

# umount -a -t acfs (Linux Only)
# unmountall -F acfs (Solaris, AIX)



2. De-register the file system

# acfsutil registry -d /u09/acfs
acfsutil registry: successfully removed ACFS mount point /u09/acfs from Oracle Registry


3. Remove the file system

# /usr/lib/fs/acfs/acfsutil rmfs /dev/asm/acfs_v1-27


4. Disable the volume

ASMCMD> voldisable -G acfsdg acfs_v1

5. Delete the volume

ASMCMD> voldelete  -G acfsdg acfs_v1


6. Drop the volumne from the diskgroup

SQL> alter diskgroup acfsdg drop volume acfs_v1;

Diskgroup altered.


SQL> select volume_name,volume_device from v$asm_volume;

no rows selected


Solaris autostart script


# cp xyz /etc/init.d
# chmod 0744 /etc/init.d/xyz
# chown root:sys /etc/init.d/xyz
# cd /etc/init.d
# ln xyz /etc/rc2.d/S99xyz
# ln xyz /etc/rc0.d/K99xyz
# ls /etc/init.d/*xyz /etc/rc2.d/*xyz /etc/rc0.d/*xyz


cd  /etc/init.d



-rwxr--r--   1 root     root         345 Dec 13 17:54 oraagent
-rwxr--r--   1 root     root         386 Dec 14 12:32 oratgw



# more oraagent
#!/bin/sh

user=oraagent
SU=/bin/su
AGENT_HOME=/u01/app/oraagent/product/11.1.0/agent11g
export AGENT_HOME

case "$1" in
start)
$SU - $user $AGENT_HOME/bin/emctl start agent
;;
status)
$SU - $user $AGENT_HOME/bin/emctl status agent
;;
stop)
$SU - $user $AGENT_HOME/bin/emctl stop agent
;;
*)
echo "Usage : oraagent (start|status|stop)"
;;
esac


ln -s /etc/init.d/oraagent /etc/rc0.d/K01oraagent

ln -s /etc/init.d/oraagent /etc/rc2.d/K01oraagent
ln -s /etc/init.d/oraagent /etc/rc2.d/S99oraagent

ln -s /etc/init.d/oraagent /etc/rc3.d/K01oraagent
ln -s /etc/init.d/oraagent /etc/rc3.d/S99oraagent


# more oratgw
#!/bin/sh

user=oratgw
SU=/bin/su
ORACLE_HOME=/u01/app/oratgw/product/11.2.0.3/tg_1
export ORACLE_HOME

case "$1" in
start)
$SU - $user -c "$ORACLE_HOME/bin/lsnrctl start listener1522"
;;
status)
$SU - $user -c "$ORACLE_HOME/bin/lsnrctl status listener1522"
;;
stop)
$SU - $user -c "$ORACLE_HOME/bin/lsnrctl stop listener1522"
;;
*)
echo "Usage : oraagent (start|status|stop)"
;;
esac


ln -s /etc/init.d/oratgw /etc/rc0.d/K01oratgw

ln -s /etc/init.d/oratgw /etc/rc2.d/K01oratgw
ln -s /etc/init.d/oratgw /etc/rc2.d/S99oratgw

ln -s /etc/init.d/oratgw /etc/rc3.d/K01oratgw
ln -s /etc/init.d/oratgw /etc/rc3.d/S99oratgw

пятница, 22 февраля 2013 г.

Сервисы в Oracle Restart

Создаем сервисы в БД testdb:

exec dbms_service.create_service(service_name => 'testdb_app', network_name=> 'testdb_app');
exec dbms_service.start_service('testdb_app');

удалять так:
exec dbms_service.stop_service('testdb_app');
exec dbms_service.delete_service('testdb_app');


Добавляем базу testdb в конфигурацию oracle restart:

srvctl add database -d testdb_p -n testdb -i testdb -o /u01/app/oradb/product/11.2.0.3/dbhome_1 -p /u01/app/oradb/product/11.2.0.3/dbhome_1/dbs/spfiletestdb.ora  -s OPEN  -r PRIMARY  -t IMMEDIATE -y AUTOMATIC -a "DATA,RECO,REDO";

srvctl add database -d testdb_s -n testdb -i testdb -o /u01/app/oradb/product/11.2.0.3/dbhome_1 -p /u01/app/oradb/product/11.2.0.3/dbhome_1/dbs/spfiletestdb.ora  -s MOUNT -r PHYSICAL_STANDBY -t IMMEDIATE -y AUTOMATIC -a "DATA,RECO,REDO";


Тестовую базу можно добавить в режиме (manual)
после перезагрузки сервера базу нужно будет запускать руками

srvctl add database -d testdb -n testdb -i testdb -o /u01/app/oradb/product/11.2.0.3/dbhome_1 -p /u01/app/oradb/product/11.2.0.3/dbhome_1/dbs/spfiletestdb.ora  -s OPEN -r PRIMARY -t IMMEDIATE -y MANUAL -a "DATA,RECO,REDO,TEST";

Добавляем сервисы в конфигурацию oracle restart:

$ srvctl add service -d testdb_p -s testdb_app -l primary -e SELECT -m BASIC
$ srvctl modify service -d testdb_p -s testdb_app -z 180 -w 1
$ srvctl config service -d testdb_p


standby:

$ srvctl add service -d testdb_s -s testdb_app -l primary -e SELECT -m BASIC
$ srvctl modify service -d testdb_s -s testdb_app -z 180 -w 1
$ srvctl config service -d testdb_s




Регистрация сервисов БД в случае БЕЗ использования GI


Названия сервисов: SIDAPP для Primary и  SIDREP для Standby

Без поддержки TAF    
  
-- Для БД с ролью PRIMARY

begin
  DBMS_SERVICE.CREATE_SERVICE (
            service_name => 'TESTAPP',
            network_name => 'TESTAPP');
end;
/


-- Для БД с ролью STANDBY + READ ONLY

begin
  DBMS_SERVICE.CREATE_SERVICE (
            service_name => 'TESTREP',
            network_name => 'TESTREP');
end;
/

С поддержкой TAF

-- Для БД с ролью PRIMARY

begin
  DBMS_SERVICE.CREATE_SERVICE (
            service_name => 'TESTAPP',
            network_name => 'TESTAPP',
            failover_method  => 'BASIC',
            failover_type    => 'SELECT',
            failover_retries => 20,
            failover_delay   => 5);
end;
/

-- Для БД с ролью STANDBY + READ ONLY

begin
  DBMS_SERVICE.CREATE_SERVICE (
            service_name => 'TESTREP',
            network_name => 'TESTREP',
            failover_method  => 'BASIC',
            failover_type    => 'SELECT',
            failover_retries => 20,
            failover_delay   => 5);
end;
/


Процедура автозапуска сервисов в БД в зависимости от её РОЛИ

CREATE OR REPLACE TRIGGER SYS.startDGservices after startup on database
DECLARE
  db_role VARCHAR(30);
  db_open_mode VARCHAR(30);
BEGIN
  SELECT DATABASE_ROLE, OPEN_MODE INTO db_role, db_open_mode FROM V$DATABASE;
  IF db_role = 'PRIMARY' THEN DBMS_SERVICE.START_SERVICE('TESTAPP'); END IF;
  IF db_role = 'PHYSICAL STANDBY' AND db_open_mode LIKE 'READ ONLY%' THEN DBMS_SERVICE.START_SERVICE('TESTREP'); END IF;
END;
/


Процедуры ручного запуска сервисов в БД в зависимости от её РОЛИ

CREATE OR REPLACE procedure SYS.startAPPservice as
DECLARE
  db_role VARCHAR(30);
  db_open_mode VARCHAR(30);
BEGIN
  SELECT DATABASE_ROLE, OPEN_MODE INTO db_role, db_open_mode FROM V$DATABASE;
  IF db_role = 'PRIMARY' THEN DBMS_SERVICE.START_SERVICE('TESTAPP'); END IF;
END;
/

CREATE OR REPLACE procedure SYS.startREPservice as
DECLARE
  db_role VARCHAR(30);
  db_open_mode VARCHAR(30);
BEGIN
  SELECT DATABASE_ROLE, OPEN_MODE INTO db_role, db_open_mode FROM V$DATABASE;
  IF db_role = 'PHYSICAL STANDBY' AND db_open_mode LIKE 'READ ONLY%' THEN DBMS_SERVICE.START_SERVICE('TESTREP'); END IF;
END;
/


Процедуры ручной остановки сервисов в БД

create or replace procedure SYS.stopAPPservice as
begin
  DBMS_SERVICE.STOP_SERVICE('TESTAPP');
end;
/


create or replace procedure SYS.stopREPservice as
begin
  DBMS_SERVICE.STOP_SERVICE('TESTREP');
end;
/



Регистрация сервисов БД в случае использованияGI


Регистрация сервисов в Grid Infrastructure (GI)

Без поддержки TAF

-- Для БД с ролью PRIMARY

. oraenv
$ srvctl add service -d TEST_OMEGA01 \
                     -s TESTAPP         \
                     -l PRIMARY   \
                     -y AUTOMATIC \
                     -P NONE      \
                     -e NONE      \
                     -m NONE      \
                     -w 5         \
                     -z 20         

-- Для БД с ролью STANDBY + READ ONLY

. oraenv
$ srvctl add service -d TEST_OMEGA02 \
                     -s TESTREP         \
                     -l PHYSICAL_STANDBY \
                     -y AUTOMATIC \
                     -P NONE      \
                     -e NONE      \
                     -m NONE      \
                     -w 5         \
                     -z 20         

С поддержкой TAF

-- Для БД с ролью PRIMARY

. oraenv
$ srvctl add service -d TEST_OMEGA01 \
                     -s TESTAPP         \
                     -l PRIMARY   \
                     -y AUTOMATIC \
                     -P BASIC     \
                     -e SELECT    \
                     -m BASIC     \
                     -w 5         \
                     -z 20   

-- Для БД с ролью STANDBY + READ ONLY

. oraenv
$ srvctl add service -d TEST_OMEGA02 \
                     -s TESTREP         \
                     -l PHYSICAL_STANDBY \
                     -y AUTOMATIC \
                     -P BASIC     \
                     -e SELECT    \
                     -m BASIC     \
                     -w 5         \
                     -z 20


Процедура автозапуска сервисов в БД в зависимости от её РОЛИ

Работа сервисов контролируется ПО Grid Infrastructure в АВТО-режиме

Процедуры ручного запуска сервисов в БД в зависимости от её РОЛИ

$ srvctl start  service -d TEST_OMEGA01 -s TESTAPP –o OPEN
$ srvctl start  service -d TEST_OMEGA02 -s TESTREP


Процедуры ручной остановки сервисов в БД

$ srvctl stop  service -d TEST_OMEGA01 -s TESTAPP
$ srvctl stop  service -d TEST_OMEGA02 -s TESTREP


Процедура проверки характеристик зарегистрированного сервиса

$ srvctl config service -d TEST_OMEGA01 -s TESTAPP
$ srvctl config service -d TEST_OMEGA02 -s TESTREP


Проверка клиентский соединения на предмет использования сервисов с поддержкой технологии TAF :

col username format a25
col machine format a30
col module format a15
col service_name format a15
col server format a12
col failover_type format a15
col failover_method format a15
col failed_over format a15

select inst_id,sid,username, machine, substr(module,1,15) as module, service_name,server,
       case when failover_type='NONE'   then NULL else failover_type   end as failover_type,
       case when failover_method='NONE' then NULL else failover_method end as failover_method,
       case when failed_over='NO'       then NULL else failed_over     end as failed_over
from gv$session
order by 1,2;


Проверка работы сервисов

col host_name    format a22
col service_name format a22
col network_name format a22

select (select host_name from v$instance) host_name,
       name service_name,
       network_name
from v$services;


Настройка дескрипторов соединений на клиентской стороне


01 - Primary - должен быть поднят сервис APP
02 - Standby- доджен быть поднят сервис REP в режиме RO

Подключение к базам в БЕЗ Standby конфигурации:


Non-RAC конфигурация

TEST_APP =
  (DESCRIPTION =
    (ENABLE=BROKEN)
    (ADDRESS_LIST=
        (ADDRESS = (PROTOCOL = TCP)(HOST = omega01.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTAPP)
    )
  )


RAC конфигурация

TEST_APP =
  (DESCRIPTION =
     (ENABLE=BROKEN)
     (CONNECT_TIMEOUT=30)
     (TRANSPORT_CONNECT_TIMEOUT=10)
     (RETRY_COUNT=3)
     (ADDRESS_LIST=
       (LOAD_BALANCE=on)
       (ADDRESS = (PROTOCOL = TCP)(HOST = scan_omega01)(PORT = 1521))
     )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTAPP)
    )
  )


Подключение к базам в  Standby конфигурации:


Non-RAC конфигурация

TEST_APP =
  (DESCRIPTION =
    (ENABLE=BROKEN)
    (TRANSPORT_CONNECT_TIMEOUT=10)
    (ADDRESS_LIST=
      (LOAD_BALANCE=OFF)
      (FAILOVER=ON)
        (ADDRESS = (PROTOCOL = TCP)(HOST = omega01.localdomain)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = omega02.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTAPP)
    )
  )

TEST_REP =
  (DESCRIPTION =
    (ENABLE=BROKEN)
    (TRANSPORT_CONNECT_TIMEOUT=10)
    (ADDRESS_LIST=
      (LOAD_BALANCE=OFF)
      (FAILOVER=ON)
        (ADDRESS = (PROTOCOL = TCP)(HOST = omega01.localdomain)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = omega02.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTREP)
    )
  )


RAC конфигурация

TEST_APP =
  (DESCRIPTION_LIST=
     (LOAD_BALANCE=OFF)
     (FAILOVER=ON)
       (DESCRIPTION=
          (ENABLE=BROKEN)
          (CONNECT_TIMEOUT=30)
          (TRANSPORT_CONNECT_TIMEOUT=10)
          (RETRY_COUNT=3)
          (ADDRESS_LIST=
            (LOAD_BALANCE=ON)
            (ADDRESS=(PROTOCOL=TCP)(HOST=scan_omega01)(PORT=1521))
          )
            (CONNECT_DATA=
              (SERVER = DEDICATED)
              (SERVICE_NAME=TESTAPP)
            )
       )
       (DESCRIPTION=
          (ENABLE=BROKEN)
          (CONNECT_TIMEOUT=30)
          (TRANSPORT_CONNECT_TIMEOUT=10)
          (RETRY_COUNT=3)
          (ADDRESS_LIST=
            (LOAD_BALANCE=ON)
            (ADDRESS=(PROTOCOL=TCP)(HOST=scan_omega02)(PORT=1521))
          )
            (CONNECT_DATA=
              (SERVER = DEDICATED)
              (SERVICE_NAME=TESTAPP)
            )
       )
  )


TEST_REP =
  (DESCRIPTION_LIST=
     (LOAD_BALANCE=OFF)
     (FAILOVER=ON)
       (DESCRIPTION=
          (ENABLE=BROKEN)
          (CONNECT_TIMEOUT=30)
          (TRANSPORT_CONNECT_TIMEOUT=10)
          (RETRY_COUNT=3)
          (ADDRESS_LIST=
            (LOAD_BALANCE=ON)
            (ADDRESS=(PROTOCOL=TCP)(HOST=scan_omega01)(PORT=1521))
          )
            (CONNECT_DATA=
              (SERVER = DEDICATED)
              (SERVICE_NAME=TESTREP)
            )
       )
       (DESCRIPTION=
          (ENABLE=BROKEN)
          (CONNECT_TIMEOUT=30)
          (TRANSPORT_CONNECT_TIMEOUT=10)
          (RETRY_COUNT=3)
          (ADDRESS_LIST=
            (LOAD_BALANCE=ON)
            (ADDRESS=(PROTOCOL=TCP)(HOST=scan_omega02)(PORT=1521))
          )
            (CONNECT_DATA=
              (SERVER = DEDICATED)
              (SERVICE_NAME=TESTREP)
            )
       )
  )




Configure Oracle Grid Infrastructure for a Standalone Server

# /u01/app/11.2.0.3/grid/perl/bin/perl -I /u01/app/11.2.0.3/grid/perl/lib -I /u01/app/11.2.0.3/grid/crs/install /u01/app/11.2.0.3/grid/crs/install/roothas.pl -deconfig -force
Using configuration parameter file: /u01/app/11.2.0.3/grid/crs/install/crsconfig_params
CRS resources for listeners are still configured
PRKO-2573 : ONS daemon is already stopped.
CRS-2673: Attempting to stop 'ora.cssd' on 'omega.sun.com'
CRS-2677: Stop of 'ora.cssd' on 'omega.sun.com' succeeded
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'omega.sun.com'
CRS-2673: Attempting to stop 'ora.evmd' on 'omega.sun.com'
CRS-2677: Stop of 'ora.evmd' on 'omega.sun.com' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'omega.sun.com' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle Restart stack

# /u01/app/11.2.0.3/grid/perl/bin/perl -I /u01/app/11.2.0.3/grid/perl/lib -I /u01/app/11.2.0.3/grid/crs/install /u01/app/11.2.0.3/grid/crs/install/roothas.pl
Using configuration parameter file: /u01/app/11.2.0.3/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oragrid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node omega.sun.com successfully pinned.
Adding Clusterware entries to inittab
omega.sun.com     2013/02/12 14:12:01     /u01/app/11.2.0.3/grid/cdata/omega.sun.com/backup_20130212_141201.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server


# ls -l /etc/inittab
-rw-r--r--   1 root     root        1130 Feb 12 14:11 /etc/inittab
root@omega.sun.ru # more /etc/inittab
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# The /etc/inittab file controls the configuration of init(1M); for more
# information refer to init(1M) and inittab(4).  It is no longer
# necessary to edit inittab(4) directly; administrators should use the
# Solaris Service Management Facility (SMF) to define services instead.
# Refer to smf(5) and the System Administration Guide for more
# information on SMF.
#
# For modifying parameters passed to ttymon, use svccfg(1m) to modify
# the SMF repository. For example:
#
#       # svccfg
#       svc:> select system/console-login
#       svc:/system/console-login> setprop ttymon/terminal_type = "xterm"
#       svc:/system/console-login> exit
#
#ident  "@(#)inittab    1.41    04/12/14 SMI"
ap::sysinit:/sbin/autopush -f /etc/iu.ap
sp::sysinit:/sbin/soconfig -f /etc/sock2path
smf::sysinit:/lib/svc/bin/svc.startd    >/dev/msglog 2<>/dev/msglog
p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog
pt:s1234:powerfail:/lib/svc/method/installupdates lock

h1:3:respawn:/etc/init.d/init.ohasd run >/dev/null 2>&1

#


# ps -ef|grep ohas
 oragrid 17353     1   0 14:11:35 ?           0:02 /u01/app/11.2.0.3/grid/bin/ohasd.bin reboot
    root 17766  6506   0 14:19:46 pts/3       0:00 grep ohas
    root 17322     1   0 14:11:35 ?           0:00 /bin/sh /etc/init.d/init.ohasd run
#


# /u01/app/11.2.0.3/grid/bin/crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
               OFFLINE OFFLINE      omega.sun.com
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        OFFLINE OFFLINE
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       omega.sun.com


# /u01/app/11.2.0.3/grid/bin/crsctl check has
CRS-4638: Oracle High Availability Services is online

# /u01/app/11.2.0.3/grid/bin/crsctl check css
CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
#

# /u01/app/11.2.0.3/grid/bin/crsctl start resource ora.cssd -init
CRS-2672: Attempting to start 'ora.cssd' on 'omega.sun.com'
CRS-2672: Attempting to start 'ora.diskmon' on 'omega.sun.com'
CRS-2676: Start of 'ora.diskmon' on 'omega.sun.com' succeeded
CRS-2676: Start of 'ora.cssd' on 'omega.sun.com' succeeded
#

# /u01/app/11.2.0.3/grid/bin/crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
               OFFLINE OFFLINE      omega.sun.com
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       omega.sun.com
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       omega.sun.com
#



В 11.2.0.3 diskmon.bin  не offline только для Exadate.

Если нет процессов то переконфигурировать  Grid Infrastructure.

А так делать не нужно:

crsctl delete resource ora.cssd
.....

crsctl add resource ora.cssd
.....


# /u01/app/11.2.0.3/grid/bin/crsctl modify resource "ora.cssd" -attr "AUTO_START=1"
# /u01/app/11.2.0.3/grid/bin/crsctl modify resource "ora.diskmon" -attr "AUTO_START=1"

#
# /u01/app/11.2.0.3/grid/bin/crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'omega.sun.com'
CRS-2673: Attempting to stop 'ora.cssd' on 'omega.sun.com'
CRS-2677: Stop of 'ora.cssd' on 'omega.sun.com' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'omega.sun.com'
CRS-2677: Stop of 'ora.evmd' on 'omega.sun.com' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'omega.sun.com' has completed
CRS-4133: Oracle High Availability Services has been stopped.

#
# /u01/app/11.2.0.3/grid/bin/crsctl start has
CRS-4123: Oracle High Availability Services has been started.
#


# /u01/app/11.2.0.3/grid/bin/crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
               OFFLINE OFFLINE      omega.sun.com
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       omega.sun.com
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       omega.sun.com
root@omega.sun.ru #


Конфигурация листенера:

$netca &


$srvctl config listener
Name: LISTENER
Home: /u01/app/11.2.0.3/grid
End points: TCP:1521
$

/u01/app/11.2.0.3/grid/bin/srvctl add listener -l LISTENER -s -p TCP:1521 -o /u01/app/11.2.0.3/grid

Конфигурация ASM:

$asmca &

$srvctl config asm
ASM home: /u01/app/11.2.0.3/grid
ASM listener: LISTENER
Spfile: +DATA/asm/asmparameterfile/registry.253.807812965
ASM diskgroup discovery string: /dev/rdsk/c*s4
$

$srvctl stop asm -f

$srvctl start asm

$srvctl modify resource "ora.asm" -attr "AUTO_START=1"

$srvctl add asm -l LISTENER -p +DATA/asm/asmparameterfile/registry.253.807812965 -d /dev/rdsk/c*s4


Recreate ASM parameterfile (spfile):

vi /tmp/init+ASM.ora

*.asm_diskstring='/dev/rdsk/c*s4'
*.asm_power_limit=1
*.diagnostic_dest='/u01/app/oragrid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'


$sqlplus "/as sysasm"

alter diskgroup DATA mount;

create spfile='+DATA' from pfile='/tmp/init+ASM.ora';

show parameter spfile;




# /u01/app/11.2.0.3/grid/bin/crsctl start has
# /u01/app/11.2.0.3/grid/bin/crsctl stop has
# /u01/app/11.2.0.3/grid/bin/crsctl status resource -t


Перенос дисковой группы с одного диска на другой:


alter diskgroup DATA add disk new_disk;
alter diskgroup DATA drop disk old_disk;


подождать

select * from v$asm_operation;


ADD ASM

$srvctl add asm -l LISTENER -p /u01/app/11.2.0.3/grid/dbs/init+ASM.ora  -d /dev/rdsk/c*s4

$srvctl start asm



export ORACLE_SID=+ASM
export ORACLE_HOME=/u01/app/11.2.0.3/grid

sqlplus "/as sysasm"


create diskgroup DATA external redundancy
disk '/dev/rdsk/c6t.....d0s4',
disk '/dev/rdsk/c6t.....d0s4'
attribute 'compatible.asm'='11.2.0.0.0';


create pfile='/tmp/pfile' from memory;

Правим файл в другой сессии:

vi /tmp/pfile
*.asm_diskstring='/dev/rdsk/c*s4'
*.asm_power_limit=1
*.diagnostic_dest='/u01/app/oragrid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'


create spfile='+DATA' from pfile='/tmp/pfile';
shutdown immediate;
startup;
show parameter spfile;

orapwd file=/u01/app/11.2.0.3/grid/dbs/orapw+ASM password=oracle




When setting ASM Monitoring Configuration with SYSASM or SYSDBA In Grid Control 11g [ID 977472.1]


For 11gR2 follow the procedure below to create the ASM password file:
1. Create the password file for ASM on all nodes (if RAC) as follows:
orapwd file=$GRID_INFRASTRUCTURE_HOME/dbs/orapw+ASM password= entries=5

2. Update the password file with the following users/roles:
sqlplus / as sysasm
SQL> create user asmsnmp identified by
SQL> grant sysasm to sys;
SQL> grant sysdba to asmsnmp;


3. Review changes to the password file by querying v$pwfile_users:

SQL> select * from v$pwfile_users;
USERNAME    SYSDB SYSOP SYSAS
---------   ----- ----- -----
SYS         TRUE  TRUE  TRUE
ASMSNMP     TRUE  FALSE FALSE



For 11gR1 follow the procedure below to create the ASM password file:
1. Create the password file for ASM on all nodes (if RAC) as follows:
orapwd file=$ORA_ASM_HOME/dbs/orapw password= entries=5

2. Update the password file with the following users/roles:
sqlplus / as sysdba
SQL> grant sysasm to sys;


3. Review changes to the password file by querying v$pwfile_users:

SQL> select * from v$pwfile_users;
USERNAME  SYSDB SYSOP SYSAS
--------- ----- ----- -----
SYS       TRUE  FALSE TRUE


Initialize the devices using dd

Clean the device before we will reformat.
$ dd if=/dev/zero of=/dev/sda8 bs=1M count=100

dd if=/dev/zero of=/dev/rdsk/c3t60080E500017CAA8000006954EEA57CDd0s0 bs=8192 count=12800

Linux:

OCR disk device
dd if=/dev/zero of=/dev/sdc1 bs=125829120 count=1

Voting disk
dd if=/dev/zero of=/dev/sde1 bs=20971520 count=1


Solaris:

OCR disk device
dd if=/dev/zero of=/dev/rdsk/c1t2d3s4 bs=1M count=256

Voting disk
dd if=/dev/zero of=/dev/rdsk/c1t2d3s4 bs=1M count=256

четверг, 21 февраля 2013 г.

Установка DST 19

#su - oradb
$cd /tmp
$ls -l
total 588496
-rw-r--r--   1 oradb    oinstall  314120 Jan 16 10:48 p15897859_112030_SOLARIS64.zip

$unzip p15897859_112030_SOLARIS64.zip

Archive:  p15897859_112030_SOLARIS64.zip
   creating: 15897859/
  inflating: 15897859/README.txt
  inflating: 15897859/README.html
   creating: 15897859/files/
   creating: 15897859/files/oracore/
   creating: 15897859/files/oracore/zoneinfo/
  inflating: 15897859/files/oracore/zoneinfo/readme_19.txt
   creating: 15897859/files/oracore/zoneinfo/little/
  inflating: 15897859/files/oracore/zoneinfo/little/timezlrg_19.dat
  inflating: 15897859/files/oracore/zoneinfo/little/timezone_19.dat
  inflating: 15897859/files/oracore/zoneinfo/timezlrg_19.dat
  inflating: 15897859/files/oracore/zoneinfo/timezone_19.dat
   creating: 15897859/files/oracore/zoneinfo/big/
  inflating: 15897859/files/oracore/zoneinfo/big/timezlrg_19.dat
  inflating: 15897859/files/oracore/zoneinfo/big/timezone_19.dat
   creating: 15897859/etc/
   creating: 15897859/etc/config/
  inflating: 15897859/etc/config/inventory.xml
  inflating: 15897859/etc/config/actions.xml
  inflating: 15897859/etc/config/deploy.xml
   creating: 15897859/etc/xml/
  inflating: 15897859/etc/xml/GenericActions.xml
  inflating: 15897859/etc/xml/ShiphomeDirectoryStructure.xml

$ls -l
drwxr-xr-x   4 oradb    oinstall     374 Dec 31 12:31 15897859
-rw-r--r--   1 oradb    oinstall  314120 Jan 16 10:48 p15897859_112030_SOLARIS64.zip

$cd 15897859

$/u01/app/oradb/product/11.2.0.3/dbhome_1/OPatch/opatch apply

$
 


$export ORACLE_SID=testdb
$sqlplus "/as sysdba"


SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 22 09:55:57 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 4.0899E+10 bytes
Fixed Size                  2168160 bytes
Variable Size            3892316832 bytes
Database Buffers         3.6910E+10 bytes
Redo Buffers               95125504 bytes
Database mounted.
SQL> SELECT * FROM v$timezone_file;

FILENAME                VERSION
-------------------- ----------
timezlrg_19.dat              19

SQL> alter database open;

Database altered.

SQL> SELECT * FROM v$timezone_file;

FILENAME                VERSION
-------------------- ----------
timezlrg_14.dat              14

SQL>
SQL> select u.name || '.' || o.name || '.' || c.name TSLTZcolumn
from sys.obj$ o, sys.col$ c, sys.user$ u
where c.type# = 231
and o.obj# = c.obj#
and u.user# = o.owner#; 
2    3    4    5

no rows selected

SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;
  2    3    4

PROPERTY_NAME                  VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION         14
DST_SECONDARY_TT_VERSION       0
DST_UPGRADE_STATE              NONE

SQL> select TZ_VERSION from sys.registry$database;

TZ_VERSION
----------
        14

SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;

  2    3    4
PROPERTY_NAME                  VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION         14
DST_SECONDARY_TT_VERSION       0
DST_UPGRADE_STATE              NONE

SQL>
SQL> SELECT version FROM v$timezone_file;
   VERSION
----------
        14

SQL> purge dba_recyclebin;

DBA Recyclebin purged.

SQL> alter session set "_with_subquery"=materialize;
Session altered.

SQL> alter session set "_simple_view_merging"=TRUE;

Session altered.

SQL> exec DBMS_DST.BEGIN_PREPARE(19);

PL/SQL procedure successfully completed.

SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;
  2    3    4

PROPERTY_NAME                  VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION         14
DST_SECONDARY_TT_VERSION       19
DST_UPGRADE_STATE              PREPARE

SQL> TRUNCATE TABLE SYS.DST$TRIGGER_TABLE;

Table truncated.

SQL> TRUNCATE TABLE sys.dst$affected_tables;

Table truncated.

SQL> TRUNCATE TABLE sys.dst$error_table;

Table truncated.

SQL> set serveroutput on
SQL> BEGIN
DBMS_DST.FIND_AFFECTED_TABLES
(affected_tables => 'sys.dst$affected_tables',
log_errors => TRUE,
log_errors_table => 'sys.dst$error_table');
END;

/  2    3    4    5    6    7

PL/SQL procedure successfully completed.

SQL> SELECT * FROM sys.dst$affected_tables;
TABLE_OWNER                    TABLE_NAME
------------------------------ ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
 ROW_COUNT ERROR_COUNT
---------- -----------
SYS                            KET$_AUTOTASK_STATUS
MW_START_TIME
         1           0

SYS                            KET$_CLIENT_TASKS
CURR_WIN_START
         3           0

TABLE_OWNER                    TABLE_NAME
------------------------------ ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
 ROW_COUNT ERROR_COUNT
---------- -----------

SYS                            SCHEDULER$_JOB
LAST_END_DATE
         7           0

SYS                            SCHEDULER$_JOB
LAST_START_DATE

TABLE_OWNER                    TABLE_NAME
------------------------------ ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
 ROW_COUNT ERROR_COUNT
---------- -----------
         7           0

SYS                            SCHEDULER$_JOB
NEXT_RUN_DATE
         5           0

SYS                            SCHEDULER$_JOB

TABLE_OWNER                    TABLE_NAME
------------------------------ ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
 ROW_COUNT ERROR_COUNT
---------- -----------
LAST_ENABLED_TIME
         8           0

SYS                            SCHEDULER$_JOB
START_DATE
         5           0


TABLE_OWNER                    TABLE_NAME
------------------------------ ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
 ROW_COUNT ERROR_COUNT
---------- -----------
SYS                            SCHEDULER$_JOB_RUN_DETAILS
REQ_START_DATE
         9           0

SYS                            SCHEDULER$_JOB_RUN_DETAILS
START_DATE
        14           0

TABLE_OWNER                    TABLE_NAME
------------------------------ ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
 ROW_COUNT ERROR_COUNT
---------- -----------

SYS                            SCHEDULER$_WINDOW
ACTUAL_START_DATE
         1           0

SYS                            SCHEDULER$_WINDOW
LAST_START_DATE

TABLE_OWNER                    TABLE_NAME
------------------------------ ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
 ROW_COUNT ERROR_COUNT
---------- -----------
         7           0

SYS                            SCHEDULER$_WINDOW
NEXT_START_DATE
         9           0

SYS                            SCHEDULER$_WINDOW_DETAILS

TABLE_OWNER                    TABLE_NAME
------------------------------ ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
 ROW_COUNT ERROR_COUNT
---------- -----------
REQ_START_DATE
         1           0

SYS                            SCHEDULER$_WINDOW_DETAILS
START_DATE
         1           0


14 rows selected.

SQL> SELECT * FROM sys.dst$error_table;

no rows selected

SQL> SELECT * FROM sys.dst$error_table where ERROR_NUMBER= '1883';

no rows selected

SQL> SELECT * FROM sys.dst$error_table where ERROR_NUMBER= '1878';
no rows selected

SQL> SELECT * FROM sys.dst$error_table where ERROR_NUMBER not in ('1878','1883');

no rows selected

SQL> EXEC DBMS_DST.END_PREPARE;
A prepare window has been successfully ended.

PL/SQL procedure successfully completed.

SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;
  2    3    4

PROPERTY_NAME                  VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION         14
DST_SECONDARY_TT_VERSION       0
DST_UPGRADE_STATE              NONE

SQL>
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup upgrade;
ORACLE instance started.

Total System Global Area 4.0899E+10 bytes
Fixed Size                  2168160 bytes
Variable Size            3892316832 bytes
Database Buffers         3.6910E+10 bytes
Redo Buffers               95125504 bytes
Database mounted.
Database opened.
SQL>
SQL> set serveroutput on
SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;
  2    3    4

PROPERTY_NAME                  VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION         14
DST_SECONDARY_TT_VERSION       0
DST_UPGRADE_STATE              NONE

SQL> purge dba_recyclebin;
DBA Recyclebin purged.

SQL> TRUNCATE TABLE SYS.DST$TRIGGER_TABLE;

Table truncated.

SQL> TRUNCATE TABLE sys.dst$affected_tables;

Table truncated.

SQL> TRUNCATE TABLE sys.dst$error_table;
Table truncated.

SQL> alter session set "_with_subquery"=materialize;

Session altered.

SQL> alter session set "_simple_view_merging"=TRUE;

Session altered.

SQL> EXEC DBMS_DST.BEGIN_UPGRADE(19);
An upgrade window has been successfully started.

PL/SQL procedure successfully completed.

SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;
  2    3    4

PROPERTY_NAME                  VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION         19
DST_SECONDARY_TT_VERSION       14
DST_UPGRADE_STATE              UPGRADE

SQL> SELECT OWNER, TABLE_NAME, UPGRADE_IN_PROGRESS FROM ALL_TSTZ_TABLES where UPGRADE_IN_PROGRESS='YES';

OWNER                          TABLE_NAME                     UPG
------------------------------ ------------------------------ ---
SYSMAN                         AQ$_MGMT_LOADER_QTABLE_L       YES
SYSMAN                         AQ$_MGMT_LOADER_QTABLE_S       YES
SYSMAN                         AQ$_MGMT_NOTIFY_QTABLE_L       YES
SYSMAN                         AQ$_MGMT_NOTIFY_QTABLE_S       YES
SYSMAN                         MGMT_PROV_ASSIGNMENT           YES
SYSMAN                         MGMT_PROV_BOOTSERVER           YES
SYSMAN                         MGMT_PROV_CLUSTER_NODES        YES
SYSMAN                         MGMT_PROV_DEFAULT_IMAGE        YES
SYSMAN                         MGMT_PROV_IP_RANGE             YES
SYSMAN                         MGMT_PROV_NET_CONFIG           YES
SYSMAN                         MGMT_PROV_OPERATION            YES

OWNER                          TABLE_NAME                     UPG
------------------------------ ------------------------------ ---
SYSMAN                         MGMT_PROV_RPM_REP              YES
SYSMAN                         MGMT_PROV_STAGING_DIRS         YES
SYSMAN                         MGMT_PROV_SUITE_INST_MEMBERS   YES

14 rows selected.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 4.0899E+10 bytes
Fixed Size                  2168160 bytes
Variable Size            3892316832 bytes
Database Buffers         3.6910E+10 bytes
Redo Buffers               95125504 bytes
Database mounted.
Database opened.
SQL> set serveroutput on
SQL> VAR numfail number
SQL> BEGIN
  2  DBMS_DST.UPGRADE_DATABASE(:numfail,
  3  parallel => TRUE,
  4  log_errors => TRUE,
  5  log_errors_table => 'SYS.DST$ERROR_TABLE',
  6  log_triggers_table => 'SYS.DST$TRIGGER_TABLE',
  7  error_on_overlap_time => FALSE,
  8  error_on_nonexisting_time => FALSE);
  9  DBMS_OUTPUT.PUT_LINE('Failures:'|| :numfail);
 10  END;

 11  /
Table list: "SYSMAN"."MGMT_PROV_SUITE_INST_MEMBERS"
Number of failures: 0
Table list: "SYSMAN"."MGMT_PROV_STAGING_DIRS"
Number of failures: 0
Table list: "SYSMAN"."MGMT_PROV_RPM_REP"
Number of failures: 0
Table list: "SYSMAN"."MGMT_PROV_OPERATION"
Number of failures: 0
Table list: "SYSMAN"."MGMT_PROV_NET_CONFIG"
Number of failures: 0
Table list: "SYSMAN"."MGMT_PROV_IP_RANGE"
Number of failures: 0
Table list: "SYSMAN"."MGMT_PROV_DEFAULT_IMAGE"
Number of failures: 0
Table list: "SYSMAN"."MGMT_PROV_CLUSTER_NODES"
Number of failures: 0
Table list: "SYSMAN"."MGMT_PROV_BOOTSERVER"
Number of failures: 0
Table list: "SYSMAN"."MGMT_PROV_ASSIGNMENT"
Number of failures: 0
Table list: "SYSMAN"."AQ$_MGMT_NOTIFY_QTABLE_S"
Number of failures: 0
Table list: "SYSMAN"."AQ$_MGMT_NOTIFY_QTABLE_L"
Number of failures: 0
Table list: "SYSMAN"."AQ$_MGMT_LOADER_QTABLE_S"
Number of failures: 0
Table list: "SYSMAN"."AQ$_MGMT_LOADER_QTABLE_L"
Number of failures: 0
Failures:0

PL/SQL procedure successfully completed.

SQL>
SQL> VAR fail number
BEGIN
DBMS_DST.END_UPGRADE(:fail);
DBMS_OUTPUT.PUT_LINE('Failures:'|| :fail);
END;

/SQL>   2    3    4    5
An upgrade window has been successfully ended.
Failures:0

PL/SQL procedure successfully completed.

SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;
  2    3    4

PROPERTY_NAME                  VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION         19
DST_SECONDARY_TT_VERSION       0
DST_UPGRADE_STATE              NONE

SQL> SELECT * FROM v$timezone_file;

FILENAME                VERSION
-------------------- ----------
timezlrg_19.dat              19

SQL> SELECT VERSION FROM v$timezone_file;

   VERSION
----------
        19

SQL> select TZ_VERSION from registry$database;

TZ_VERSION
----------
        14

SQL> update registry$database set TZ_VERSION = (select version FROM v$timezone_file);

1 row updated.

SQL> commit;

Commit complete.

SQL> select TZ_VERSION from registry$database;

TZ_VERSION
----------
        19


SQL> create or replace and compile java source named "OffsetFromStandard" as
  2  import java.util.Calendar;
  3  import java.util.GregorianCalendar;
  4  import java.util.TimeZone;
  5
  6  public class OffsetFromStandard
  7  {
  8     public static int getDSTOffset(
  9       String timezone,
 10       int year,
 11       int month,
 12       int mday,
 13       int hour,
 14       int min,
 15       int sec)
 16     {
 17       int RetVal = -360000000;
 18       String[] TZs = TimeZone.getAvailableIDs();
 19       for (int i = 0; i < TZs.length; i++)
 20       {
 21         if (timezone.equals(TZs[i]))
 22         {
 23           TimeZone tz = TimeZone.getTimeZone(timezone);
 24           GregorianCalendar c = new GregorianCalendar(tz);
 25           c.set(year, month-1, mday, hour, min, sec);
 26           RetVal = c.get(Calendar.DST_OFFSET);
 27         };
 28       }
 29       return RetVal;
 30     }
 31  }
 32  /


Java created.

SQL> alter java class "OffsetFromStandard" resolve
/  2

Java altered.

SQL> CREATE OR REPLACE function get_dst_offset (timezone VARCHAR2,
  2                                                  year NUMBER,
  3                                                 month NUMBER,
  4                                                  mday NUMBER,
  5                                                  hour NUMBER,
  6                                                   min NUMBER,
  7                                                   sec NUMBER) RETURN NUMBER AS
  8  LANGUAGE JAVA NAME 'OffsetFromStandard.getDSTOffset (java.lang.String, int, int, int, int, int, int) return int';

  9  /

Function created.

SQL> CREATE OR REPLACE function test_dst(timezone VARCHAR2,
  2                                                   year NUMBER,
  3                                                  month NUMBER,
  4                                                   mday NUMBER,
  5                                                   hour NUMBER,
  6                                                    min NUMBER,
  7                                                    sec NUMBER) RETURN varchar2 as
  8     retval varchar2(40);
  9  begin
 10     select case get_dst_offset (timezone,year,month,mday,hour,min,sec)
 11       when 3600000 then 'Timestamp is *in* DST'
 12       when 0 then 'Timestamp is *not* in DST'
 13       when -360000000 then 'Time Zone not valid'
 14       else 'Error' end into retval from dual;
 15     return retval;
 16  end;

 17  /

Function created.

SQL> set serveroutput on
SQL> begin
  2     if test_dst('America/New_York', 2007, 3, 11, 11, 0, 0)= 'Timestamp is *in* DST' then
  3       dbms_output.put_line('V3 (or later) Time Zone Update is applied');
  4     else
  5       dbms_output.put_line('V3 (or later) Time Zone Update is not applied');
  6     end if;
  7     if test_dst('America/Edmonton', 2007, 3, 11, 11, 0, 0) = 'Timestamp is *in* DST' then
  8       dbms_output.put_line('V4 (or later) Time Zone Update is applied');
  9     else
 10       dbms_output.put_line('V4 (or later) Time Zone Update is not applied');
 11     end if;
 12     if test_dst('Pacific/Auckland', 2008, 4, 5, 11, 0, 0) = 'Timestamp is *in* DST' then
 13       dbms_output.put_line('V6 tzdata2007f (or later) Time Zone Update is applied');
 14     else
 15       dbms_output.put_line('V6 tzdata2007f (or later) Time Zone Update is not applied');
 16     end if;
 17     if test_dst('Australia/Adelaide', 2008, 4, 5, 11, 0, 0) = 'Timestamp is *in* DST' then
 18       dbms_output.put_line('V7 tzdata2007k (or later) Time Zone Update is applied');
 19     else
 20       dbms_output.put_line('V7 tzdata2007k (or later) Time Zone Update is not applied');
 21     end if;
 22     if test_dst('Africa/Casablanca', 2008, 6, 1, 23, 0, 0) = 'Timestamp is *in* DST' then
 23       dbms_output.put_line('V9 tzdata2008f (or later) Time Zone Update is applied');
 24     else
 25       dbms_output.put_line('V9 tzdata2008f (or later) Time Zone Update is not applied');
 26     end if;
 27       if test_dst('Asia/Damascus', 2008, 10, 15, 10, 0, 0) = 'Timestamp is *in* DST' then
 28       dbms_output.put_line('V10 tzdata2008i (or later) Time Zone Update is applied');
 29     else
 30       dbms_output.put_line('V10 tzdata2008i (or later) Time Zone Update is not applied');
 31     end if;
 32     if test_dst('Asia/Karachi', 2009, 04, 16, 10, 0, 0) = 'Timestamp is *in* DST' then
 33       dbms_output.put_line('V11 tzdata2009g (or later) Time Zone Update is applied');
 34     else
 35       dbms_output.put_line('V11 tzdata2009g (or later) Time Zone Update is not applied');
 36     end if;
 37  -- DSTv13 check changed since this gave a false negative when DSTv14 is applied
 38     if test_dst('Pacific/Fiji', 2009, 11, 30, 10, 0, 0) = 'Timestamp is *in* DST' then
 39       dbms_output.put_line('V13 tzdata2009s (or later) Time Zone Update is applied');
 40     else
 41       dbms_output.put_line('V13 tzdata2009s (or later) Time Zone Update is not applied');
 42     end if;
 43     if test_dst('Pacific/Fiji', 2010, 11, 16, 10, 0, 0) = 'Timestamp is *in* DST' then
 44       dbms_output.put_line('V14 tzdata2010i (or later) Time Zone Update is applied');
 45     else
 46       dbms_output.put_line('V14 tzdata2010i (or later) Time Zone Update is not applied');
 47     end if;
 48    if test_dst('Asia/Hong_Kong', 1977, 07, 01, 10, 0, 0) = 'Timestamp is *in* DST' then
 49       dbms_output.put_line('V15 tzdata2010o (or later) Time Zone Update is not applied');
 50     else
 51       dbms_output.put_line('V15 tzdata2010o (or later) Time Zone Update is applied');
 52     end if;
 53    if test_dst('Europe/Istanbul', 2011, 03, 27, 10, 0, 0) = 'Timestamp is *in* DST' then
 54       dbms_output.put_line('V16 tzdata2011g (or later) Time Zone Update is not applied');
 55     else
 56       dbms_output.put_line('V16 tzdata2011g (or later) Time Zone Update is applied');
 57     end if;
 58    if test_dst('Europe/Moscow', 2012, 06, 20, 10, 0, 0) = 'Timestamp is *in* DST' then
 59       dbms_output.put_line('V17 tzdata2011i (or later) Time Zone Update is not applied');
 60     else
     dbms_output.put_line('V17 tzdata2011i (or later) Time Zone Update is applied');
 61   62     end if;
 63    if test_dst('Europe/Minsk', 2012, 06, 20, 10, 0, 0) = 'Timestamp is *in* DST' then
 64       dbms_output.put_line('V18 tzdata2012c (or later) Time Zone Update is not applied');
 65     else
 66       dbms_output.put_line('V18 tzdata2012c (or later) Time Zone Update is applied');
 67     end if;
 68     dbms_output.put_line('The TEST_DST function can be used to test your ''own'' time zones');
 69  end;

 70  /
V3  (or later) Time Zone Update is applied
V4  (or later) Time Zone Update is applied
V6  tzdata2007f (or later) Time Zone Update is applied
V7  tzdata2007k (or later) Time Zone Update is applied
V9  tzdata2008f (or later) Time Zone Update is applied
V10 tzdata2008i (or later) Time Zone Update is applied
V11 tzdata2009g (or later) Time Zone Update is applied
V13 tzdata2009s (or later) Time Zone Update is applied
V14 tzdata2010i (or later) Time Zone Update is applied
V15 tzdata2010o (or later) Time Zone Update is applied
V16 tzdata2011g (or later) Time Zone Update is applied
V17 tzdata2011i (or later) Time Zone Update is not applied
V18 tzdata2012c (or later) Time Zone Update is not applied
The TEST_DST function can be used to test your 'own' time zones

PL/SQL procedure successfully completed.

SQL> DROP function get_dst_offset;
Function dropped.

SQL> DROP function test_dst;

Function dropped.

SQL> DROP java source "OffsetFromStandard";

Java dropped.

SQL> select comp_name, version, status from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
VERSION                        STATUS
------------------------------ -----------
OWB
11.2.0.3.0                     VALID

Oracle Application Express
3.2.1.00.12                    VALID

Oracle Enterprise Manager
11.2.0.3.0                     VALID


COMP_NAME
--------------------------------------------------------------------------------
VERSION                        STATUS
------------------------------ -----------
OLAP Catalog
11.2.0.3.0                     VALID

Spatial
11.2.0.3.0                     VALID

Oracle Multimedia
11.2.0.3.0                     VALID


COMP_NAME
--------------------------------------------------------------------------------
VERSION                        STATUS
------------------------------ -----------
Oracle XML Database
11.2.0.3.0                     VALID

Oracle Text
11.2.0.3.0                     VALID

Oracle Expression Filter
11.2.0.3.0                     VALID


COMP_NAME
--------------------------------------------------------------------------------
VERSION                        STATUS
------------------------------ -----------
Oracle Rules Manager
11.2.0.3.0                     VALID

Oracle Workspace Manager
11.2.0.3.0                     VALID

Oracle Database Catalog Views
11.2.0.3.0                     VALID


COMP_NAME
--------------------------------------------------------------------------------
VERSION                        STATUS
------------------------------ -----------
Oracle Database Packages and Types
11.2.0.3.0                     VALID

JServer JAVA Virtual Machine
11.2.0.3.0                     VALID

Oracle XDK
11.2.0.3.0                     VALID


COMP_NAME
--------------------------------------------------------------------------------
VERSION                        STATUS
------------------------------ -----------
Oracle Database Java Packages
11.2.0.3.0                     VALID

OLAP Analytic Workspace
11.2.0.3.0                     VALID

Oracle OLAP API
11.2.0.3.0                     VALID


18 rows selected.

SQL> select owner, status, count(*) from all_objects where object_type like '%JAVA%' group by owner, status;

OWNER                          STATUS    COUNT(*)
------------------------------ ------- ----------
EXFSYS                         VALID           48
ORDSYS                         VALID         1948
MDSYS                          VALID          538
SYS                            VALID        21885

SQL> select role from dba_roles where role like '%JAVA%';
ROLE
------------------------------
JAVA_DEPLOY
JAVAUSERPRIV
JAVAIDPRIV
JAVASYSPRIV
JAVADEBUGPRIV
JAVA_ADMIN

6 rows selected.

SQL> select currently_used, name from  dba_feature_usage_statistics where name like '%Java%';

CURRE NAME
----- ----------------------------------------------------------------
FALSE Oracle Java Virtual Machine (user)
TRUE  Oracle Java Virtual Machine (system)

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options


$unzip p15897884_112030_Generic.zip

$cd 15897884

$/u01/app/oradb/product/11.2.0.3/dbhome_1/OPatch/opatch apply

$sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 22 10:32:06 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 4.0899E+10 bytes
Fixed Size                  2168160 bytes
Variable Size            4294970016 bytes
Database Buffers         3.6507E+10 bytes
Redo Buffers               95125504 bytes
Database mounted.
Database opened.
SQL> @?/javavm/admin/fixTZa.sql

Session altered.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


Java created.

No errors.

Java altered.

No errors.

Package created.

No errors.

Package body created.

No errors.

PL/SQL procedure successfully completed.


Call completed.

Testing various timezone DST attributes
FAILED for America/Creston 1325401200000 -25200000 0
FAILED for America/Resolute 1325397600000 -21600000 0
FAILED for America/Resolute 1331452799999 -21600000 0
FAILED for America/Resolute 1331452800000 -21600000 3600000
FAILED for America/Resolute 1352012399999 -21600000 3600000
FAILED for America/Resolute 1352012400000 -21600000 0
FAILED for America/Resolute 1362902399999 -21600000 0
FAILED for America/Resolute 1362902400000 -21600000 3600000
FAILED for America/Resolute 1383461999999 -21600000 3600000
FAILED for America/Resolute 1383462000000 -21600000 0
FAILED for America/Resolute 1394351999999 -21600000 0
FAILED for America/Resolute 1394352000000 -21600000 3600000
FAILED for America/Resolute 1414911599999 -21600000 3600000
FAILED for America/Resolute 1414911600000 -21600000 0
FAILED for America/Resolute 1425801599999 -21600000 0
FAILED for America/Resolute 1425801600000 -21600000 3600000
FAILED for America/Resolute 1446361199999 -21600000 3600000
FAILED for America/Resolute 1446361200000 -21600000 0
FAILED for America/Resolute 1457855999999 -21600000 0
FAILED for America/Resolute 1457856000000 -21600000 3600000
FAILED for America/Resolute 1478415599999 -21600000 3600000
FAILED for America/Resolute 1478415600000 -21600000 0
FAILED for Chile/EasterIsland 1335668399999 -21600000 3600000
FAILED for Chile/EasterIsland 1346558400000 -21600000 3600000
FAILED for Pacific/Easter 1335668399999 -21600000 3600000
FAILED for Pacific/Easter 1346558400000 -21600000 3600000
FAILED for America/Havana 1333256399999 -18000000 0
FAILED for America/Havana 1352005199999 -18000000 3600000
FAILED for America/Havana 1383454799999 -18000000 3600000
FAILED for America/Havana 1414904399999 -18000000 3600000
FAILED for America/Havana 1446353999999 -18000000 3600000
FAILED for America/Havana 1478408399999 -18000000 3600000
FAILED for America/Port-au-Prince 1331449200000 -18000000 3600000
FAILED for America/Port-au-Prince 1352008799999 -18000000 3600000
FAILED for Cuba 1333256399999 -18000000 0
FAILED for Cuba 1352005199999 -18000000 3600000
FAILED for Cuba 1383454799999 -18000000 3600000
FAILED for Cuba 1414904399999 -18000000 3600000
FAILED for Cuba 1446353999999 -18000000 3600000
FAILED for Cuba 1478408399999 -18000000 3600000
FAILED for America/Goose_Bay 1331445599999 -14400000 0
FAILED for America/Goose_Bay 1352005199999 -14400000 3600000
FAILED for America/Goose_Bay 1362895199999 -14400000 0
FAILED for America/Goose_Bay 1383454799999 -14400000 3600000
FAILED for America/Goose_Bay 1394344799999 -14400000 0
FAILED for America/Goose_Bay 1414904399999 -14400000 3600000
FAILED for America/Goose_Bay 1425794399999 -14400000 0
FAILED for America/Goose_Bay 1446353999999 -14400000 3600000
FAILED for America/Goose_Bay 1457848799999 -14400000 0
FAILED for America/Goose_Bay 1478408399999 -14400000 3600000
FAILED for America/Kralendijk 1325390400000 -14400000 0
FAILED for America/Lower_Princes 1325390400000 -14400000 0
FAILED for America/Santiago 1335668399999 -14400000 3600000
FAILED for America/Santiago 1346558400000 -14400000 3600000
FAILED for Antarctica/Palmer 1335668399999 -14400000 3600000
FAILED for Antarctica/Palmer 1346558400000 -14400000 3600000
FAILED for Chile/Continental 1335668399999 -14400000 3600000
FAILED for Chile/Continental 1346558400000 -14400000 3600000
FAILED for America/St_Johns 1331443799999 -12600000 0
FAILED for America/St_Johns 1352003399999 -12600000 3600000
FAILED for America/St_Johns 1362893399999 -12600000 0
FAILED for America/St_Johns 1383452999999 -12600000 3600000
FAILED for America/St_Johns 1394342999999 -12600000 0
FAILED for America/St_Johns 1414902599999 -12600000 3600000
FAILED for America/St_Johns 1425792599999 -12600000 0
FAILED for America/St_Johns 1446352199999 -12600000 3600000
FAILED for America/St_Johns 1457846999999 -12600000 0
FAILED for America/St_Johns 1478406599999 -12600000 3600000
FAILED for CNT 1331443799999 -12600000 0
FAILED for CNT 1352003399999 -12600000 3600000
FAILED for CNT 1362893399999 -12600000 0
FAILED for CNT 1383452999999 -12600000 3600000
FAILED for CNT 1394342999999 -12600000 0
FAILED for CNT 1414902599999 -12600000 3600000
FAILED for CNT 1425792599999 -12600000 0
FAILED for CNT 1446352199999 -12600000 3600000
FAILED for CNT 1457846999999 -12600000 0
FAILED for CNT 1478406599999 -12600000 3600000
FAILED for Canada/Newfoundland 1331443799999 -12600000 0
FAILED for Canada/Newfoundland 1352003399999 -12600000 3600000
FAILED for Canada/Newfoundland 1362893399999 -12600000 0
FAILED for Canada/Newfoundland 1383452999999 -12600000 3600000
FAILED for Canada/Newfoundland 1394342999999 -12600000 0
FAILED for Canada/Newfoundland 1414902599999 -12600000 3600000
FAILED for Canada/Newfoundland 1425792599999 -12600000 0
FAILED for Canada/Newfoundland 1446352199999 -12600000 3600000
FAILED for Canada/Newfoundland 1457846999999 -12600000 0
FAILED for Canada/Newfoundland 1478406599999 -12600000 3600000
FAILED for America/Araguaina 1350788400000 -10800000 3600000
FAILED for America/Araguaina 1361066399999 -10800000 3600000
FAILED for America/Araguaina 1382238000000 -10800000 3600000
FAILED for America/Araguaina 1392515999999 -10800000 3600000
FAILED for America/Araguaina 1413687600000 -10800000 3600000
FAILED for America/Araguaina 1424570399999 -10800000 3600000
FAILED for America/Araguaina 1445137200000 -10800000 3600000
FAILED for America/Araguaina 1456019999999 -10800000 3600000
FAILED for America/Araguaina 1476586800000 -10800000 3600000
FAILED for America/Bahia 1325383200000 -10800000 3600000
FAILED for America/Bahia 1330221599999 -10800000 3600000
FAILED for Atlantic/Stanley 1325386800000 -10800000 0
FAILED for Africa/Casablanca 1335664800000 0 3600000
FAILED for Africa/Casablanca 1342749599999 0 3600000
FAILED for Africa/Casablanca 1345428000000 0 3600000
FAILED for Africa/Casablanca 1348970399999 0 3600000
FAILED for Africa/Casablanca 1367114400000 0 3600000
FAILED for Africa/Casablanca 1380419999999 0 3600000
FAILED for Africa/Casablanca 1398564000000 0 3600000
FAILED for Africa/Casablanca 1411869599999 0 3600000
FAILED for Africa/Casablanca 1430013600000 0 3600000
FAILED for Africa/Casablanca 1443319199999 0 3600000
FAILED for Africa/Casablanca 1461463200000 0 3600000
FAILED for Africa/Casablanca 1474768799999 0 3600000
FAILED for Africa/Tripoli 1352505600000 3600000 0
FAILED for Africa/Tripoli 1364515199999 3600000 0
FAILED for Africa/Tripoli 1364515200000 3600000 3600000
FAILED for Africa/Tripoli 1382659199999 3600000 3600000
FAILED for Africa/Tripoli 1382659200000 3600000 0
FAILED for Africa/Tripoli 1395964799999 3600000 0
FAILED for Africa/Tripoli 1395964800000 3600000 3600000
FAILED for Africa/Tripoli 1414713599999 3600000 3600000
FAILED for Africa/Tripoli 1414713600000 3600000 0
FAILED for Africa/Tripoli 1427414399999 3600000 0
FAILED for Africa/Tripoli 1427414400000 3600000 3600000
FAILED for Africa/Tripoli 1446163199999 3600000 3600000
FAILED for Africa/Tripoli 1446163200000 3600000 0
FAILED for Africa/Tripoli 1458863999999 3600000 0
FAILED for Africa/Tripoli 1458864000000 3600000 3600000
FAILED for Africa/Tripoli 1477612799999 3600000 3600000
FAILED for Africa/Tripoli 1477612800000 3600000 0
FAILED for Libya 1352505600000 3600000 0
FAILED for Libya 1364515199999 3600000 0
FAILED for Libya 1364515200000 3600000 3600000
FAILED for Libya 1382659199999 3600000 3600000
FAILED for Libya 1382659200000 3600000 0
FAILED for Libya 1395964799999 3600000 0
FAILED for Libya 1395964800000 3600000 3600000
FAILED for Libya 1414713599999 3600000 3600000
FAILED for Libya 1414713600000 3600000 0
FAILED for Libya 1427414399999 3600000 0
FAILED for Libya 1427414400000 3600000 3600000
FAILED for Libya 1446163199999 3600000 3600000
FAILED for Libya 1446163200000 3600000 0
FAILED for Libya 1458863999999 3600000 0
FAILED for Libya 1458864000000 3600000 3600000
FAILED for Libya 1477612799999 3600000 3600000
FAILED for Libya 1477612800000 3600000 0
FAILED for Asia/Damascus 1333058400000 7200000 3600000
FAILED for Asia/Damascus 1364508000000 7200000 3600000
FAILED for Asia/Damascus 1395957600000 7200000 3600000
FAILED for Asia/Damascus 1427407200000 7200000 3600000
FAILED for Asia/Damascus 1458856800000 7200000 3600000
FAILED for Asia/Gaza 1333058400000 7200000 3600000
FAILED for Asia/Gaza 1348178399999 7200000 3600000
FAILED for Asia/Hebron 1325368800000 7200000 0
FAILED for Asia/Hebron 1333058399999 7200000 0
FAILED for Asia/Hebron 1333058400000 7200000 3600000
FAILED for Asia/Hebron 1348178399999 7200000 3600000
FAILED for Asia/Hebron 1348178400000 7200000 0
FAILED for Asia/Jerusalem 1381013999999 7200000 3600000
FAILED for Asia/Jerusalem 1412463599999 7200000 3600000
FAILED for Asia/Jerusalem 1443913199999 7200000 3600000
FAILED for Asia/Jerusalem 1458864000000 7200000 3600000
FAILED for Asia/Jerusalem 1475362800000 7200000 0
FAILED for Asia/Tel_Aviv 1381013999999 7200000 3600000
FAILED for Asia/Tel_Aviv 1412463599999 7200000 3600000
FAILED for Asia/Tel_Aviv 1443913199999 7200000 3600000
FAILED for Asia/Tel_Aviv 1458864000000 7200000 3600000
FAILED for Asia/Tel_Aviv 1475362800000 7200000 0
FAILED for Israel 1381013999999 7200000 3600000
FAILED for Israel 1412463599999 7200000 3600000
FAILED for Israel 1443913199999 7200000 3600000
FAILED for Israel 1458864000000 7200000 3600000
FAILED for Israel 1475362800000 7200000 0
FAILED for Africa/Juba 1325365200000 10800000 0
FAILED for Europe/Kaliningrad 1325365200000 10800000 0
FAILED for Europe/Minsk 1325365200000 10800000 0
FAILED for Europe/Moscow 1325361600000 14400000 0
FAILED for Europe/Samara 1325361600000 14400000 0
FAILED for Europe/Volgograd 1325361600000 14400000 0
FAILED for W-SU 1325361600000 14400000 0
FAILED for Asia/Yekaterinburg 1325354400000 21600000 0
FAILED for Antarctica/Davis 1325358000000 18000000 0
FAILED for Antarctica/Davis 1329854399999 18000000 0
FAILED for Asia/Novokuznetsk 1325350800000 25200000 0
FAILED for Asia/Novosibirsk 1325350800000 25200000 0
FAILED for Asia/Omsk 1325350800000 25200000 0
FAILED for Antarctica/Casey 1325336400000 39600000 0
FAILED for Antarctica/Casey 1329843599999 39600000 0
FAILED for Asia/Krasnoyarsk 1325347200000 28800000 0
FAILED for Asia/Irkutsk 1325343600000 32400000 0
FAILED for Asia/Yakutsk 1325340000000 36000000 0
FAILED for Asia/Sakhalin 1325336400000 39600000 0
FAILED for Asia/Vladivostok 1325336400000 39600000 0
FAILED for Asia/Anadyr 1325332800000 43200000 0
FAILED for Asia/Kamchatka 1325332800000 43200000 0
FAILED for Asia/Magadan 1325332800000 43200000 0
FAILED for Pacific/Fiji 1325329200000 43200000 3600000
FAILED for Pacific/Fiji 1327154399999 43200000 3600000
FAILED for Pacific/Fiji 1350741600000 43200000 3600000
FAILED for Pacific/Fiji 1358603999999 43200000 3600000
FAILED for Pacific/Fiji 1382191200000 43200000 3600000
FAILED for Pacific/Fiji 1390053599999 43200000 3600000
FAILED for Pacific/Fiji 1413640800000 43200000 3600000
FAILED for Pacific/Fiji 1421503199999 43200000 3600000
FAILED for Pacific/Fiji 1445090400000 43200000 3600000
FAILED for Pacific/Fiji 1453557599999 43200000 3600000
FAILED for Pacific/Fiji 1477144800000 43200000 3600000
FAILED for MIT 1325325600000 46800000 3600000
FAILED for MIT 1333202399999 46800000 3600000
FAILED for MIT 1333202400000 46800000 0
FAILED for MIT 1348927199999 46800000 0
FAILED for MIT 1348927200000 46800000 3600000
FAILED for MIT 1365256799999 46800000 3600000
FAILED for MIT 1365256800000 46800000 0
FAILED for MIT 1380376799999 46800000 0
FAILED for MIT 1380376800000 46800000 3600000
FAILED for MIT 1396706399999 46800000 3600000
FAILED for MIT 1396706400000 46800000 0
FAILED for MIT 1411826399999 46800000 0
FAILED for MIT 1411826400000 46800000 3600000
FAILED for MIT 1428155999999 46800000 3600000
FAILED for MIT 1428156000000 46800000 0
FAILED for MIT 1443275999999 46800000 0
FAILED for MIT 1443276000000 46800000 3600000
FAILED for MIT 1459605599999 46800000 3600000
FAILED for MIT 1459605600000 46800000 0
FAILED for MIT 1474725599999 46800000 0
FAILED for MIT 1474725600000 46800000 3600000
FAILED for Pacific/Apia 1325325600000 46800000 3600000
FAILED for Pacific/Apia 1333202399999 46800000 3600000
FAILED for Pacific/Apia 1333202400000 46800000 0
FAILED for Pacific/Apia 1348927199999 46800000 0
FAILED for Pacific/Apia 1348927200000 46800000 3600000
FAILED for Pacific/Apia 1365256799999 46800000 3600000
FAILED for Pacific/Apia 1365256800000 46800000 0
FAILED for Pacific/Apia 1380376799999 46800000 0
FAILED for Pacific/Apia 1380376800000 46800000 3600000
FAILED for Pacific/Apia 1396706399999 46800000 3600000
FAILED for Pacific/Apia 1396706400000 46800000 0
FAILED for Pacific/Apia 1411826399999 46800000 0
FAILED for Pacific/Apia 1411826400000 46800000 3600000
FAILED for Pacific/Apia 1428155999999 46800000 3600000
FAILED for Pacific/Apia 1428156000000 46800000 0
FAILED for Pacific/Apia 1443275999999 46800000 0
FAILED for Pacific/Apia 1443276000000 46800000 3600000
FAILED for Pacific/Apia 1459605599999 46800000 3600000
FAILED for Pacific/Apia 1459605600000 46800000 0
FAILED for Pacific/Apia 1474725599999 46800000 0
FAILED for Pacific/Apia 1474725600000 46800000 3600000
FAILED for Pacific/Fakaofo 1325329200000 46800000 0
##
Bug is in fact present, so this patch is needed
##
(Perhaps) modifying ild_ub1$ for rehotloading of sun/util/calendar/ZoneInfoFile
obj# = 45849
nbytes %d = 64512, 1st read = 64512, 2nd read = -1
96 397776 385632 12144 joxbtflag>>8 = 3
===

PL/SQL procedure successfully completed.

########################################################
Bug is in fact present, so this patch is needed
Proceed by restarting the database and running script
fixTZb
########################################################

PL/SQL procedure successfully completed.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup migrate
ORACLE instance started.

Total System Global Area 4.0899E+10 bytes
Fixed Size                  2168160 bytes
Variable Size            4294970016 bytes
Database Buffers         3.6507E+10 bytes
Redo Buffers               95125504 bytes
Database mounted.
Database opened.
SQL> @?/javavm/admin/fixTZb.sql

Session altered.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


Call completed.

Testing various timezone DST attributes
########################################################
Bug is no longer present.  Patch succeeded.
########################################################

PL/SQL procedure successfully completed.

drop java source fixTZ
drop package fixTZ

PL/SQL procedure successfully completed.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 4.0899E+10 bytes
Fixed Size                  2168160 bytes
Variable Size            4294970016 bytes
Database Buffers         3.6507E+10 bytes
Redo Buffers               95125504 bytes
Database mounted.
Database opened.
SQL>


Всё, DST установлен.


Более коротко делаем так:

Проверить Timezone Version в БД:

SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
     FROM DATABASE_PROPERTIES
     WHERE PROPERTY_NAME LIKE 'DST_%'
     ORDER BY PROPERTY_NAME;

SQL> SELECT version FROM v$timezone_file; VERSION ---------- 19

Для установки DST обновления Oracle JVM (Patch 15897884) необходимо:
1) Выполнить скрипт:
SQL> @?/javavm/admin/fixTZa.sql

2) Выполнить:
SQL> shutdown immediate
SQL> startup migrate

3) Выполнить скрипт:
SQL> @?/javavm/admin/fixTZb.sql

4) Выполнить:
SQL> shutdown immediate
SQL> startup