在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

如何解决System表空间不足的报警问题

141次阅读
没有评论

共计 4242 个字符,预计需要花费 11 分钟才能阅读完成。

丸趣 TV 小编给大家分享一下如何解决 System 表空间不足的报警问题,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

具体代码如下所示:

--SYSTEM 表空间不足的报警  
登录之后,查询,发现是 sys.aud$ 占的地方太多。 
SQL  select owner, segment_name, segment_type, sum(bytes)/1024/1024 space_m 
 from dba_segments 
 where tablespace_name =  SYSTEM  
group by owner, segment_name, segment_type 
having sum(bytes)/1024/1024  = 20 
order by space_m desc 
; 
 4 5 6 7 
OWNER SEGMENT_NAME SEGMENT_TYPE SPACE_M 
-------- ------------------------------- ------- 
SYS AUD$ TABLE 4480 
SYS IDL_UB1$ TABLE 272 
SYS SOURCE$ TABLE 72 
SYS IDL_UB2$ TABLE 32 
SYS C_OBJ#_INTCOL# CLUSTER 27 
SYS C_TOID_VERSION# CLUSTER 24 
6 rows selected. 
SQL  
查看是哪个记得比较多。 
col userhost format a30 
select userid, userhost, count(1) from sys.aud$ 
where ntimestamp#  =CAST(to_date( 2014-03-01 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
group by userid, userhost 
having count(1)   500 
order by count(1) desc 
; 
再继续找哪天比较多。 
select to_char(ntimestamp#,  YYYY-MM-DD) audit_date, count(1) 
from sys.aud$ 
where ntimestamp#  =CAST(to_date( 2014-03-01 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
and userid =  xxxx  and userhost =  xxxx  
group by to_char(ntimestamp#,  YYYY-MM-DD) 
order by count(1) desc 
; 
select spare1, count(1) from sys.aud$ 
where ntimestamp# between CAST(to_date( 2014-03-10 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
and CAST(to_date( 2014-03-11 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
and userid =  xxxx  and userhost =  xxxx  
group by spare1 
; 
select action#, count(1) from sys.aud$ 
where ntimestamp# between CAST(to_date( 2014-03-10 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
and CAST(to_date( 2014-03-11 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
and userid =  xxxx  and userhost =  xxxx  
and spare1 =  xxxx  
group by action# 
order by count(1) desc 
; 
结果如下: 
 ACTION# COUNT(1) 
---------- ---------- 
 101 124043 
 100 124043 
SQL  
其实是上次打开的 audit 一直没有关闭。 
关闭: 
SQL  noaudit session; 
清空: 
truncate table sys.aud$; 
------------------------------------------------------------------------ 
实战  
------------------------------------------------------------------------ 
--1, 查询表空间占用情况  
select dbf.tablespace_name as tablespace_name, 
 dbf.totalspace as totalspace, 
 dbf.totalblocks as totalblocks, 
 dfs.freespace freespace, 
 dfs.freeblocks freeblocks, 
 (dfs.freespace / dbf.totalspace) * 100 as freeRate 
 from (select t.tablespace_name, 
 sum(t.bytes) / 1024 / 1024 totalspace, 
 sum(t.blocks) totalblocks 
 from DBA_DATA_FILES t 
 group by t.tablespace_name) dbf, 
 (select tt.tablespace_name, 
 sum(tt.bytes) / 1024 / 1024 freespace, 
 sum(tt.blocks) freeblocks 
 from DBA_FREE_SPACE tt 
 group by tt.tablespace_name) dfs 
 where trim(dbf.tablespace_name) = trim(dfs.tablespace_name) 
--2, 查看哪里占的比较多  SYSTEM  为 step1 中查询  tablespace_name  内容  
select owner, segment_name, segment_type, sum(bytes)/1024/1024 space_m 
 from dba_segments 
 where tablespace_name =  SYSTEM  
group by owner, segment_name, segment_type 
having sum(bytes)/1024/1024  = 20 
order by space_m desc 
--3, 查看是哪个记得比较多  count(1)  越大, 说明占得比较多  
select userid, userhost, count(1) from sys.aud$ 
where ntimestamp#  =CAST(to_date( 2014-03-01 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
group by userid, userhost 
having count(1)   500 
order by count(1) desc 
--4, 再继续找哪天比较多  userid userhost  为上一步查询内容  
select to_char(ntimestamp#,  YYYY-MM-DD) audit_date, count(1) 
from sys.aud$ 
where ntimestamp#  =CAST(to_date( 2015-03-01 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
and userid =  userid  and userhost =  userhost  
group by to_char(ntimestamp#,  YYYY-MM-DD) 
order by count(1) desc 
; 
select spare1, count(1) from sys.aud$ 
where ntimestamp# between CAST(to_date( 2016-03-10 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
and CAST(to_date( 2016-12-11 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
and userid =  userid  and userhost =  userhost  
group by spare1 
; 
--spare1  为上一步查询内容  
select action#, count(1) from sys.aud$ 
where ntimestamp# between CAST(to_date( 2016-03-10 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
and CAST(to_date( 2016-12-11 00:00:00 ,  YYYY-MM-DD hh34:mi:ss) AS TIMESTAMP) 
and userid =  userid  and userhost =  userhost  
and spare1 =  Administrator  
group by action# 
order by count(1) desc 
--5, 关闭 seeion 
noaudit session; 
--6, 清空: 
truncate table sys.aud$;

以上是“如何解决 System 表空间不足的报警问题”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注丸趣 TV 行业资讯频道!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-04发表,共计4242字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 国产思思99re99在线观看 | 成人国产一区二区三区 | 影音先锋女人aa鲁色资源 | 日在线视频| 又爽又黄又无遮挡网站 | 亚洲精品成人福利网站 | 久久国产一久久高清 | 国产高清区 | 久久视频精品38线视频在线观看 | 美女张开腿黄网站免费 | 玖玖爱zh综合伊人久久 | 国产高清视频在线观看 | 国产91在线 | 欧美 | 欧美在线二区 | 国产在线观看成人免费视频 | 步兵社区在线观看 | 毛片在线免费视频 | 九九精品视频在线观看九九 | 99久久国产综合精品五月天喷水 | 久久精品亚洲热综合一本奇米 | 亚洲一级免费毛片 | 久久精品免费观看国产 | 久久久久久久国产精品毛片 | 国产成a人片在线观看视频 国产成a人片在线观看视频99 | 免费精品99久久国产综合精品 | 自愉自愉产区二十四区 | 天天做天天爱天天综合网 | 日本午夜在线观看 | 99久久免费精品视频 | 日本高清不卡一区 | 日本免费一区二区三区 | 久久久久久极精品久久久 | 99j久久精品久久久久久 | 欧美在线视频不卡 | 亚洲理论视频 | 含羞草天堂久久爱 | 亚洲成av人片在线观看 | 中国老熟妇自拍hd发布 | 国产免费a视频 | 精品国产一区二区三区免费看 | 欧美精品国产日韩综合在线 |