Operating System - HP-UX
1752808 Members
5952 Online
108789 Solutions
New Discussion юеВ

Re: Oracle Database time differ than HP-UX OS

 
Jeeshan
Honored Contributor

Re: Oracle Database time differ than HP-UX OS

You have to set the SETENV TZ=WAT-3 using srvctl command.


But before doing this, you must have to shutdown your CRS cluster, Listener and all oracle related services.

I have faced the same problem and resolved like the above way.
a warrior never quits
Akif_1
Super Advisor

Re: Oracle Database time differ than HP-UX OS

Hi UNIX,

After updating listener need to SETENV on database of listener confirm this.

Listerner info:
===============
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)
(ENVS='TZ=WAT-3')
(SID_NAME = mydbname)
)
)

For RAC, you may also need to do the following:
====================================
srvctl setenv database -d mydbname -t TZ=WAT-3
srvctl stop database -d mydbname
srvctl start database -d mydbname

Kindly confirm command srvctl setenv database or srvctl setenv listener to solve this problem.....

Thanks ,

Have a wonderful day!
T(ogether) E(very one) A(chive) M(ore)
Akif_1
Super Advisor

Re: Oracle Database time differ than HP-UX OS

Hello UNIX,

Any update on this issue.


Rgd's
T(ogether) E(very one) A(chive) M(ore)
Horia Chirculescu
Honored Contributor

Re: Oracle Database time differ than HP-UX OS

Hello, Akif.

When you do: login sqlplus@system@NPRD1 (time not-OK), you use tnsnames.ora.

When you are logged in as the user that actually starts the database (not root!, check $) do

set

and check for TNS_ADMIN variable. Also it is time to, double-check TZ variable.

(or

set |grep TZ
set |grep TNS
)

"
If TWO_TASK isn't set, Oracle uses the TZ variable from the local environment.

If TWO_TASK IS set, Oracle uses the TZ variable of the listener process
running on the server.

You could have multiple listeners, each with their own TZ, and assign users to the appropriate listener by setting TNS_ADMIN to a directory that contains a tnsnames.ora file that points to the port that their listener is on."

From AskTom:

"
If you are in a Unix environment, you can normally set 2 environment variables:

ORACLE_HOME
ORACLE_SID

that will connect you to a local database identified by that home and sid. If you wanted
to be able to connect to a remote database or a database on that machine via SQLNet, you
can also set:

TWO_TASK =


The setting of TWO_TASK overrides the ORACLE_SID when set. You will not connecting to a
local database with two_task but rather using sqlnet to connect to a remote database.

So, instead of:

$ sqlplus scott/tiger@some_db

I can:

$ setenv TWO_TASK some_db
$ sqlplus scott/tiger

and the @some_db is implied.
"


You should check for multiple declarations of TZ variable. Check the UNIX environment and the listeners.

Horia.
Best regards from Romania,
Horia.
Akif_1
Super Advisor

Re: Oracle Database time differ than HP-UX OS

Hi Horia,

I appreciate your response, But iam not trying to connect reomote DB as Mr.TOM info.

Check below my set environment variables info.

$. ./.oraenv.db
$ set |grep TNS
TNS_ADMIN=/u01/app/oracle/oracle/product/10.2.0/db_1/network/admin
$ set |grep TZ
ORA_TZFILE=/u01/app/oracle/oracle/product/10.2.0/db_1/oracore/zoneinfo/timezlrg.dat
TZ=WAT-3
$ sqlplus system@DB2

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Feb 1 11:28:54 2010

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

Enter password:

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> select to_char(sysdate, 'HH:MI:SS') from dual;

TO_CHAR(
--------
03:29:28

$ date
Mon Feb 1 11:30:05 WAT 2010

$ date -u
Mon Feb 1 08:30:11 UTC 2010

Rgd's
T(ogether) E(very one) A(chive) M(ore)
Horia Chirculescu
Honored Contributor

Re: Oracle Database time differ than HP-UX OS

>. ./.oraenv.db
>$ set |grep TNS
TNS_ADMIN=/u01/app/oracle/oracle/product/10.2.0/db_1/network/admin
>$ set |grep TZ
>ORA_TZFILE=/u01/app/oracle/oracle/product/10.2.0/db_1/oracore/zoneinfo/timezlrg.dat
>TZ=WAT-3
>$ sqlplus system@DB2

Try this:

shutdown the app/database

unset ORA_TZFILE

Comment the line that is setting the variable ORA_TZFILE from ./.oraenv.db (I belive this would be the place for it or else check the user's profile for setting up this variable.)

re-start the app/database

Horia.
Best regards from Romania,
Horia.