显示数据库当前的连接数:
select count(*) from v$process;
显示数据库最大连接数:
select value from v$parameter where name ='processes'
修改最大Oracle最大连接数:
alter system set processes = 300 scope = spfile;
显示当前的session连接数:
select count(*) fromv$session
查看当前有哪些用户正在使用数据:
SELECT osuser, a.username,cpu_time/executions/1000000||'s', sql_fulltext,machine from v$session a, v$sqlarea b where a.sql_address =b.address order by cpu_time/executions desc;
查看数据库中SGA:
System global area (SGA),system global area(PGA);
查看连接oracle的所有机器的连接数:
selectmachine,count(*) fromv$session groupbymachine;
查看连接oracle的所有机器的连接数和状态:
selectmachine,status,count(*) fromv$session groupbymachine,status orderbystatus;
Oracle 11g设置内存自动管理:
ALTERSYSTEM SETMEMORY_TARGET = 1024M SCOPE=SPFILE;
ALTERSYSTEM SETmemory_max_target = 1500M SCOPE=SPFILE;
ALTERSYSTEM SETSGA_TARGET = 0 SCOPE=SPFILE;
ALTERSYSTEM SETSGA_MAX_SIZE=800M SCOPE=SPFILE;
ALTERSYSTEM SETPGA_AGGREGATE_TARGET = 0 SCOPE=SPFILE;
altersystem setpre_page_sga=FALSEscope=spfile;
查看消耗磁盘读取最多的SQL Top 5:
select disk_reads,sql_text,SQL_FULLTEXT
from (select sql_text,disk_reads,SQL_FULLTEXT,
dense_rank() over
(order by disk_reads desc) disk_reads_rank
from v$sql)
where disk_reads_rank <=5;
实例:
通过linux中消耗资源高的进程号获取oracle消耗资源的sql语句:
1、linux中使用top命名查看oracle进程中消耗资源最高的进程号;
2、oracle中使用命令:
select c.spid,a.p1,a.p1raw,a.p2,a.event,b.sql_text,b.SQL_FULLTEXT,b.SQL_ID
from v$session a,v$sql b,v$process c
where a.wait_class<>'Idle' and a.sql_id=b.sql_id and a.PADDR=c.addr
order by event;
3、查询结果显示出各个sql语句对应的进程号,从中找出top命令中对应消耗资源高的进程号即可找到相应的sql语句。
文章来源: 松勤软件学院
原文链接: https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzI3NDc4NTQ0Nw==&scene=126#wechat_redirect
-
捉蚊趣事作文400字优秀作文:https://www.nanss.com/xuexi/16041.html 一升等于多少立方米:https://www.nanss.com/wenti/14825.html 工作汇报结尾:https://www.nanss.com/gongzuo/16000.html 容积率高好还是低好:https://www.nanss.com/wenti/15592.html 空调尺寸:https://www.nanss.com/shenghuo/15809.html 小学家长评语:https://www.nanss.com/xuexi/16383.html 教育小故事:https://www.nanss.com/xuexi/14386.html 招生工作总结:https://www.nanss.com/gongzuo/16685.html 爱情散文集:https://www.nanss.com/yuedu/14672.html 高中数学教学计划:https://www.nanss.com/gongzuo/16644.html 记一次游戏作文300字四年级:https://www.nanss.com/xuexi/16721.html 100寸电视长宽多少:https://www.nanss.com/wenti/16390.html 烤箱预热要多久:https://www.nanss.com/wenti/14718.html 实习生简历模板:https://www.nanss.com/xuexi/16746.html 校园爱情故事:https://www.nanss.com/xuexi/14402.html 人生大事观后感:https://www.nanss.com/xuexi/14361.html 我的乐园作文400字:https://www.nanss.com/xuexi/15572.html 一年级口算题:https://www.nanss.com/xuexi/14035.html 语文工作总结:https://www.nanss.com/gongzuo/16952.html 瓦尔登湖读后感:https://www.nanss.com/xuexi/14443.html 哈佛家训读后感:https://www.nanss.com/xuexi/16205.html 家庭趣事作文400字:https://www.nanss.com/xuexi/15626.html 企业财务制度:https://www.nanss.com/gongzuo/14321.html 行会名称大全:https://www.nanss.com/mingcheng/14304.html 接待工作方案:https://www.nanss.com/gongzuo/16975.html 市场营销制度:https://www.nanss.com/gongzuo/15931.html 同学聚会邀请函:https://www.nanss.com/xuexi/14327.html 勿忘国耻吾辈自强:https://www.nanss.com/xuexi/16480.html 学习方法演讲稿:https://www.nanss.com/xuexi/14570.html 处女座男生性格特点:https://www.nanss.com/xingzuo/15114.html(0) 回复 (0)
-
讨债公司/蓝月传奇辅助/蓝月辅助(0) 回复 (0)