Home » RDBMS Server » Server Administration » changing date on oracle db...?
changing date on oracle db...? [message #131624] Mon, 08 August 2005 12:32 Go to next message
balavignesh
Messages: 180
Registered: March 2005
Senior Member
hai,

in our oracle database , we need to change the time which is going 5hrs ahead of the original time.we have to set it to EST.is there any statement to do this ..?

select current_timestamp from dual;

08-AUG-05 05.25.36.610827 PM +00:00

plz help out in this issue...

regards
bala

[Updated on: Mon, 08 August 2005 12:37]

Report message to a moderator

Re: changing date on oracle db...? [message #131627 is a reply to message #131624] Mon, 08 August 2005 12:55 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
change your system date!.

oracle@mutation#sqlplus -s scott/tiger <<EOF
> select to_char(sysdate,'dd-mon-yyyy hh24:mi:ss') from dual;
> exit;
> EOF

TO_CHAR(SYSDATE,'DD-
--------------------
08-aug-2005 13:47:29


oracle@mutation#su -
Password:
Sun Microsystems Inc.   SunOS 5.8       Generic Patch   October 2001
# date 1930.25
Mon Aug  8 19:30:25 EDT 2005
# exit
logout

oracle@mutation#sqlplus -s scott/tiger <<EOF
>  select to_char(sysdate,'dd-mon-yyyy hh24:mi:ss') from dual;
> exit;
> EOF

TO_CHAR(SYSDATE,'DD-
--------------------
08-aug-2005 19:31:19
Re: changing date on oracle db...? [message #131629 is a reply to message #131627] Mon, 08 August 2005 13:06 Go to previous messageGo to next message
balavignesh
Messages: 180
Registered: March 2005
Senior Member
hai mahesh,

still it is giving the same time as before

TO_CHAR(SYSDATE,'DD-
--------------------
08-aug-2005 18:01:53

which is five hrs ahead.how to change it..?

Re: changing date on oracle db...? [message #131631 is a reply to message #131629] Mon, 08 August 2005 13:11 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
You can see, it works for me.
are you in windows? then you have to restart the oracle services.
Re: changing date on oracle db...? [message #131634 is a reply to message #131631] Mon, 08 August 2005 13:20 Go to previous messageGo to next message
balavignesh
Messages: 180
Registered: March 2005
Senior Member
well mahesh,

we are in linux.but how to change the Linux time as oracle gives the same time as from Linux.

thanks in advance
bala
Re: changing date on oracle db...? [message #131637 is a reply to message #131634] Mon, 08 August 2005 13:57 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
#
# still works for me.
# use ``date 08081450'' 
# usage: date tilde tilde monthdayhh24minute singlequote singlequote
#

scott@10g > select to_char(sysdate,'dd-mon-yyyy hh24:mi:ss') from dual;

TO_CHAR(SYSDATE,'DD-
--------------------
08-aug-2005 19:20:55

[oracle@kalyani oracle]$ uname -a
Linux kalyanixxxxx 2.6.5-1.358 #1 Sat May 8 09:04:50 EDT 2004 i686 i686 i386 GNU/Linux

[oracle@kalyani oracle]$ date
Mon Aug  8 19:21:27 EDT 2005

[oracle@kalyani oracle]$ su -
Password:
[root@kalyani root]#  ``date 08081450''
Mon Aug  8 14:50:00 EDT 2005

[root@kalyani root]# su - oracle
Password:

[oracle@kalyani oracle]$ date
Mon Aug  8 14:51:49 EDT 2005

[oracle@kalyani oracle]$ . .profile

[oracle@kalyani oracle]$ sqlplus -s scott/tiger
select to_char(sysdate,'dd-mon-yyyy hh24:mi:ss') from dual;

TO_CHAR(SYSDATE,'DD-
--------------------
08-aug-2005 14:52:46

exit;
Re: changing date on oracle db...? [message #131639 is a reply to message #131637] Mon, 08 August 2005 14:41 Go to previous message
balavignesh
Messages: 180
Registered: March 2005
Senior Member
well mahesh,

we have done it by linking as follows

ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime


and now working fine.

thanks
bala
Previous Topic: multiple databases
Next Topic: check connection
Goto Forum:
  


Current Time: Fri Jan 10 08:54:37 CST 2025