Operating System - HP-UX
1748269 Members
3500 Online
108760 Solutions
New Discussion юеВ

Re: Oracle Database time differ than HP-UX OS

 
Dennis Handly
Acclaimed Contributor

Re: Oracle Database time differ than HP-UX OS

If you are on 11.31 and want it to display GMT+3, you can "quote" the timezone:
$ TZ=WAT-3 date
Wed Jan 27 15:20:33 WAT 2010
$ TZ="-3" date
Wed Jan 27 15:20:38 GMT+3 2010
Horia Chirculescu
Honored Contributor

Re: Oracle Database time differ than HP-UX OS

Hello,

Denis,

>Horia: in /etc/TIMEZONE you should have: TZ=UTC+3
>better: TZ=Asia/Riyadh

"The first is never a good idea and it is 6 hours off. Using GMT-3 gives you the right time but it says you are in GMT, London.
The second will not work, it's the same as GMT0."

GMT-3 does not give the right time for Asia/Riyadh!

Asia/Riyadh is the same as GMT+3.
There is only a split second difference between UTC and GMT, so for most of the situations (like this one) UTC and GMT is the same.

read:

http://en.wikipedia.org/wiki/Coordinated_Universal_Time



>Another observation:
>WAT-3 = GMT+1-3=GMT-2

"No, WAT-3 is WAT-3, 3 hours ahead of UTC/GMT, not 2."

WAT is undefined in /usr/lib/tztab, so Unix would default to GMT. Practically, if Akif would write on /etc/TIMEZONE TZ=WAT-3 as instructed, his system would use GMT-3, which is wrong. Akif should check of course if WAT is defined on tztab on his system.


>read Bill Hassell's posts.

"You need to be careful because Bill has it backwards, GMT3 is in the Atlantic or Brazil. "

You are wrong.
GMT3 means GMT+3; notice the plus "+" sign

From manual pages (man environ):

"If offset is preceded by a -, the time zone is east of the Prime Meridian. A + preceding offset indicates that the time zone is west of the Prime Meridian. The default case is west of the Prime Meridian.
"

"Atlantic or Brasil" is east of the Prime Meridian, not west. This means GMT-3 for this area.

Best regards,
Horia.
Best regards from Romania,
Horia.
Dennis Handly
Acclaimed Contributor

Re: Oracle Database time differ than HP-UX OS

>Horia: GMT-3 does not give the right time for Asia/Riyadh!

That's TZ=GMT-3 and it matches:
http://www.timeanddate.com/worldclock/city.html?n=214

>Asia/Riyadh is the same as GMT+3.

I'm not talking about Windows terms but HP-UX and Posix definition of the TZ variable.

>There is only a split second difference between UTC and GMT,

For HP-UX, they are the same. :-)

>WAT is undefined in /usr/lib/tztab, so Unix would default to GMT.

I assumed you were talking about TZ=WAT-3. And that says to use 3 hours before UTC.

>You are wrong.

I'm not sure why you think so?

>GMT3 means GMT+3; notice the plus "+" sign

Exactly.

>"Atlantic or Brazil" is east of the Prime Meridian, not west. This means GMT-3 for this area.

I'm not sure what world you live on but in my western hemisphere, the Posix standard chauvinistically declared west as positive in TZ and yours negative.

Last time I looked Brazil was west. But there are small parts of the Atlantic that are east, none more than 3 hours.
Akif_1
Super Advisor

Re: Oracle Database time differ than HP-UX OS

Hi,

Thanks for your link info, Problem is same as with Mr.Rogger,

But still unable to solve the issue. other details are:

# date
Sat Jan 30 09:20:35 WAT 2010
# date -u
Sat Jan 30 06:20:37 UTC 2010
# more /etc/default/tz
EST5EDT
#more/etc/TIMEZONE
TZ=WAT-3

The actual time is 09:20AM as of today.

Thanks & Rgd's
T(ogether) E(very one) A(chive) M(ore)
Jupinder Bedi
Respected Contributor

Re: Oracle Database time differ than HP-UX OS

TZ=WAT-3

means In this case 3 hours must be subtracted to get UTC

so it means there is no any problem in your system .

Good Luck

All things excellent are as difficult as they are rare
Jupinder Bedi
Respected Contributor

Re: Oracle Database time differ than HP-UX OS

Here is the output of my server


TZ=CST6CDT
export TZ
# date
Sat Jan 30 00:45:25 CST 2010

# date -u
Sat Jan 30 06:45:30 UTC 2010


so dont be confuse and enjoy.
All things excellent are as difficult as they are rare
Akif_1
Super Advisor

Re: Oracle Database time differ than HP-UX OS

Hi,

If you look my real problem with TIMZONE it is a bit messup.

Kinly follow below repeated details:

#TIME is ok if connect Oracle DB via sqlplus system/manager

#Display incorrect TIME if i connect via sqlplus system@Inst1(Instance).

for indepth info follow below details:

The GMT of Riyadh is GMT+3 , But when i go through in HP-UX with setting parameters for timezone #set_params timezone - > Asia ->Riyadh , UNIX itself assing WAT-3 under /etc/TIMEZONE. It means time zone (WAT-3)is ok.

Now The sysdate is also ok when i connect via sqlplus sys as sysdba , But if i connect via listener_SID or instance ID (i.e sqlplus system@db1, The time is not correct .

Rgd's
T(ogether) E(very one) A(chive) M(ore)
Dennis Handly
Acclaimed Contributor

Re: Oracle Database time differ than HP-UX OS

>Problem is same as with Mr. Roger,

I'm not sure why? He didn't mention Oracle.

>The actual time is 09:20AM as of today.

Your date command says that, so what else do you want?

>UNIX itself using WAT-3 under /etc/TIMEZONE. It means time zone (WAT-3) is ok.

Yes.

>But if I connect via listener_SID or instance ID, The time is not correct.

This most likely means the TZ variable isn't set to WAT-3 for these processes.
Jupinder Bedi
Respected Contributor

Re: Oracle Database time differ than HP-UX OS

I dont know but I believe at the time of oracle installation , you have mentioned different timezone. can you check at the oracle installation logs or any configuration file .
All things excellent are as difficult as they are rare
Akif_1
Super Advisor

Re: Oracle Database time differ than HP-UX OS

Hi Dennis,

Under RAC listener 'ENVS='TZ=WAT-3' parameter set and restarted the listener/DB , But no effect same problem.

Rgd's
T(ogether) E(very one) A(chive) M(ore)