- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- oracle SYSDATE is different from HPUX date
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2003 12:24 PM
тАО05-13-2003 12:24 PM
oracle SYSDATE is different from HPUX date
Got Oracle 8.1.6 on HPUX 11.00 and the time from the Oracle banner is some 15 min off what the HPUX system date says. I am using ntp so I am sync'd to TZ=EST5EDT.
Most everything I see says the TZ variable, but the TZ=EST5EDT.
What gives?
Many thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2003 10:29 PM
тАО05-13-2003 10:29 PM
Re: oracle SYSDATE is different from HPUX date
Seems like a timezone settings problem.
In 8i and before, does not have timezone support.
In 9i there is a datatype "timestamp with timezone". The timestamp can store the date, time (down to 9 decimal places with seconds), and the TIMEZONE. The database "understands" timezones so if you get the difference between 1pm PST and 4pm EST it understands that it is in fact the same time. And so on.
In short, 9i supports and is timezone aware. 8i and before -- not so.
Below a piece of code to determine what Oracle is seeing on the server it is running. Please run it and post your output.
yd@mydb.MU> create or replace and compile java source
2 named "demo"
3 as
4 import java.net.*;
5 import java.io.*;
6 import java.util.*;
7 import java.text.*;
8 public class demo
9 {
10 static public void java_get_timezone( String[] p_timezone )
11 {
12 Date d = new Date();
13 DateFormat df2 = new SimpleDateFormat( "z" );
14 df2.setTimeZone( TimeZone.getDefault() );
15 p_timezone[0] = df2.format(d);
16 }
17* }
18 /
Operation 160 succeeded.
Elapsed: 00:00:14.60
yd@mydb.MU> create or replace package tz
2 as
3 procedure get_timezone( p_timezone out varchar2 )
4 as language java
5 name 'demo.java_get_timezone( java.lang.String[] )';
6 function get_tz return varchar2;
7* end;
Package created.
Elapsed: 00:00:01.61
yd@mydb.MU> create or replace package body tz
2 as
3 g_tz varchar2(25);
4 function get_tz return varchar2
5 as
6 begin
7 if g_tz is null then get_timezone(g_tz); end if;
8 return g_tz;
9 end;
10* end;
Package body created.
Elapsed: 00:00:00.03
yd@mydb.MU> select tz.get_tz from dual;
GET_TZ
_______
GMT
Elapsed: 00:00:02.09
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2003 10:41 PM
тАО05-13-2003 10:41 PM
Re: oracle SYSDATE is different from HPUX date
i know that you all ready check the issue of the timezone but one more thing to check .
check the var TZ of the user oracle .
most of the time the time is sync and dfine in the /etc/TIMEZONE correctry but the var in the .profile of the user oracle is not set rigth .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2003 12:05 PM
тАО05-14-2003 12:05 PM
Re: oracle SYSDATE is different from HPUX date
The TZ variable for the oracle acct correct and from the command line (logged in as oracle) the date will return the proper value.
Going to create a tar for Oracle to explain...
Many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2003 12:25 PM
тАО05-14-2003 12:25 PM
Re: oracle SYSDATE is different from HPUX date
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2003 07:49 PM
тАО05-14-2003 07:49 PM
Re: oracle SYSDATE is different from HPUX date
One of the things that used to get us on timezone was when the listener was started in one TZ and the server was started in another. Connected via the listener or the bequeth connection would cause sysdate to be returned in the appropriate timezone.
Example:
TZ=EST5EDT
dbstart
TZ=GMT
lsnrctl start
sqlplus foo/foome@myserver
select sysdate from dual;
returns GMT time
sqlpus foo/foome
select sysdate from dual;
returns EST5EDT time
The part that throws me is the 15 minute difference. If the difference was an integer number of hours, I'd say timezone.
What timezone is 15 minutes different from another?
Good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2003 10:23 PM
тАО05-14-2003 10:23 PM
Re: oracle SYSDATE is different from HPUX date
Please update once the solution is resolved.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2003 06:41 AM
тАО05-15-2003 06:41 AM
Re: oracle SYSDATE is different from HPUX date
I can see this being a definite solution to the issue if there is a time difference of some multiple of whole hours (1 hrs difference, 2 hrs difference, etc.). This situation has a time difference of 13 min. The OS time presents the correct time. The Oracle banner (and so forth) presents the time 13 min ahead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2003 06:54 AM
тАО05-15-2003 06:54 AM
Re: oracle SYSDATE is different from HPUX date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2003 07:36 AM
тАО05-15-2003 07:36 AM
Re: oracle SYSDATE is different from HPUX date
Is the problem sensitive to the way you connect?
Seems like when I went through the listener, it used the time with respect to the listener's environment. When I used the bequeth connection, it used the server's environment.
I was wondering how you connected to sqlplus. Could it be that say using connection manager or names server or active directory causes you to use a different time source? Say the one on the connection manager's machine?
Just Wondering.