不要再用varchar2存储date/timestamp了!!!

新年来临之际,血的教训让大家都知道了新年来临之前要去检查分区表的新年分区是否创建的问题。本篇文章再介绍一个新年容易出现的性能问题。

继续阅读

发表在 Oracle, Oralce performance | 标签为 , , | 留下评论

oracle scalar subquery caching

这是oracle特有的特性,当对于子查询未展开(包括标量子查询)时,oracle会维护一个hash table的内存区域缓存,对于重复的关联列,并不需要重复的执行子查询。该特性在Cost Based Oracle Fundamental书中有介绍。

继续阅读

发表在 Oracle, Oralce performance | 标签为 | 留下评论

oracle优化器缺陷(二)

今天看了一下好友anbob的文章,主要内容涉及CBO的一些查询转换,主题是在开发场景中如查询分页计算多少页或统计查询,有些开发是习惯基于明细的查询SQL,而外层直接加1层汇聚查询,如select count(*) from (select ….), 但子查询中可能有一些函数或主查询根本不需要的列, 在oracle中的查询转换中如select-project-join或select list pruning, 或VIEW merge SPJ,CVM 都是为了不影响SQL结果一致性,而优化低效的SQL。 继续阅读

发表在 Oracle, Oralce performance | 标签为 , , | 留下评论

oracle优化器缺陷(一)

ORACLE的优化器,在众多dba眼中都是世界上最好的优化器,一直是其他数据库,包括国产数据库追赶的目标,特别是在查询转换上,oracle确实所向无敌。但是本文要介绍的一个小案例对于oracle来说应该算是一个美中不足的地方。 继续阅读

发表在 Oracle, Oralce performance | 标签为 | 留下评论

如何诊断oracle listener

oracle listener也是oracle中非常重要的进程,其作用就不阐述了,当listener进程异常时,应用连接oracle数据库将受到非常大的影响。 继续阅读

发表在 Oracle, Oracle troubleshooting | 标签为 | 留下评论

深入解析DBWR

dbwr进程,Database Writer Process ,理论上最大支持20个dbwr进程,默认是 1/8 cpu_count的设置。dbwr进程的作用的将buffer cache的脏块写出到disk上。 继续阅读

发表在 Oracle | 标签为 | 留下评论

深入解析ckpt

ckpt是checkpoint Process的简称,即检查点进程。 继续阅读

发表在 Oracle | 标签为 | 留下评论

深入解析LGWR

lgwr 为Log writer的简称,oracle核心进程之一的lgwr进程也是极为重要的一个进程,我们通常所接触的log file sync,log file parallel write都跟该进程有做紧密联系。

继续阅读

发表在 Oracle | 标签为 | 留下评论

深入解析smon

SMON是System Monitor Process的简称,是oracle非常核心的进程。
Smon 进程有哪些作用:

  • temporary space reclamation:Creates and manages the temporary tablespace metadata
  • data dictionary cleanup:Cleans up the data dictionary when it is in a transient and inconsistent state(obj$,ind$…)
  • undo tablespace management:Maintains the undo tablespace by onlining, offlining, and shrinking the undo segments based on undo space usage statistics
  • Recover Dead transaction
  • Instance Recovery,In an Oracle RAC database, the SMON process of one instance can perform instance recovery for other instances that have failed
  • Free Space COALESCE
  • Maintains the SCN to time mapping table used to support Oracle Flashback

继续阅读

发表在 Oracle | 标签为 | 留下评论

深入解析pmon

我们在平时处理故障时甚至进行优化时,必须了解一些进程的原理,否则很难定位到根本的原因。在Oracle实例的核心进程中,Pmon进程也是一个极为关键的进程之一,这里我们将逐步揭开pmon进程的神秘面纱!
Pmon是Process Monitor process的简称。 继续阅读

发表在 Oracle | 标签为 | 留下评论