Terminating Sessions
来源:互联网 发布:如何做淘宝客赚钱 编辑:程序博客网 时间:2024/06/06 12:57
Terminating Sessions
当一个会话被终止时,该会话所有的事务会被回滚,相应的资源(locks memory areas)也会立即被释放。
sql statement :alter system kill session '7,15';
1.确定哪些会话需要终止
SELECT SID, SERIAL#,STATUS
FROM V$SESSION
WHERE USERNAME = 'JWARD';
SID SERIAL# STATUS
----- --------- --------
7 15 ACTIVE
12 63 INACTIVE
ACTIVE --》making a SQL call to Oracle Database.
INACTIVE --》 not making a SQL call to thedatabase
2.干掉session
alter systemkill session '7,15';
注意:An active session cannot be interrupted when it is performingnetwork I/O or rolling back a transaction. Such a session cannot beterminated until the operation completes. In this case, the sessionholds all resources until it is terminated.
Additionally, the
session that issues the ALTER SYSTEM statement toterminate a session waits up to 60 seconds for the session to beterminated. If the operation that cannot beinterrupted continues past one minute, the issuer ofthe ALTER SYSTEM statement receives a messageindicating that the session has been marked to be terminated. Asession marked to be terminated is indicated in V$SESSION with astatus of KILLED and a serverthat is something other than PSEUDO 。
3.干掉an Inactive Session
SELECT SID,SERIAL#,STATUS,SERVER
FROM V$SESSION
WHERE USERNAME ='JWARD';
SID SERIAL# STATUS SERVER
----- -------- --------- ---------
7 15 INACTIVE DEDICATED
12 63 INACTIVE DEDICATED
2 rows selected.
ALTER SYSTEM KILL SESSION '7,15';
Statement processed.
确定下session 是否已经被kill了
SELECT SID, SERIAL#, STATUS, SERVER
FROM V$SESSION
WHERE USERNAME ='JWARD';
SID SERIAL# STATUS SERVER
----- -------- --------- ---------
7 15 KILLED PSEUDO
12 63 INACTIVE DEDICATED
2 rows selected.
当一个会话被终止时,该会话所有的事务会被回滚,相应的资源(locks memory areas)也会立即被释放。
sql statement :alter system kill session '7,15';
1.确定哪些会话需要终止
SID
-----
12
INACTIVE
2.干掉session
注意:An active session cannot be interrupted when it is performingnetwork I/O or rolling back a transaction. Such a session cannot beterminated until the operation completes. In this case, the sessionholds all resources until it is terminated.
Additionally, the
session that issues the
3.干掉an Inactive Session
SELECT SID,SERIAL#,STATUS,SERVER
SID
-----
2 rows selected.
ALTER SYSTEM KILL SESSION '7,15';
Statement processed.
确定下session 是否已经被kill了
SELECT SID, SERIAL#, STATUS, SERVER
SID
-----
2 rows selected.
- Terminating Sessions
- Terminating a Process
- JSP Sessions
- PHP Sessions
- Zkoss Sessions
- PHP Sessions
- PHP Sessions
- PHP Sessions
- PHP Sessions
- PHP----Sessions
- vim Sessions
- PHP Sessions
- PHP Sessions
- cookie & sessions
- PHP - Sessions
- PHP Sessions
- PHP Sessions
- tomcat 并发问题 (terminating thread)
- ORACLE修改数据库名<转载>
- 解决undo 表空间过大导致磁盘空间…
- 高端内存的映射 -- 永久映射和临时映射
- Configuring FTP on Exadata <转…
- Master Note: Transportable Table…
- Terminating Sessions
- alerts
- DEFERRED_SEGMENT_CREATION <11g的…
- SuperCluster配置以及和Exad…
- 人生不仅如此!
- 解决chm文档字体太小的问题
- About Trace Files
- 关于 adding a new disk or removi…
- recovery a read only tablespace