oracle连接用户管理

  • 查看当前连接用户
SQL> select sid,serial#,username,type from v$session where type = 'USER';

       SID    SERIAL# USERNAME   TYPE
---------- ---------- ---------- --------------------
         6        266 DBSNMP     USER
        35       1070 DBSNMP     USER
        65       2013 SYSMAN     USER
        66        584 SYSMAN     USER
        96         11 DBSNMP     USER
        97        907 SCOTT      USER
       100         90 DBSNMP     USER
       130       6844 SYSMAN     USER
       131         41 SYSMAN     USER
       156         31 SYSMAN     USER
       159         37 DBSNMP     USER

       SID    SERIAL# USERNAME   TYPE
---------- ---------- ---------- --------------------
       193         14 DBSNMP     USER
       194         36 SYSTEM     USER
       222       2246 DBSNMP     USER
       223       1584 DBSNMP     USER

已选择15行。

SQL>
  • 强制已连接用户下线
SQL> alter system kill session '97,907';

系统已更改。

SQL>

---scott用户已无法查询
SQL> show user
USER 为 "SCOTT"
SQL> select * from dept;
select * from dept
*
第 1 行出现错误:
ORA-00028: 您的会话己被终止


SQL>
posted @ 2022-04-11 14:32  longtds  阅读(79)  评论(0编辑  收藏  举报