1.Oracle支持的存储类型
查询结果
File System
Raw partitions:速度快,但管理麻烦
ASM(automatic storge management)
几个有用的视图:
v$filestat
v$datafile
读取文件的情况查询, 哪些文件读写较多:
select PHYRDS, PHYWRTS, d.
name
from v$datafile d, v$filestat f
where d.
file#=f.
file#
order
by d.
name;
查看表空间的读写情况,哪些表空间读写较多则需要采取调优方案:
col
file_name format a40
col tablespace format a10
select d.tablespace_name tablespace, d. file_name, f.phyrds,f.phywrts from v$filestat f, dba_data_files d where f. file#=d. file_id;
select d.tablespace_name tablespace, d. file_name, f.phyrds,f.phywrts from v$filestat f, dba_data_files d where f. file#=d. file_id;
视图v$session_longops可以查询出执行特别耗时(超过6秒)的sql语句
desc v$session_longops
select
count(*)
from v$session_longops;
select * from v$session aa,v$session_longops bb,v$sql cc where bb.sid = aa.sid and aa.sql_address = cc.address and aa.sql_hash_value = cc.hash_value; --通过关联,查询比较满的sql究竟是什么样的sql
select
name, value
from v$sysstat
where
name
like
'%table_scan%';
NAME VALUE
------------------------------ ----------
table scans (short tables) 1058
table scans (long tables) 3
table scans (rowid ranges) 0
table scans (cache partitions) 0
table scans (direct read) 0
table scan rows gotten 699306
table scan blocks gotten 15872
------------------------------ ----------
table scans (short tables) 1058
table scans (long tables) 3
table scans (rowid ranges) 0
table scans (cache partitions) 0
table scans (direct read) 0
table scan rows gotten 699306
table scan blocks gotten 15872
本文转自 tianya23 51CTO博客,原文链接:http://blog.51cto.com/tianya23/262815,如需转载请自行联系原作者