Browsed by
Month: July 2015

Oracle: clear buffer cache

Oracle: clear buffer cache

The FLUSH BUFFER_CACHE clause lets you clear all data from the buffer cache in the system global area (SGA). ALTER SYSTEM FLUSH BUFFER_CACHE; This clause is useful if you need to measure the performance of rewritten queries or a suite of queries from identical starting points. Caution: This clause is intended for use only on a test database. Do not use this clause on a production database, because as a result of this statement, subsequent queries will have no hits, only misses. Source:…

Read More Read More

Oracle: killing sessions

Oracle: killing sessions

Sometimes when things go wrong it is necessary to kill  user session. There are multiple ways to do it. First of all, you need to identify your session with &sid and &serial numbers. select * from v$session where lower(username) = 'my_user_name';   KILL SESSION command asks the session to kill itself. ALTER SYSTEM KILL SESSION '&sid,&serial';   DISCONNECT SESSION command kills the dedicated server process. Syntax is following: ALTER SYSTEM DISCONNECT SESSION '&sid,&serial' POST_TRANSACTION; The POST_TRANSACTION clause waits for ongoing transactions to complete before disconnecting the session. ALTER SYSTEM DISCONNECT SESSION '&sid,&serial' IMMEDIATE; The IMMEDIATE clause disconnects the session and ongoing…

Read More Read More