« How to maintain Oracle10g Recyclebin? | Blog首页 | The Network is The Computer »
Oracle Diagnostics:Why sysdate is fixed?
作者:eygle |【转载时请务必以超链接形式标明文章原始出处和作者信息及本声明】链接:http://www.eygle.com/archives/2005/12/oracle_diagnostics_why_sysdate_fixed.html
今天一个朋友在MSN上问到一个问题:为什么我的SYSDATE不变了?
他查询SYSDATE的值一直停留在2005-03-01 11:41:15。感觉很奇怪。
忍不住指导他研究一下,先是从系统级诊断,发现没有问题。
再从数据库角度来诊断,发现:
select current_date from dual; 的输出是正确的,而
select sysdate from dual; 却是不正确的。
猜测是某个参数导致了系统日期被固化,让他传来alert文件,果然发现了一个此前未注意到的参数: FIXED_DATE,
core_dump_dest = /u01/app/oracle/admin/unicode/cdump |
文档上的解释为:
FIXED_DATE
|
Parameter type |
String |
|
Syntax |
|
|
Default value |
There is no default value. |
|
Parameter class |
Dynamic: |
FIXED_DATE enables you to set a constant date that SYSDATE will always return instead of the current date. This parameter is useful primarily for testing. The value can be in the format shown above or in the default Oracle date format, without a time.
找到了这个参数也就找到了答案!
By eygle on 2005-12-12 23:21 | Comments (2) | Posted to Case | Edit |Pageviews:
留言 (2)
这个比较有趣,也是第一次知道还有这个参数,好玩,哈哈,应该用sql_trace跟踪一下,看看设置参数前后,oracle做了什么。我懒了,eygle来跟踪一下吧。
Posted by: kamus at December 13, 2005 5:58 AM
这个跟踪不到的,是个内部操作!
Posted by: eygle at December 13, 2005 11:57 AM
