MSSQL网站制作之关于实行企图里recursive calls,db bl...
这能找出所有错误的99.99%。它不能找出的是仅仅涉及数据文件的损坏(这很不常见)。如果你想要检查一张表,你通常应该没有选项地运行myisamchk或用-s或--silent选项的任何一个。实行我们在实践事情中常常要看某个sql语句的实行企图,比方:
在sqlplus利用命令SETAUTOTRACEON后,实行企图显现以下:
SELECTSTATEMENTOptimizer=ALL_ROWS(Cost=985Card=1Bytes=26)
Statistics
----------------------------------------------------------
35recursivecalls
0dbblockgets
1052consistentgets
7168physicalreads
0redosize
395bytessentviaSQL*Nettoclient
512bytesreceivedviaSQL*Netfromclient
2SQL*Netroundtripsto/fromclient
0sorts(memory)
0sorts(disk)
1rowsprocessed
个中recursivecalls,dbblockgets,consistentgets的详细寄义是甚么?
详细注释以下:
·RecursiveCalls.Numberofrecursivecallsgeneratedatboththeuserandsystemlevel.
OracleDatabasemaintainstablesusedforinternalprocessing.Whenitneedstochangethesetables,OracleDatabasegeneratesaninternalSQLstatement,whichinturngeneratesarecursivecall.
Inshort,recursivecallsarebasicallySQLperformedonbehalfofyourSQL.So,ifyouhadtoparsethequery,forexample,youmighthavehadtorunsomeotherqueriestogetdatadictionaryinformation.Thesewouldberecursivecalls.Spacemanagement,securitychecks,callingPL/SQLfromSQL—allincurrecursiveSQLcalls.
·DBBlockGets.NumberoftimesaCURRENTblockwasrequested.
Currentmodeblocksareretrievedastheyexistrightnow,notinaconsistentreadfashion.
Normally,blocksretrievedforaqueryareretrievedastheyexistedwhenthequerybegan.Currentmodeblocksareretrievedastheyexistrightnow,notfromapreviouspointintime.
DuringaSELECT,youmightseecurrentmoderetrievalsduetoreadingthedatadictionarytofindtheextentinformationforatabletodoafullscan(becauseyouneedthe"rightnow"information,nottheconsistentread).Duringamodification,youwillaccesstheblocksincurrentmodeinordertowritetothem.
(DBBlockGets:哀求的数据块在buffer能满意的个数)
·ConsistentGets.Numberoftimesaconsistentreadwasrequestedforablock.
Thisishowmanyblocksyouprocessedin"consistentread"mode.Thiswillincludecountsofblocksreadfromtherollbacksegmentinordertorollbackablock.
ThisisthemodeyoureadblocksinwithaSELECT,forexample.
Also,whenyoudoasearchedUPDATE/DELETE,youreadtheblocksinconsistentreadmodeandthengettheblockincurrentmodetoactuallydothemodification.
(ConsistentGets:数据哀求总数在回滚段Buffer中)
·PhysicalReads.Totalnumberofdatablocksreadfromdisk.Thisnumberequalsthevalueof"physicalreadsdirect"plusallreadsintobuffercache.(PhysicalReads:实例启动后,从磁盘读到BufferCache数据块数目)
·Sorts(disk).Numberofsortoperationsthatrequiredatleastonediskwrite.SortsthatrequireI/Otodiskarequiteresourceintensive.TryincreasingthesizeoftheinitializationparameterSORT_AREA_SIZE.
刚安装好的MySql包含一个含空密码的root帐户和一个匿名帐户,这是很大的安全隐患,对于一些重要的应用我们应将安全性尽可能提高,在这里应把匿名帐户删除、root帐户设置密码 总感觉自己还是不会SQL 代替了原来VB式的错误判断。比Oracle高级不少。 理解了存储结构,再阅读下性能优化的章节基本上会对sqlserver有个清晰地认识 可以动态传入参数,省却了动态SQL的拼写。 对于微软系列的东西除了一遍遍尝试还真没有太好的办法 总感觉自己还是不会SQL 而SQLServer如果能像Oracle一样可以为登陆分配如:5%的cpu,10%的内存。就可以解决这个漏洞。 同样会为索引视图等应用带来麻烦。看看行级和事务级的快照数据放在tempdb中,就能感觉到目前架构的尴尬。 学习SQL语言的话如果要学会去做网站就不是很难!但是要做数据库管理的话就有难度了!
页:
[1]