暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

UNDO表空间活动空间比例,redo log切换频率,分区表是否存在全局索引

原创 逆风飞翔 2021-09-08
408

-----UNDO表空间活动空间比例
select a.tablespace_name,
used_undo,
total_undo,
trunc(used_undo / total_undo * 100, 2) used_rat
from (select nvl(sum(bytes / 1024 / 1024), 0) used_undo, tablespace_name
from dba_undo_extents
where status = ‘ACTIVE’
group by tablespace_name) a,
(select tablespace_name, sum(bytes / 1024 / 1024) total_undo
from dba_data_files
where tablespace_name in
(select value
from vspparameterwherename=undotablespaceand(sid=(selectinstancenamefromvspparameter where name = 'undo_tablespace' and (sid = (select instance_name from vinstance) or
sid = ‘*’))
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name;

–检查redo log切换频率
select a.thread#,
row_number() over(partition by a.thread# order by a.thread#) num,
to_char(b.first_time, ‘yyyy-mm-dd hh24:mi:ss’) start_time,
to_char(a.first_time, ‘yyyy-mm-dd hh24:mi:ss’) end_time,
round(((a.first_time - b.first_time) * 24) * 60, 2) minutes
from vloghistorya,vlog_history a, vlog_history b
where a.first_change# = b.next_change#
and a.thread# = b.thread#
and a.first_time > sysdate - 3
order by a.thread#, a.stamp asc;

----检查分区表是否存在全局索引
select a.owner, a.table_name, a.index_name, a.partitioned, a.status
from dba_indexes a, dba_part_tables b
where a.table_name = b.table_name
and a.owner = b.owner
and a.owner not in (‘SYS’,
‘SYSTEM’,
‘MDSYS’,
‘SYSMAN’,
‘MGMT_VIEW’,
‘ANONYMOUS’,
‘FLOWS_FILES’,
‘WKPROXY’,
‘WKSYS’,
‘FLOWS_030000’,
‘OLAPSYS’,
‘APEX_PUBLIC_USER’)
and a.partitioned <> ‘YES’;

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论