|
Re: 为什么数据库变慢???
The key here is "如果重新启动速度就回恢复正常". (I assume you mean restarting the database, not rebooting the box). I can think of two factors that are relevant and they were both mentioned by others already: memory and locks. It's likely that your SQLs are not shared well and they consume shared pool too quickly. The ultimate solution is writing the SQLs using bind variables. But you can try increasing shared_pool_size or flushing shared pool periodically. These are ugly workarounds and shouldn't be relied upon. Please tell us what your 4th row of v$sgastat (shared pool free memory) changes.
Locks could be another reason, although less likely. Familiarize yourself with v$lock (except MR, RT locks) and v$locked_object, v$transaction. Tell us what's in v$lock.
In any case, whenever you have performance problems, tell us what you see in v$session_wait (except for idle waits such as %timer%, %message%). Never waste money on monitoring tools such as spotlight, unless you already know these v$ views very well.
Yong Huang
最初由 oases 发布
[B]我有一个数据库,其中大部分表的记录数都有几百万,这样的表大概有十几个,平时常做的操作是SELECT ,INSERT,偶尔有做UPDATE和TRUNCATE PARTITION的操作。现在经常发现数据库写入数据的速度变慢,如果重新启动速度就回恢复正常,请问各位高手,这是为什么呢? [/B] |
|