婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > System表空間不足的報警問題淺析

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 hh24: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 hh24: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 hh24:mi:ss') AS TIMESTAMP)  
and CAST(to_date('2014-03-11 00:00:00', 'YYYY-MM-DD hh24: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 hh24:mi:ss') AS TIMESTAMP)  
and CAST(to_date('2014-03-11 00:00:00', 'YYYY-MM-DD hh24: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 hh24: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 hh24: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 hh24:mi:ss') AS TIMESTAMP)  
and CAST(to_date('2016-12-11 00:00:00', 'YYYY-MM-DD hh24: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 hh24:mi:ss') AS TIMESTAMP)  
and CAST(to_date('2016-12-11 00:00:00', 'YYYY-MM-DD hh24: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表空間不足的報警,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網站的支持!

標簽:威海 七臺河 防疫戰設 宿州 來賓 銅仁 天水 益陽

巨人網絡通訊聲明:本文標題《System表空間不足的報警問題淺析》,本文關鍵詞  System,表,空間,不足,的,報警,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《System表空間不足的報警問題淺析》相關的同類信息!
  • 本頁收集關于System表空間不足的報警問題淺析的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 襄城县| 绿春县| 禹城市| 登封市| 马山县| 徐闻县| 兴化市| 聂荣县| 资溪县| 临漳县| 唐山市| 盐城市| 淮南市| 古田县| 宝应县| 茶陵县| 河津市| 巧家县| 汉沽区| 东海县| 忻城县| 阳新县| 苏州市| 龙里县| 台东市| 马边| 信丰县| 汝城县| 丘北县| 英超| 宁阳县| 聂荣县| 沧州市| 龙口市| 尤溪县| 阳东县| 枞阳县| 耒阳市| 广平县| 阳泉市| 镇安县|