如何监控oracle性能,oracle性能监控语句

如何在loadrunner中监控oracle数据库性能测试

1,在第一个图choose monitor engine中选择sitescope,然后在在Monitored Server Machines区域点击Add可以选择本地或者其他机器的sitescope,如果sitescope启用了account的验证,也要写上相应的用户名密码。

成都创新互联专注为客户提供全方位的互联网综合服务,包含不限于成都做网站、网站设计、宜章网络推广、微信小程序开发、宜章网络营销、宜章企业策划、宜章品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;成都创新互联为所有大学生创业者提供宜章建站搭建服务,24小时服务热线:18980820575,官方网址:www.cdcxhl.com

2,在Resource Measurements on:IP区域点击添加,弹出对话框.

3,输入信息

至此就可以监控oracle了。

如何查询Oracle性能监控

分类: Oracle

1.查看临时表空间使用情况

Select

f.tablespace_name

,sum(f.bytes_free + f.bytes_used)

/1024/1024/1024 "total GB"

,sum((f.bytes_free + f.bytes_used) - nvl(p.bytes_used, 0))

/1024/1024/1024 "Free GB"

,sum(nvl(p.bytes_used, 0))

/1024/1024/1024 "Used GB"

from sys.v_$temp_space_header f, dba_temp_files d, sys.v_$temp_extent_pool p

where f.tablespace_name(+) = d.tablespace_name

and f.file_id(+) = d.file_id

and p.file_id(+) = d.file_id

group by

f.tablespace_name

2.查看使用临时表空间的SQL

Select se.username,

se.sid,

su.extents,

su.blocks * to_number(rtrim(p.value)) as Space,

tablespace,

segtype,

sql_text

from v$sort_usage su, v$parameter p, v$session se, v$sql s

where p.name = 'db_block_size'

and su.session_addr = se.saddr

and s.hash_value = su.sqlhash

and s.address = su.sqladdr

order by se.username, se.sid

3.收缩临时表空间

alter tablespace temp shrink space;

alter tablespace temp shrink tempfile ''

4.重建索引

alter index PK_CROSSRELATION rebuild;

5.查看表空间使用情况

SELECT UPPER(F.TABLESPACE_NAME) "表空间名",

D.TOT_GROOTTE_MB "表空间大小(M)",

D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)",

TO_CHAR(ROUND((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100,2),'990.99') || '%' "使用比",

F.TOTAL_BYTES "空闲空间(M)",

F.MAX_BYTES "最大块(M)"

FROM (SELECT TABLESPACE_NAME,

ROUND(SUM(BYTES) / (1024 * 1024), 2) TOTAL_BYTES,

ROUND(MAX(BYTES) / (1024 * 1024), 2) MAX_BYTES

FROM SYS.DBA_FREE_SPACE

GROUP BY TABLESPACE_NAME) F,

(SELECT DD.TABLESPACE_NAME,

ROUND(SUM(DD.BYTES) / (1024 * 1024), 2) TOT_GROOTTE_MB

FROM SYS.DBA_DATA_FILES DD

GROUP BY DD.TABLESPACE_NAME) D

WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME

ORDER BY 1;

6.查询表空间的总容量

select tablespace_name, sum(bytes) / 1024 / 1024 as MB

from dba_data_files

group by tablespace_name;

7. 查询表空间使用率

select total.tablespace_name,

round(total.MB, 2) as Total_MB,考试大论坛

round(total.MB - free.MB, 2) as Used_MB,

round((1 - free.MB / total.MB) * 100, 2) || '%' as Used_Pct

from (select tablespace_name, sum(bytes) / 1024 / 1024 as MB

from dba_free_space

group by tablespace_name) free,

(select tablespace_name, sum(bytes) / 1024 / 1024 as MB

from dba_data_files

group by tablespace_name) total

where free.tablespace_name = total.tablespace_name;

8. 查找当前表级锁的SQL如下:

select sess.sid,

sess.serial#,

lo.oracle_username,

lo.os_user_name,

ao.object_name,

lo.locked_mode

from v$locked_object lo,

dba_objects ao,

v$session sess

where ao.object_id = lo.object_id and lo.session_id = sess.sid;

杀掉锁表进程:

alter system kill session '436,35123';

9.监控当前数据库谁在运行什么SQL语句

select osuser, username, sql_text

from v$session a, v$sqltext b

where a.sql_address =b.address order by address, piece;

10.找使用CPU多的用户session

select a.sid,spid,status,substr(a.program,1,40) prog, a.terminal,osuser,value/60/100 value

from v$session a,v$process b,v$sesstat c

where c.statistic#=12 and

c.sid=a.sid and

a.paddr=b.addr

order by value desc;

11.查看死锁信息

SELECT (SELECT username

FROM v$session

WHERE SID = a.SID) blocker, a.SID, 'is blocking',

(SELECT username

FROM v$session

WHERE SID = b.SID) blockee, b.SID

FROM v$lock a, v$lock b

WHERE a.BLOCK = 1 AND b.request 0 AND a.id1 = b.id1 AND a.id2 = b.id2;

12.具有最高等待的对象

SELECT o.OWNER,o.object_name, o.object_type, a.event,

SUM (a.wait_time + a.time_waited) total_wait_time

FROM v$active_session_history a, dba_objects o

WHERE a.sample_time BETWEEN SYSDATE - 30 / 2880 AND SYSDATE

AND a.current_obj# = o.object_id

GROUP BY o.OWNER,o.object_name, o.object_type, a.event

ORDER BY total_wait_time DESC;

13.查看具有最高等待的对象

SELECT a.session_id, s.osuser, s.machine, s.program, o.owner, o.object_name,

o.object_type, a.event,

SUM (a.wait_time + a.time_waited) total_wait_time

FROM v$active_session_history a, dba_objects o, v$session s

WHERE a.sample_time BETWEEN SYSDATE - 30 / 2880 AND SYSDATE

AND a.current_obj# = o.object_id

AND a.session_id = s.SID

GROUP BY o.owner,

o.object_name,

o.object_type,

a.event,

a.session_id,

s.program,

s.machine,

s.osuser

ORDER BY total_wait_time DESC;

14.查看等待最多的SQL

SELECT a.program, a.session_id, a.user_id, d.username, s.sql_text,

SUM (a.wait_time + a.time_waited) total_wait_time

FROM v$active_session_history a, v$sqlarea s, dba_users d

WHERE a.sample_time BETWEEN SYSDATE - 30 / 2880 AND SYSDATE

AND a.sql_id = s.sql_id

AND a.user_id = d.user_id

GROUP BY a.program, a.session_id, a.user_id, s.sql_text, d.username;

15.显示正在等待锁的所有会话

SELECT * FROM DBA_WAITERS;

oracle vm server怎么监控虚拟机性能

windows系统:

通过‘任务管理器’‘性能’ 即可监控虚拟机性能。

linux系统:

top:linux自带的实时监控工具,可监控系统性能。

sar:监控系统cpu性能

vmstat:监控cpu、磁盘

iostat:检测I/O设备性能

svmon:查看系统内存使用情况

另外可用nagios等一些开源监控软件来监控系统性能

aix系统:

topas:aix系统自带的实施监控工具(类似linux的top)

sar 1 3:监控cpu,和linux相比需要带上参数。(每秒刷新1次,共刷新3次)

errpt还可查看系统错误日志。

其他监控命令基本和linux一样


新闻名称:如何监控oracle性能,oracle性能监控语句
新闻来源:http://azwzsj.com/article/hdsiph.html