Sun Microsystems, Inc.  Oracle System Handbook - ISO 7.0 May 2018 Internal/Partner Edition
   Home | Current Systems | Former STK Products | EOL Systems | Components | General Info | Search | Feedback

Asset ID: 1-72-1519975.1
Update Date:2018-04-16
Keywords:

Solution Type  Problem Resolution Sure

Solution  1519975.1 :   How to Change the Timezone in Your ODA V1, X3-2, X4-2 X5-2 Using OAKCLI (Oracle Database Appliance)  


Related Items
  • Oracle Database Appliance X4-2
  •  
  • Oracle Database Appliance
  •  
  • Oracle Database Appliance X3-2
  •  
  • Oracle Database Appliance X5-2
  •  
  • Oracle Database Appliance Software
  •  
Related Categories
  • PLA-Support>Eng Systems>Exadata/ODA/SSC>Oracle Database Appliance>DB: ODA_EST
  •  
  • _Old GCS Categories>ST>EM>Managing Oracle Database>DBControl>Timezone and DST
  •  


Timezones are set when you deploy the ODA V1, X3-2, X4-2 and X5-2. To change the Timezone you need to alter the onecommand.params file to your new value. You can then redeploy the Timezone executing step 6 of the GridInst.pl command. This note shows you how.

Applies to:

Oracle Database Appliance Software - Version 2.1.0.1 to 12.1.2.9 [Release 2.1 to 12.1]
Oracle Database Appliance - Version All Versions to All Versions [Release All Releases]
Oracle Database Appliance X3-2 - Version All Versions to All Versions [Release All Releases]
Oracle Database Appliance X4-2 - Version All Versions to All Versions [Release All Releases]
Oracle Database Appliance X5-2 - Version All Versions to All Versions [Release All Releases]
Information in this document applies to any platform.

Symptoms

 You have deployed the Oracle database Appliance ( ODA ) Hardware version V1, X3-2, X4-2 X5-2 and now you want to change the Timezone from the one set during deployment to a new value

- or -

You want to change or switch the Timezone value currently used to a new value.

Changes

Need to change timezone value which is now assessed as incorrect

Cause

 There are several potential reasons to change the Timezone to a new value:

  • Mistaken value during deployment
  • New timezone values or definitions for business reasons
  • Change order to enforce (or disregard) daylight savings values  (DST)
  • New usage of timezone dependent functionality including Grid Control, EM Agent or Dbconsole settings
  • Enforce business rules or auditing based on specific time / timezones
  • Reinstallation

Solution

ODA Timezone

1)  Login to NODE1 (SC0) of ODA   as root / <pwd>

Confirm what the current timezone value is by issuing DATE from the OS command line

[root@oda1] date

Example

[root@odarm1 onecmd]# date
Tue Feb 26 10:44:28 CST 2013                 << CST is for the USA Central Standard Timezone (CST)

 

Comment:
OneCommand should always be issued from the First Node (for Legacy ODA versions X5-2 and lower)

For newer ODA versions including ODA Lite X6-2* and X7-2* please review comments at the bottom of this article

 
2) cd to the /opt/oracle/oak/onecmd directory

[root@oda1] cd /opt/oracle/oak/onecmd

 
3) list the files in the directory

[root@oda1 onecmd] ls

Example

[root@odarm1 onecmd]# ls
Agent_actionScript.pl          network                                    orai18n-utility.jar
asrIlom.pl                     oakdiag                                    parsetime.sh
cleanupDeploy.pl               ohj.jar                                    passwd.jar
dbconsole                      onecommand-default-ocm.rsp                 runodaDg.pl
dtime.sh                       onecommand.jar                             setupdiskCometPlusDisk.pl
GridDefParams.pm               onecommand.params                          share.jar
GridInst.pl                    ...                                        SUN-HW-TRAP-MIB.mib
GridSteps.pm                   onecommand.params-sample                   T4DBTemplate.dbt
help-share.jar                 onecommand.properties                      tmp
jewt4.jar                      oracle_ice.jar                             upgrade_config.params
Linux                          orai18n-mapping.jar

 


4) identify and create a backup of the onecommand.params file*

   [root@oda1 onecmd] cp onecommand.params onecommand.params.old

 

If the onecommand.params  file does not exist:

  • If using the ODA Legacy versions with OAKCLI confirm you are on the correct node -or- confirm you have deployed the ODA.
  • If using the newer ODA Lite series X6-2 S/M/L X7-2 S/M or other newer ODA versions which using GUI / Console installations please skip to the bottom of this note for some OS suggestions.
  • As this note was written specifically for the Legacy V1,X3-2, X4-2 and X5-2 oakcli based versions this note will not provide complete steps for the newer HW versions of the ODA.


5) alter the original onecommand.params file to your new value**

- If you do not know the valid timezone values you can look these up

[root@oda1 onecmd]# date
Tue Feb 26 10:44:28 CST 2013 -- this confirms the current Time and Timezone (e.g. CST)

vi onecommand.params


 ----

# CLUSTERINFO
DBMPREFIX=odarm
DOMAIN=us.oracle.com
CLUSTERNAME=odarm-c
REGION=America
TIMEZONE=America/Chicago
...
...
edit the timezone to the proper value

[root@oda1 onecmd]# vi onecommand.params

 ----

# CLUSTERINFO
DBMPREFIX=odarm
DOMAIN=us.oracle.com
CLUSTERNAME=odarm-c
REGION=America
TIMEZONE=America/Denver              << altered to your preferred timezone e.g. Denver
...
...


6) Save the new onecommand.params file with the new value:


7) From the same directory confirm that there is a GridInst.pl file

see ls command above


8) To determine which step needs to be executed to change ONLY the timezone setting for the two nodes

     Issue ./GridInst.pl -l on Bare metal systems
         or ./GridInst.pl -l -o for Virtualized ODAs

   To confirm what each step is including  SetTimezone  issue ./GridInst.pl -l  

[root@odarm2 onecmd]#  ./GridInst.pl -l

INFO   : Logging all actions in /dev/null and traces in /dev/null
INFO   : Loading configuration file /opt/oracle/oak/onecmd/onecommand.params...

The steps in order are...

Step  0 = ValidateParamFile
Step  1 = SetupNetwork
Step  2 = WriteNodelists
Step  3 = SetupSSHroot
...
Step  6 = SetTimezone           << in this version of the ODA we see that Step #6 is proper for setting the TimeZone
...
..etc.


Review the prompts and say "yes" if you want to continue

./ GridInst.pl -s 6  

  [root@odarm1 onecmd]# ./GridInst.pl -s 6

                        - or for virtualization you will use the -o flag
issued from ODA_BASE


                      ./GridInst.pl -s 6 -o

 Comment:  Make sure that the dom0 and db domain use the same Timezone 

 

Run the step to set the new Timezone value set in the new onecommand.params file which has your expected Timezone value

./GridInst.pl -s 6 

or 

./GridInst.pl -s 6 -o   R

 

Example:

[root@odarm2 onecmd]#  ./GridInst.pl -s 6 -o

INFO   : Logging all actions in /opt/oracle/oak/onecmd/tmp/STEP-6-20130226103534.log and traces in /opt/oracle/oak/onecmd/tmp/STEP-6-20130226103534.trc
INFO   : Loading configuration file /opt/oracle/oak/onecmd/onecommand.params...
INFO   : Creating nodelist files...
==================================================================================
INFO   : 2013-02-26 10:35:34
INFO   : Step 6  SetTimezone
INFO   : Setting up Timezone /opt/oracle/oak/onecmd/tmp/setuptz.sh
...
INFO   : Running as root: /usr/bin/ssh -l root odarm1 /opt/oracle/oak/onecmd/tmp/setuptz.sh
...
INFO   : Running as root: /usr/bin/ssh -l root odarm2 /opt/oracle/oak/onecmd/tmp/setuptz.sh
INFO   : Time spent in step 6 SetTimezone is 5 seconds.
==================================================================================
INFO   : Log file is /opt/oracle/oak/onecmd/tmp/STEP-6-20130226103534.log...

Exiting...

 

Database ENV (OS) timezone

9) As the Oracle user:     

  

    srvctl setenv database -d ORCL -t TZ=America/Denver

 
once completed, enter    date    from the linux command line prompt to confirm the new Timezone value

e.g.

[root@oda1 onecmd] date

[root@odarm1 onecmd]# date
Tue Feb 26 09:46:54 MST 2013

 

The above does the necessary TIMEZONE changes for OS, however, the database or listener will not read these changed values until the binary is restarted 

   "...If TZ is changed after the database is started starts PMON will not pick up the changed value..."

See:  - Note 301420.1  Why does sysdate have the Wrong Time Stamp when Connecting via the Listener

 

Helpful commands 

   srvctl getenv database -d <dbname>

   srvctl setenv database -d <dbname> -t 'TZ=<the TZ you want>'
   srvctl setenv listener -l
<listenername> -t 'TZ=<the TZ you want>'

 

 

GRID TIMEZONE


10) Please ensure the $GI_HOME/crs/install/s_crsconfig_<HOSTNAME>_env.txt has the correct env updated on both nodes

     The change to s_crsconfig_<HOSTNAME>_env.txt is done manually
      -- alter to the proper value, close and save the file
 

  As the grid user:  


 cd /u01/app/11.2.0.3/grid/crs/install/

  vi the view s_crsconfig_<MyODAname>_env.txt

### Do not modify this file except to change NLS_LANG or in this case the TZ, or under the direction of Oracle Support Services

...
TZ=America/Denver

NLS_LANG=AMERICAN_AMERICA.AL32UTF8
TNS_ADMIN=
ORACLE_BASE=

 


A restart of GI is required after the edit of s_crsconfig_env.txt : 
 
See: -- Note 1209444.1 How To Change Timezone for 11gR2 Grid Infrastructure


11) Then for ASM and each DB,you will need to run srvctl setenv asm -t TZ=<new TZ> and for each db.

  e.g..

     srvctl setenv asm -t TZ=America/Denver          << example for Denver

 


 


For ODA LITE it seem to be main issue at OS level, as the note is using "GridInst.pl" what does not exist.

Consider to add steps to change the timezone at OS level

# date (this to check the date now)
# cd /etc
# rm localtime
# ln -s /usr/share/zoneinfo/<yourtimezone> localtime
# date (to check the date after the change)

 

Example:


[root@r001 zoneinfo]# date
lun 19 feb 2018, 23.01.26, HST

[root@r001 zoneinfo]# cd /etc

[root@r001 etc]# rm localtime
rm: remove symbolic link 'localtime'? y

[root@r001 etc]# ln -s /usr/share/zoneinfo/Poland localtime

[root@r001 etc]# date

mar 20 feb 2018, 10.02.14, CET

 

 


 

References

<NOTE:301420.1> - Why does sysdate have the Wrong Time Stamp when Connecting via the Listener
<NOTE:1209444.1> - How To Change Timezone for Grid Infrastructure

Attachments
This solution has no attachment
  Copyright © 2018 Oracle, Inc.  All rights reserved.
 Feedback