仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2027|回复: 9

[学习教程] MSSQL网站制作之关于实行企图里recursive calls,db bl...

[复制链接]
兰色精灵 该用户已被删除
发表于 2015-1-16 22:34:45 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
这能找出所有错误的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帐户设置密码
莫相离 该用户已被删除
发表于 2015-1-17 12:00:13 | 显示全部楼层
总感觉自己还是不会SQL
小女巫 该用户已被删除
发表于 2015-1-20 18:16:23 | 显示全部楼层
代替了原来VB式的错误判断。比Oracle高级不少。
因胸联盟 该用户已被删除
发表于 2015-1-29 13:59:13 | 显示全部楼层
理解了存储结构,再阅读下性能优化的章节基本上会对sqlserver有个清晰地认识
透明 该用户已被删除
发表于 2015-2-6 01:45:37 | 显示全部楼层
可以动态传入参数,省却了动态SQL的拼写。
若天明 该用户已被删除
发表于 2015-2-14 21:06:17 | 显示全部楼层
对于微软系列的东西除了一遍遍尝试还真没有太好的办法
变相怪杰 该用户已被删除
发表于 2015-3-4 10:30:57 | 显示全部楼层
总感觉自己还是不会SQL
爱飞 该用户已被删除
发表于 2015-3-11 18:23:41 | 显示全部楼层
而SQLServer如果能像Oracle一样可以为登陆分配如:5%的cpu,10%的内存。就可以解决这个漏洞。
发表于 2015-3-19 07:08:08 | 显示全部楼层
同样会为索引视图等应用带来麻烦。看看行级和事务级的快照数据放在tempdb中,就能感觉到目前架构的尴尬。
冷月葬花魂 该用户已被删除
发表于 2015-3-27 12:10:14 | 显示全部楼层
学习SQL语言的话如果要学会去做网站就不是很难!但是要做数据库管理的话就有难度了!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-3-29 10:35

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表