运维联盟俱乐部

 找回密码
 立即注册
查看: 1727|回复: 0

[日常管理] q_dblink

[复制链接]
  • TA的每日心情
    开心
    2023-8-9 11:05
  • 发表于 2020-9-11 14:53:34 | 显示全部楼层 |阅读模式
    --查询dblink的情况
    1. SET ECHO        OFF
    2. SET FEEDBACK    ON
    3. SET HEADING     ON
    4. SET LINESIZE    180
    5. SET PAGESIZE    2000
    6. SET TIMING      OFF
    7. SET TRIMSPOOL   ON
    8. SET VERIFY      OFF
    9. CLEAR COLUMNS BREAKS COMPUTES

    10. COLUMN owner                          FORMAT a15     HEADING 'OWNER'
    11. COLUMN DB_LINK                        FORMAT a20     HEADING 'DL_VALUE'
    12. COLUMN username                       FORMAT a15     HEADING 'USER NAME'
    13. COLUMN host                           FORMAT a50    HEADING 'HOST'
    14. SELECT
    15.     owner,username,db_link,host,created  
    16. FROM
    17.     dba_db_links  
    18. ORDER BY 1
    19. /
    复制代码
    --监控非活动DBLINK进程数量
    1. select count(*)
    2.   from (select *
    3.            from v$session
    4.           where type = 'USER'
    5.             and event = 'SQL*Net message from client'
    6.             and program like '%@%')
    7. /
    复制代码
    --获取杀进程脚本
    1. select 'host kill -9 ' || spid
    2.   from v$process
    3. where addr in (select paddr
    4.                   from (select *
    5.                           from v$session
    6.                          where type = 'USER'
    7.                            and event = 'SQL*Net message from client'
    8.                            and program like '%@%'));
    复制代码




    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    运维联盟俱乐部 ( 冀ICP备19036648号 )

    GMT+8, 2024-5-17 09:42 , Processed in 0.045086 second(s), 21 queries , Gzip On.

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表