事情解決過(guò)程
select pid,spid from v$process where program like %SMON%;
PID SPID
---------- ------------------------------------------------
32 227051
SQL> oradebug setorapid 32;
Unix process pid: 525418, image: (SMON)
SQL> oradebug event 10046 trace name context forever,level 1;
Statement processed.
SQL> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/dbm/dbm1/trace/dbm1_smon_227051.trc
SQL> oradebug wakeup 32;
Statement processed.
SQL> oradebug wakeup 32;
Statement processed.
SQL>
level - tablespace number+1. If the value is 2147483647 then
temp segments in ALL tablespaces are dropped, otherwise, only
segments in a tablespace whose number is equal to the LEVEL
specification are dropped.
select ts# from v$tablespace where name=TBS_1M_SPACE;
alter session set events immediate trace name DROP_SEGMENTS level 17;
alter session set events immediate trace name DROP_SEGMENTS level 2147483647;
1) set event 10061 in the pfile to turn off SMON from cleaning temp segments. This will keep the database from crashing after SMON tries 100 times to clean the segment.
event = 10061 trace name context forever, level 10
2) >select segment_name, segment_type from dba_segments where
header_file=98 and segment_type=TEMPORARY;
SEGMENT_NAME SEGMENT_TYPE
------------------- -----------------------
98.110124 TEMPORARY
98.110124 <---------- datafile and block number
If there are no results make sure the datafile reference is not using the relative file number.
>select rfile#,name,ts#,file# from v$datafile;
3) Mark the segment as corrupted:
exec dbms_space_admin.segment_corrupt( ,98,110124)
OR
You can generate a script for all segments using the following :
set lines 5000
set long 9999
set pages 999
set head off
spool corrupt.sql
select exec dbms_space_admin.segment_corrupt(||s.tablespace_name||||,||replace (segment_name,.,,)||)||; from dba_segments s ,dba_tablespaces t where s.TABLESPACE_NAME=upper(&Tablespace_name)
and s.segment_type=TEMPORARY
and t.contents=PERMANENT
and s.TABLESPACE_NAME=t.TABLESPACE_NAME;
spool off
Then execute the sript corrupt.sql
@corrupt.sql
4) Drop the segment
exec dbms_space_admin.segment_drop_corrupt( ,98,110124)
OR
You can generate a script for all segments using the following :
spool drop.sql
set lines 5000
set long 9999
set pages 999
set head off
select exec dbms_space_admin.segment_drop_corrupt(||s.tablespace_name||||,||SEGMENT_NAME||)||; from dba_segments s ,dba_tablespaces t where s.TABLESPACE_NAME=upper(&Tablespace_name)
and s.segment_type=TEMPORARY
and t.contents=PERMANENT
and s.TABLESPACE_NAME=t.TABLESPACE_NAME;
spool off
Then execute the sript drop.sql
@drop.sql
5) Rebuild the tablespace bitmap(s)
exec dbms_space_admin.tablespace_rebuild_bitmaps( );
6) Remove event 10061 from pfile and bounce database
7) exec dbms_space_admin.tablespace_verify ( );
關(guān)閉各個(gè)實(shí)例,并啟動(dòng)數(shù)據(jù)庫(kù)。
事情總結(jié)
解決問(wèn)題的前提,需先熟悉整個(gè)問(wèn)題環(huán)節(jié)和理論原理,下面就上面案例做一些提取。
1. 臨時(shí)段何時(shí)產(chǎn)生
臨時(shí)表空間的臨時(shí)段,永久表空間的臨時(shí)段,一般永久表空間的臨時(shí)段smon會(huì)自動(dòng)清理,臨時(shí)表空間的臨時(shí)段可以通過(guò)重啟實(shí)例或重建臨時(shí)表空間解決。
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/129410.html
摘要:年月日,第屆技術(shù)管理工作坊將在深圳華僑城洲際酒店舉行。壹佰案例在開(kāi)始前采訪了沈劍老師,先行劇透架構(gòu)師轉(zhuǎn)型做管理的感悟。 showImg(https://segmentfault.com/img/bVxMfU);2016年6月25-26日,第27屆MPD技術(shù)管理工作坊將在深圳華僑城洲際酒店舉行。本次工作坊,我們邀請(qǐng)了58到家技術(shù)總監(jiān)沈劍老師,分享《技術(shù)團(tuán)隊(duì)的接手、搭建與發(fā)展實(shí)踐 》, 講...
摘要:云計(jì)算正以空前的發(fā)展速度,迎來(lái)自己的大機(jī)會(huì)時(shí)代。月日,金山云財(cái)報(bào),云業(yè)務(wù)營(yíng)收億元,同比增長(zhǎng)。因此,對(duì)每個(gè)正在行業(yè)里尋找機(jī)會(huì)的企業(yè)來(lái)說(shuō),任正非先生說(shuō)的一番話似乎都非常值得共同重溫一下他說(shuō)在大機(jī)會(huì)時(shí)代,千萬(wàn)不要機(jī)會(huì)主義,反而要有戰(zhàn)略耐性。后疫情時(shí)代,情勢(shì)倒逼生產(chǎn)服務(wù)場(chǎng)景和消費(fèi)場(chǎng)景快速線上化,數(shù)據(jù)顯示,2020年以來(lái),即使按照最保守的口徑估計(jì),中國(guó)遠(yuǎn)程辦公企業(yè)規(guī)模超過(guò)1800萬(wàn)家,遠(yuǎn)程辦公人員超過(guò)...
摘要:表級(jí)鎖表級(jí)鎖表級(jí)別的鎖定是各存儲(chǔ)引擎中最大顆粒度的鎖定機(jī)制。當(dāng)前沒(méi)有其他事務(wù)持有表中任意一行的排他鎖。為了檢測(cè)是否滿足第二個(gè)條件,事務(wù)必須在確保表不存在任何排他鎖的前提下,去檢測(cè)表中的每一行是否存在排他鎖。一、表級(jí)鎖、行級(jí)鎖、頁(yè)級(jí)鎖數(shù)據(jù)庫(kù)鎖定機(jī)制簡(jiǎn)單來(lái)說(shuō),就是數(shù)據(jù)庫(kù)為了保證數(shù)據(jù)的一致性,而使各種共享資源在被并發(fā)訪問(wèn)變得有序所設(shè)計(jì)的一種規(guī)則。MySQL數(shù)據(jù)庫(kù)由于其自身架構(gòu)的特點(diǎn),存在多種數(shù)據(jù)存...
摘要:也可以在凌晨系統(tǒng)不是那么繁忙的時(shí)候操作。總結(jié)一下少量用戶設(shè)計(jì)簡(jiǎn)單,但浪費(fèi)空間,冗余高中量用戶設(shè)計(jì)較簡(jiǎn)單,對(duì)表的操作壓力大大量用戶這不是增加幾個(gè)表能解決的問(wèn)題 基本功能 點(diǎn)到點(diǎn)的消息傳送: 用戶給用戶 管理員給用戶 點(diǎn)到面的消息傳送 管理員給用戶群 少量用戶(10-999) 對(duì)于用戶非常少的情況,沒(méi)有必要深入的考慮數(shù)據(jù)庫(kù)的優(yōu)化,采用簡(jiǎn)單的表設(shè)計(jì): 如表message ...
閱讀 1346·2023-01-11 13:20
閱讀 1684·2023-01-11 13:20
閱讀 1132·2023-01-11 13:20
閱讀 1859·2023-01-11 13:20
閱讀 4100·2023-01-11 13:20
閱讀 2704·2023-01-11 13:20
閱讀 1385·2023-01-11 13:20
閱讀 3597·2023-01-11 13:20