- 论坛徽章:
- 0
|
时间:2006/12/29
地点:公司内部
事件:查询无数据
背景:根据公司需求,重新做公司的监控系统数据库(放到Linux下)
忙了一个下午了,系统,数据库安装好了,snapshot和procedure都做好了,可是当应用程序放上去的时候能够连接数据库,但是数据没有打出来.奇怪了,是怎么回事呢?之前环境跟现在的完全一样,只是将Oracle从windows放Linux下了.干脆直接查数据库数据:
1.
SQL>select * from full_information where trunc(registertime)=trunc(sysdate);
没有数据
2.
SQL>select * from full_information where trunc(registertime)=to_date ('20061229','yyyymmdd');
有数据啊,,,没道理啊
3.查看Linux时间
[root@localhost ~]# date
六 12月 30 17:12:40 CST 2006
哦,原来系统时间现在已经是第二天了(30号),而今天是29号,,,30号的数据还没有写进来呢,,,OK,是时间错误的原因,改时间:
[root@localhost ~]# date -s 17:30:30
五 12月 30 17:30:30 CST 2031
[root@localhost ~]# date -s 2006/12/30
五 12月 30 00:00:00 CST 2006
[root@localhost ~]# date -s 17:30:30
五 12月 30 17:30:30 CST 2006
[root@localhost ~]# date
五 12月 30 17:30:33 CST 2006
4.再查数据库
SQL>select * from full_infomration where trunc(registertime)=trunc(sysdate);
OK,数据出来了,,,解决!!!
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/26381/showart_223532.html |
|