资源描述:
《db2数据库操作_计算机软件及应用_IT计算机_专业资料》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、—检查衣空间使用率1—selectchar(TBSPNAME,50)asTBSPKAME,TBSPUSABLEPAGES,TBSPUSEDPAGES,rlrim(100*TBSP_USED_PAGES/TBSP.USABLE_PAGES)
2、I'%'asUSED_RATEfromsysibmadm.SNAPTBSP_PARTwhereTBSP_USABLE_PAGES>0orderbyTBSP_NAME,DBPARTITIONNUM测试结果:<1NSTANCE:DB2*DATABASE:>:connecttosanple数据库连接信息ail■DB2/NT9.7.0=ADMINIST...■S
3、AMPLEDATftBfiSE:SAMPLE>:selectcharasTBSP_NAME,TBSP_USftBLE_PftGES,TBSP_USED_PAGES,rtrin<100*TBSP_USED_PnGES/!asUSED_RATEfromsysibnadm.SNfiPTBSP_PARTwhereTBSP_USABLEJAGES〉(JorderbyTBSP_NAME,DBPRRTITIONNUMIDMDB2SAMPLEREL4064387295zIBMDB2SAMPLEXML
4、4064144035zSVSCATSPACE163801478090zSVSTOOLSPACE409212027.SVSTOOLSTMPSPACE11100zTEMPSPACE111100ZUSERSPACE14064188846zTBSP_NAMETBSP_USABLEJ>ftGESTBSP_USEDJ>ftGES7条记录已选检査表空间使用率2SELECTTOTALPAGES,USEDPAGES,FREEPAGES,rtrim(char(USEDPAGES*100/TOTALPAGES))
5、
6、,%>asUSEDRATE,rtrim(char(FREEPAGES*100/T0TALPAGE
7、S))
8、
9、,%>asFreeRATEFROMtable(SNAPSHOT_TBS_CFG(‘sample',-1))t实骑结果厶:SELECTTOTAL_PAGE£,USED_PfiGES,FREE_PAGES,rtrin>\9v.9asUSED_RATE,rtrihar>\9X9asFree_RATEFROMtableCSNAPSHOT.TBS_CFG<#sample#,-1>>tTOTfiL_PfiGESU
10、SED_PAGESFREE_PnGESUSED_RATEFREE_RATE163841478016U090Z9乂110100z0z40961888217646z53z409638?219294*4z40961440262435z64z4096120397227.96z110100Z0Z7条记录已选择。检查使用率3SEI.ECTsubstr(tbspname,1,20)asTABLESPACENAME,substr(tbspcontenttype,1,10)asTABLESPACETYPE,sum(tbsptotalsizekb)/1024asTOTALMB,sum(tbspusedsize
11、kb)/1024asUSED.MB,sum(tbsp_free_size_kb)/1024asFREE_MB,tbsp_page_sizeASPAGE_SIZE,TBSP_UTIL1ZAT1ON_PERCENTaspercentFROMSYSIBMADM.TBSP_UT1L1ZAT1ONGROUPBYtbsp_name,tbsp_content_type,tbsp_page_size,TBSP_UT1L1ZAT1ON^PERCENTORDERBYTBSP_UT1L1ZAT1ON_PERCENT;Sql语句使用内存的情况SELECTcreation_time•lastexecutiontim
12、etal_physical_reads,total_logical_reads八otal_logical_writes,execution_count,total_worker_time,total_elapsed_time,total_elapsed_time/execution_countavg_elapsed_time,SUBSTRING(st.text^(qs.statement_start_offset/2)+