Oracle故障处理之错误代码:Warning: VKTM detected a time drift.
问题背景:
客户反馈alert日志中大量告警
告警如下:
Warning: VKTM detected a time drift.Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details.Tue Dec 03 16:21:35 2019Warning: VKTM detected a time drift.Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details.Tue Dec 03 16:38:23 2019Adjusting the default value of parameter parallel_max_serversfrom 640 to 320 due to the value of parameter processes (350)Starting ORACLE instance (normal)Tue Dec 03 21:09:32 2019Warning: VKTM detected a time drift.Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details.Tue Dec 03 22:00:00 2019Setting Resource Manager plan SCHEDULER[0x32DA]:DEFAULT_MAINTENANCE_PLAN via scheduler windowSetting Resource Manager plan DEFAULT_MAINTENANCE_PLAN via parameterTue Dec 03 22:00:00 2019Starting background process VKRMTue Dec 03 22:00:00 2019VKRM started with pid=78, OS id=28922Tue Dec 03 22:00:02 2019Begin automatic SQL Tuning Advisor run for special tuning task "SYS_AUTO_SQL_TUNING_TASK"Tue Dec 03 22:20:55 2019End automatic SQL Tuning Advisor run for special tuning task "SYS_AUTO_SQL_TUNING_TASK"Tue Dec 03 22:46:17 2019Warning: VKTM detected a time drift.Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details.Wed Dec 04 00:00:29 2019Thread 1 advanced to log sequence 5843 (LGWR switch)在Oracle Database 11g中,VKTM是一个新增的后台进程。这个进程的含义是:VKTM (virtual keeper of time) is responsible for providing a wall-clock time (updated every second) andreference-time counter (updated every 20 ms and available only when running at elevated priority).
也就是说,这个进程用于提供一个数据库的时钟,每秒更新;或者作为参考时间计数器,这种方式每20毫秒更新一次,仅在高优先级时可用。
在系统时间出现异常或变化时,VKTM进程还会检测这些变化,提醒用户,尤其是在RAC环境中,时间的偏移和变化极有可能导致系统故障。以下是告警日志中的警告信息:
Warning: VKTM detected a time drift.Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details.
通过VKTM进程,数据库可以降低和操作系统的交互,Kamus的解释是:
在11g之前所有的Oracle数据库后台或者前台进程如果需要获得当前时间信息,就需要调用操作系统的gettimeofday()函数或者说是相类似的函数。
而VKTM进程就是专门用来获得时间信息然后将信息存放在SGA中供其它进程使用,这样其它进程当需要时间信息的时候,只要到SGA的某个内存位置去获得就好,
而不用频繁调用gettimeofday()函数。毫无疑问,这样效率会更高。
在RAC测试中,Oracle 11.1.0.6版本LMSx进程获取时间信息时,可以从VKTM进程中获益大概70%的速度提升,而11.1.0.7将会更高。
同时,因为gettimeofday()函数也引发了很多bug,所以无论是RAC还是NORAC库,都将从VKTM进程中获益。
文章转载自数据与人,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。





