设为首页 加入收藏

TOP

【翻译自mos文章】在RACdatabase中怎么独立于instance来killsession?
2015-07-24 11:55:34 来源: 作者: 【 】 浏览:5
Tags:翻译 mos 文章 RACdatabase 怎么 立于 instance killsession

来源于:
How to Kill a Session on RAC Database In Instance Independent Fashion. (文档 ID 869777.1)

适用于:
Oracle Database - Enterprise Edition - Version 11.1.0.6 and later
Information in this document applies to any platform.

目标:
你可以在RAC database中来kill session,而不用考虑该session是从哪个intance上产生的。这是11g的新特性。

解决方案:

To kill a session in RAC database use the following syntax.

sql> conn / as sysdba

sql> alter system kill session 'sid, serial#, @inst_id';

?

For Example :

SQL@racdb1> select inst_id,sid,serial#,username from gv$session where username is not null and username not like 'SYS%'; 

INST_ID SID SERIAL# USERNAME 
---------- ---------- ---------- ------------------------------ 
1                123        76       DBSNMP 

1 rows selected. 

SQL@racdb2> conn scott/tiger 
Connected. 

SQL@racdb1> select inst_id,sid,serial#,username from gv$session where username is not null and username not like 'SYS%'; 

INST_ID SID SERIAL# USERNAME 
---------- ---------- ---------- ------------------------------ 
2                115    17816        SCOTT 
1                123         76         DBSNMP 

2 rows selected. 

SQL@racdb1> alter system kill session '115,17816,@2'; 

System altered. 

SQL@racdb1> conn scott/tiger 
Connected. 

SQL@racdb1> select inst_id,sid,serial#,username from gv$session where username is not null and username not like 'SYS%'; 

INST_ID SID SERIAL# USERNAME 
---------- ---------- ---------- ------------------------------ 
1                110      45316         SCOTT 
1                123            76         DBSNMP 

2 rows selected. 

sql> alter system kill session '110,45316,@1';
System altered.

?

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇【数据库】优化排序&&高.. 下一篇辛星浅析Redis中的服务器管理

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Sphinx : 高性能SQL (2025-12-24 10:18:11)
·Pandas 性能优化 - (2025-12-24 10:18:08)
·MySQL 索引 - 菜鸟教 (2025-12-24 10:18:06)
·Shell 基本运算符 - (2025-12-24 09:52:56)
·Shell 函数 | 菜鸟教 (2025-12-24 09:52:54)