DROP_SNAPSHOT_RANGE过程不能清理表RM$_SNAPSHOT_DETAILS
2016-06-30 23:11
435 查看
今天在测试、验证DROP_SNAPSHOT_RANGE不能彻底快照的过程中遇到了DROP_SNAPSHOT_RANGE无法清理WRM$_SNAPSHOT_DETAILS表中数据的情况,测试服务器版本为10.2.0.5.0,AWR的快照是1小时采集一次数据,快照保留14天,也就是二周。具体情况如下所示:
如上实验所示,DROP_SNAPSHOT_RANGE不能清理WRM$_SNAPSHOT_DETAILS中的数据,当然对于的空间就不会释放,另外,有些版本中Oracle仅仅修改了对应SNAPSHOT的状态,而并没有删除快照。PS:有些人可能被上面又是DBA_HIST_SNAPSHOT,又是WRM$_SNAPSHOT_DETAILS弄得有点晕,其实DBA_HIST_SNAPSHOT是视图,它的数据来源于表WRM$_SNAPSHOT_DETAILS,使用下面SQL就能查看具体定义
SELECTOWNER,VIEW_NAME,TEXTFROMDBA_VIEWSWHEREVIEW_NAME='DBA_HIST_SNAPSHOT';
其实这个是一个Bug引起的,官方文档WRM$_SNAPSHOT_DETAILSTableisNotPurged(文档ID1489801.1)和文档Document9797851.8Bug9797851-WRM$_SNAPHOST_DETAILSisneverpurged都有描述这个Bug
Informationinthisdocumentappliestoanyplatform.
AWRpurgecodeisnotautomaticallypurgingWRM$_SNAPSHOT_DETAILS,asexpected
Evenafterdroppingarangeofsnapid'susingdbms_workload_repository.drop_snapshot_range(),thetableisnotpurged.
TableWRM$_SNAPSHOT_DETAILSgrowsindefinitely.
TherearemanyorphanedentriesinthetableWRM$_SNAPSHOT_DETAILS.
ThenumberoforphanedrowsforthetableWRM$_SNAPSHOT_DETAILScanbefoundbyrunningthefollowingsql:
[align=left]Document9797851.8Bug9797851-WRM$_SNAPHOST_DETAILSisneverpurged[/align]
Theverificationcriteriaforthebugare:
Droparangeofsnapid'susingdbms_workload_repository.drop_snapshot_range()
Checkthecorrespondingsnapid'sinWRM$_SNAPSHOT_DETAILS.
Ifsnapid'sfromtherangethatyouchosetodroparestillpresent,thenyouarehittingthisbug.
ThePatch9797851forunpublishedBug9797851isavailableforsomeplatformsandcanbedownloadedfromMyOracleSupport
Ifthepatchisnotavailableonyourplatformonasupportedversion,pleasecontactOracleSupport.
ThisissuewillbefixedfromreleaseOracle12.1
Asaworkaround,itispossibletomanuallypurgetherangeofsnapid'sfromthetableWRM$_SNAPSHOT_DETAILSusingappropriatedeletestatmentsundertheguidanceofOracleSupport.
Note:
在下面版本中,这些bug才fix掉了,请留意自己的版本信息。
SQL>select*fromv$version;
BANNER
----------------------------------------------------------------
OracleDatabase10gRelease10.2.0.5.0-64bitProduction
PL/SQLRelease10.2.0.5.0-Production
CORE10.2.0.5.0Production
TNSforLinux:Version10.2.0.5.0-Production
NLSRTLVersion10.2.0.5.0-Production
SQL>COLSNAP_INTERVALFORA20;
SQL>COLTETENTIONFORA26;
SQL>SELECT*FROMdba_hist_wr_control;
DBIDSNAP_INTERVALRETENTIONTOPNSQL
-------------------------------------------------------------------
3990839260+0000001:00:00.0+0001400:00:00.0DEFAULT
SQL>SELECTMIN(SNAP_ID),MAX(SNAP_ID)FROMdba_hist_snapshot;
MIN(SNAP_ID)MAX(SNAP_ID)
------------------------
741759195
SQL>
SQL>SELECTMIN(SNAP_ID),MAX(SNAP_ID)FROMdba_hist_snapshot;
MIN(SNAP_ID)MAX(SNAP_ID)
------------------------
741759196
SQL>selectdbid,status,count(*)
2fromwrm$_snapshot
3groupbydbid,status;
DBIDSTATUSCOUNT(*)
------------------------------
399083926001250
SQL>selectmin(snap_id),max(snap_id),dbidfromwrm$_snapshot
2groupbydbid;
MIN(SNAP_ID)MAX(SNAP_ID)DBID
----------------------------------
7417591963990839260
SQL>execdbms_workload_repository.drop_snapshot_range(7417,59196,3990839260);
PL/SQLproceduresuccessfullycompleted.
SQL>selectmin(snap_id),max(snap_id),dbidfromwrm$_snapshot
2groupbydbid;
MIN(SNAP_ID)MAX(SNAP_ID)DBID
----------------------------------
7417591973990839260
SQL>selectmin(snap_id),max(snap_id),dbidfromwrm$_snapshot
2groupbydbid;
MIN(SNAP_ID)MAX(SNAP_ID)DBID
----------------------------------
7417591973990839260
SQL>SELECTMIN(SNAP_ID),MAX(SNAP_ID)FROMdba_hist_snapshot;
MIN(SNAP_ID)MAX(SNAP_ID)
------------------------
741759197
如上实验所示,DROP_SNAPSHOT_RANGE不能清理WRM$_SNAPSHOT_DETAILS中的数据,当然对于的空间就不会释放,另外,有些版本中Oracle仅仅修改了对应SNAPSHOT的状态,而并没有删除快照。PS:有些人可能被上面又是DBA_HIST_SNAPSHOT,又是WRM$_SNAPSHOT_DETAILS弄得有点晕,其实DBA_HIST_SNAPSHOT是视图,它的数据来源于表WRM$_SNAPSHOT_DETAILS,使用下面SQL就能查看具体定义
SELECTOWNER,VIEW_NAME,TEXTFROMDBA_VIEWSWHEREVIEW_NAME='DBA_HIST_SNAPSHOT';
"selectsnap_id,dbid,instance_number,startup_time,
begin_interval_time,end_interval_time,
flush_elapsed,snap_level,error_count
fromWRM$_SNAPSHOT
wherestatus=0"
其实这个是一个Bug引起的,官方文档WRM$_SNAPSHOT_DETAILSTableisNotPurged(文档ID1489801.1)和文档Document9797851.8Bug9797851-WRM$_SNAPHOST_DETAILSisneverpurged都有描述这个Bug
APPLIESTO:
OracleDatabase-EnterpriseEdition-Version11.2.0.3to12.1.0.1[Release11.2to12.1]Informationinthisdocumentappliestoanyplatform.
SYMPTOMS
Thefollowingsymptomsareobserved:AWRpurgecodeisnotautomaticallypurgingWRM$_SNAPSHOT_DETAILS,asexpected
Evenafterdroppingarangeofsnapid'susingdbms_workload_repository.drop_snapshot_range(),thetableisnotpurged.
TableWRM$_SNAPSHOT_DETAILSgrowsindefinitely.
TherearemanyorphanedentriesinthetableWRM$_SNAPSHOT_DETAILS.
ThenumberoforphanedrowsforthetableWRM$_SNAPSHOT_DETAILScanbefoundbyrunningthefollowingsql:
SQL>SELECTMIN(snap_id),
max(snap_id),
cast(min(begin_time)asdate)"MinBeginTime",
CAST(MAX(begin_time)ASDATE)"MaxBeginTime",
COUNT(*)
FROMsys.wrm$_snapshot_detailsa
WHERENOTEXISTS
(SELECT*
FROMsys.wrm$_snapshotb
WHEREb.snap_id=a.snap_id
ANDa.dbid=b.dbid
anda.instance_number=b.instance_number
)
MIN(SNAP_ID)MAX(SNAP_ID)MinBeginTimeMaxBeginTimeCOUNT(*)
--------------------------------------------------------------------------
1699329-nov-201121:00:0124-sep-201222:00:17577574
CAUSE
Thisissueiscausedbyanunpublishedbug:[align=left]Document9797851.8Bug9797851-WRM$_SNAPHOST_DETAILSisneverpurged[/align]
Theverificationcriteriaforthebugare:
Droparangeofsnapid'susingdbms_workload_repository.drop_snapshot_range()
Checkthecorrespondingsnapid'sinWRM$_SNAPSHOT_DETAILS.
Ifsnapid'sfromtherangethatyouchosetodroparestillpresent,thenyouarehittingthisbug.
SOLUTION
Thefollowingsolutionsareavailable:ThePatch9797851forunpublishedBug9797851isavailableforsomeplatformsandcanbedownloadedfromMyOracleSupport
Ifthepatchisnotavailableonyourplatformonasupportedversion,pleasecontactOracleSupport.
ThisissuewillbefixedfromreleaseOracle12.1
Asaworkaround,itispossibletomanuallypurgetherangeofsnapid'sfromthetableWRM$_SNAPSHOT_DETAILSusingappropriatedeletestatmentsundertheguidanceofOracleSupport.
Note:
在下面版本中,这些bug才fix掉了,请留意自己的版本信息。
相关文章推荐
- http://blog.csdn.net/zxl315/article/details/10830105
- cookie无法设置除当前域名或者其父域名之外的其他domain.
- http://blog.csdn.net/congcong68/article/details/39256307
- baike并行计算概念
- baike并行计算概念
- Main event loop
- http://m.blog.csdn.net/article/details?id=2630620
- [源码解读]position_estimator_inav_main解读(如何启动光流)
- SLA by Short brain-June-2016
- ERROR:nautilus-window.c:2116:nautilus_window_get_slots: assertion failed: (NAUTILUS_IS_WINDOW (windo
- codeforces 687B Remainders Game【数学】
- Codeforces Round #360 (Div. 2) D. Remainders Game 数学
- MAINACTIIVITY
- 【杭电-oj】-1702-ACboy needs your help again!(栈和队列基础)
- 实现AIDL接口的Binder连接池
- wait_timeout与interactive_timeout
- CURL ERROR 7 Failed to connect to Permission denied
- 数论 - CF 687B Remainders Game
- Django 发送email配置详解及各种错误类型
- Weblogic服务器启动异常:unable to validate weblogic domain