开发人员值得看的达梦sql-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3502423
  • 博文数量: 718
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7790
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(718)

文章存档

2024年(4)

2023年(74)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客
相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: 数据库开发技术

2023-11-15 15:20:03

查看dm.ini

  1. ps -ef|grep dms|grep -v grep|awk '{print $9}'

  2. ps -ef|grep dms|grep -v grep|awk '{print $9}'|awk -f"=" '{print $2}'

  1. --表空间使用
  2. set pagesize 100

  3. select f.tablespace_name,round(t.total_space / 1024,1) total_g,
  4. round((t.total_space - f.free_space) / 1024,1) used_g,round(f.free_space / 1024,1) free_g,
  5. round(((t.total_space - f.free_space) / t.total_space) * 100) "per_used%"
  6. from (select tablespace_name,round(sum(blocks *
  7. (select para_value / 1024 from v$dm_ini
  8. where para_name = 'global_page_size') / 1024)) free_space
  9. from dba_free_space group by tablespace_name) f,
  10. (select tablespace_name, round(sum(bytes / 1048576)) total_space
  11. from dba_data_files group by tablespace_name) t
  12. where f.tablespace_name = t.tablespace_name order by 5 desc;

  13. --监控运行时错误历史
  14. select * from v$runtime_err_history;

  15. --死锁历史信息记录
  16. select * from v$deadlock_history;
  17. --查看数据库是否存在阻塞
  18. with trx_tab as
  19. (select o1.name,l1.trx_id from v$lock l1,sysobjects o1 where l1.table_id=o1.id and o1.id<>0),
  20. trx_sess as (
  21. select l.trx_id wt_trxid, l.row_idx blk_trxid,l.blocked,(select name table_name from trx_tab a where a.trx_id=l.trx_id) wt_table,
  22. s1.sess_id wt_sess,s2.sess_id blk_sess,
  23. s1.user_name wt_user_name,s2.user_name blk_user_name,s1.sql_text,s1.clnt_ip,datediff(ss, s1.last_send_time, sysdate) ss
  24. from v$lock l,v$sessions s1,v$sessions s2
  25. where l.trx_id=s1.trx_id and l.row_idx=s2.trx_id)
  26. select sysdate stattime,* from trx_sess where blocked=1;


  27. --按小时统计arch
  28. select to_char(create_time,'yy-mm-dd hh24') xiaoshi,round(sum(free)/1024/1024) mb,count(0) cnt from v$arch_file group by to_char(create_time,'yy-mm-dd hh24') order by 1;



  29. --最慢的 20 条 sql
  30. select top 20 start_time,time_used/1000 time_used,top_sql_text from v$sql_history order by time_used desc;
  31. select top 20 * from v$system_long_exec_sqls order by exec_time desc;
  32. --高内存的 20 条 sql 信息
  33. select top 20 * from v$system_large_mem_sqls order by mem_used_by_k desc;

  34. --查看所有作业信息
  35. select a.id,a.name,a."enable",a.username,a.createtime,a.modifytime,a.describe,
  36. b.last_date||' '||b.last_sec last_time,b.next_date||' '||b.next_sec next_time,b.what
  37. from sysjob.sysjobs a,sysjob.user_jobs b
  38. where a.id=b.job;


  39. --用户权限
  40. select * from (
  41. select grantee,granted_role privilege,'role_privs' privilege_type,case admin_option when 'y' then 'yes' else 'no' end admin_option from dba_role_privs
  42. union select grantee,privilege,'sys_privs' privilege_type,admin_option from dba_sys_privs
  43. union select grantee,privilege||' on '||owner||'.'||table_name privilege,'table_privs' privilege_type,grantable from dba_tab_privs
  44. )
  45. where grantee in (select username from all_users where username not in ('sys','sysdba','syssso','sysauditor') )
  46. order by grantee,privilege_type,privilege;

阅读(70) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图