资源描述:
《管理员日常工作》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、16管理员日常工作任务1:显示当前归档状态Don'tleave$ORACLE_HOMEwithoutthem!Thecommandbelow,whenenteredviaSQLDBA,willdisplaythecurrentarchivelogstatusofthedatabase.Thescriptwilldisplaytheactivelog_archive_destlocation,aswellasthecurrentandoldestonlineredologsequencenumbers.ARCHIVELOGLIST;任务2:建立一个控制文件跟踪
2、文件Don'tleave$ORACLE_HOMEwithoutthem!Thecommandbelow,whenenteredviaSQLDBA,willcreateatracefileinyourtracefiledestinationdirectory.ThetracefilewillcontainthecompleteCREATECONTROLFILEcommandforthecurrentdatabase,savingyouvastquantitiesoftimeifyoueverneedtogeneratethatcommand.ALTERDATA
3、BASEBACKUPCONTROLFILETOTRACE;任务3:表空间的自由扩展与自由空间Don’tleave$ORACLE_HOMEwithoutthem!ThequerybelowwillONLYworkinOracle7.2andhighe匚Inpreviousversions,itwasdifficulttoqueryDBA_DATA_FILESandDBA_FREE_SPACEinonequery,sincebothcouldhavemultiplerowsforeachtablespace・Using7.2‘sFROMclausesubquer
4、yfeature,youcangroupthetwoqueriesseparately,thenjointhemontheTablcspacc_Namcvalue・Theresultshowsthelargestfreeextentinthetablespace,thenumberoffreeextentsinthetablespace,thetotalfreespaceinthetablespace,andthepercentageofthetablespacesavailablespacethatisfree・columnTablcspacc_Namcf
5、ormatA20columnPct_Freeformat999.99selectTablespace_Name,Max_Blocks,Count_Blocks,Sum_Frcc_Blocks,100*Sum_Free_Blocks/Sum_Alloc_BlocksASPct_Freefrom(selectTablespace_Name,SUM(Blocks)Sum_Alloc_BlocksfromDBA_DATA_FILESgroupbyTablcspacc_Namc),(selectTablespace_NameFS_TS_NAME,MAX(Blocks)
6、ASMax_Blocks,COUNT(Blocks)ASCount_Blocks,SUM(Blocks)ASSum_Free_BlocksfromDBA_FREE_SPACEgroupbyTablespace_Name)whereTablespace_Name=FS_TS_NAME;任务4:显示分配的空间和用户限额Don'tleave$ORACLE_HOMEwithoutthem!DBA_TS_QUOTASdisplaystheallocatedspace,byuser,ineachtablespace,alongwiththequotaforeachoft
7、hoseusers.Ifauserhasunlimitedquotainatablespace,thequotawillbedisplayedas0ornegative.Runningthisscriptisagreatquickwaytoseewhichusersownobjectsinwhichtablespaces,andhowclosetheyaretotheirquotas.You'llneedtoSETLINESIZE132beforerunningthisscript・select*fromDBA_TS_QUOTASorderbyTablesp
8、ace_Name,Username;任务5:显示所有