Oracle wait problems and potential solutions
Wait Problem Potential Fix Sequential Read Indicates many index reads—tune the code (especially joins) Scattered Read Indicates many full table scans—tune the code; cache small tables Free Buffer Increase the DB_CACHE_SIZE; shorten the checkpoint; tune
the code Buffer Busy Segment header—add freelists or freelist groups Buffer Busy Data block—separate “hot” data; use reverse key indexes; use
smaller blocks; increase initrans (debatable); reduce block
popularity; make I/O faster Buffer Busy Undo header—add rollback segments or areas Buffer Busy Undo block—commit more; larger rollback segments or areas Latch Free Investigate the detail (a listing later in this chapter includes fixes) Enqueue – ST Use LMTs or preallocate large extents Enqueue – HW Preallocate extents above the high water mark Enqueue – TX4 Increase initrans or use a smaller block size on the table or index Enqueue – TX6 Fix the code that is making the block unsharable (use v$lock to find) Enqueue – TM Index foreign keys; check application locking of tables Log Buffer Space Increase the log buffer; use faster disks for the redo logs Log File Switch Archive destination slow or full; add more or larger redo logs Log file sync Commit more records at a time; use faster redo log disks; use
raw devices Write complete waits Add database writers; checkpoint more often; buffer cache too small
相关文档:
1、查询两个日期之间的数据。
假设有表Table1,其创建表的sql语句为:
create table Table1(
StationID NUMBER(10) Primary key,
Year NUMBER(4) not null,
Month NUMBER(2) n ......
--如何用grade表的资料去更新usertable表的资料(有关联的字段userid)
update usertable u set u.grade =
(select g.grade from grade g where g.userid = u.userid);
--如何使查询结果字段生成序号
select rownum, t.* from sm_t_pad_new t
--如何快速做一个和原表一样的备份表
create ......
今天参加了Oracle & SUN合并后第一次与合作伙伴及客户的通气会。整个会议给我的感觉是:Oracle雄心勃勃,SUN意气风发,而我自己,心怀惴惴。 Oracle有了SUN,那么从硬件到软件Oracle的产品线就十分齐备了。Oracle半年前推出11gR2 for linux,接着for solar ......
因为很少用到, 所以几乎忘记了这几个函数, 不过它们还是很有用的使用它们可以大大简化一些SQL文的语法, 至于效率问题, 如CCW所说它们和EXISTS, IN 之类没有什么差别, 而且要具体问题具体分析
其中ANY和SOME在意思上是相同的, 可以相互替代.
举几个例子来说明ALL和ANY的用法
1. SELECT * from TABLEA WHERE FLD > AL ......