The commands described below are used to query the current time in oracle and view and modify the system time in the operating system. If you are interested in oracle query time, take a look.
View and modify the system time in Linux
[Root @ as4forora ~] # Date-s 07/01/2008
July 22, July 1 00:00:00 CST 2008
[Root @ as4forora ~] # Date-s 20:06:00
July 22, July 1 20:06:00 CST 2008
[Root @ as4forora ~] # Clock-w
[Root @ as4forora ~] # Date
July 22, July 1 20:06:18 CST 2008
[Quote]
We generally use the "date-s" command to modify the system time. For example, the command to set the system time to June 10, 1996 is as follows.
# Data-s 06/10/96
The command to set the system time to 01:12:00 P.M. is as follows.
# Date-s 13:12:00
Note that the system time is maintained by the operating system in linux.
When the system is started, the Linux operating system reads the time from CMOS to the system time variable. Later, the modification time is implemented by modifying the system time. To maintain the consistency between the system time and the CMOS time, Linux writes the system time to the CMOS at intervals. Since the synchronization is performed every 11 minutes, after we execute date-s, if the machine is restarted immediately, the modification time may not be written into CMOS, this is the cause of the problem. To make sure the modification takes effect, run the following command.
# Clock-w
This command forces the system time to be written to CMOS
How to obtain the current time of the oracle system? How to obtain the current time of the oracle system?
SQL> select to_char (sysdate, 'Mm-DD-YYYY HH24: MI: ss') "now" from dual;
Now
-------------------
07-01-2008 20:23:06
Learn more about Oracle hierarchical Query
Provides you with an in-depth understanding of Oracle temporary tables
Oracle with statement usage
Implementation of Oracle query of user tablespace
Learn about oracle query statement logs