下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、.:.;oracle中查找执行效率低下的SQLv$sqltext:存储的是完好的SQL,SQL被分割v$sqlarea:存储的SQL 和一些相关的信息,比如累计的执行次数,逻辑读,物理读等统计信息统计v$sql:内存共享SQL区域中曾经解析的SQL语句。即时根据sid查找完好sql语句:select sql_text from v$sqltext a where a.hash_value = (select sql_hash_value from v$session b where b.sid = &sid )order by piece ascselect a.CPU_TIME,-CPU时间
2、 百万分之一微秒 a.OPTIMIZER_MODE,-优化方式 a.EXECUTIONS,-执行次数 a.DISK_READS,-读盘次数 a.SHARABLE_MEM,-占用shared pool的内存多少 a.BUFFER_GETS,-读取缓冲区的次数 aMAND_TYPE,-命令类型(3:select,2:insert;6:update;7delete;47:pl/sql程序单元) a.SQL_TEXT,-Sql语句 a.SHARABLE_MEM, a.PERSISTENT_MEM, a.RUNTIME_MEM, a.PARSE_CALLS, a.DISK_READS, a.DIRECT
3、_WRITES, a.CONCURRENCY_WAIT_TIME, a.USER_IO_WAIT_TIME from SYS.V_$SQLAREA aWHERE PARSING_SCHEMA_NAME = CHEA_FILL-表空间order by a.CPU_TIME desc援用:jenniferok.iteye/blog/700985从V$SQLAREA中查询最占用资源的查询select b.username username,a.disk_reads reads,a.executions exec,a.disk_reads/decode(a.executions,0,1,a.execu
4、tions) rds_exec_ratio,a.sql_text Statementfrom v$sqlarea a,dba_users bwhere a.parsing_user_id=b.user_idand a.disk_reads 100000order by a.disk_reads desc;用buffer_gets列来交换disk_reads列可以得到占用最多内存的sql语句的相关信息。v$sql:内存共享SQL区域中曾经解析的SQL语句。即时列出运用频率最高的5个查询:select sql_text,executionsfrom (select sql_text,executi
5、ons,rank() over(order by executions desc) exec_rankfrom v$sql)where exec_rank =5;耗费磁盘读取最多的sql top5:select disk_reads,sql_textfrom (select sql_text,disk_reads,dense_rank() over(order by disk_reads desc) disk_reads_rankfrom v$sql)where disk_reads_rank =5;找出需求大量缓冲读取逻辑读操作的查询:select buffer_gets,sql_textf
6、rom (select sql_text,buffer_gets,dense_rank() over(order by buffer_gets desc) buffer_gets_rankfrom v$sql)where buffer_gets_rank=5;v$sqlarea字段定义:happyhou.blog.sohu/60494432.htmlSQL_TEXTVARCHAR2(1000)First thousand characters of the SQL text for the current cursorSQL_IDVARCHAR2(13)SQL identifier of th
7、e parent cursor in the library cacheSHARABLE_MEMNUMBERAmount of shared memory used by a cursor. If multiple child cursors exist, then the sum of all shared memory used by all child cursors.PERSISTENT_MEMNUMBERFixed amount of memory used for the lifetime of an open cursor. If multiple child cursors e
8、xist, the fixed sum of memory used for the lifetime of all the child cursors.RUNTIME_MEMNUMBERFixed amount of memory required during execution of a cursor. If multiple child cursors exist, the fixed sum of all memory required during execution of all the child cursors.SORTSNUMBERSum of the number of
9、sorts that were done for all the child cursorsVERSION_COUNTNUMBERNumber of child cursors that are present in the cache under this parentLOADED_VERSIONSNUMBERNumber of child cursors that are present in the cache and have their context heap (KGL heap 6) loadedOPEN_VERSIONSNUMBERThe number of child cur
10、sors that are currently open under this current parentUSERS_OPENINGNUMBERNumber of users that have any of the child cursors openFETCHESNUMBERNumber of fetches associated with the SQL statementEXECUTIONSNUMBERTotal number of executions, totalled over all the child cursorsEND_OF_FETCH_COUNTNUMBERNumbe
11、r of times this cursor was fully executed since the cursor was brought into the library cache. The value of this statistic is not incremented when the cursor is partially executed, either because it failed during the execution or because only the first few rows produced by this cursor are fetched be
12、fore the cursor is closed or re-executed. By definition, the value of the END_OF_FETCH_COUNT column should be less or equal to the value of the EXECUTIONS column.USERS_EXECUTINGNUMBERTotal number of users executing the statement over all child cursorsLOADSNUMBERNumber of times the object was loaded
13、or reloadedFIRST_LOAD_TIMEVARCHAR2(19)Timestamp of the parent creation timeINVALIDATIONSNUMBERTotal number of invalidations over all the child cursorsPARSE_CALLSNUMBERSum of all parse calls to all the child cursors under this parentDISK_READSNUMBERSum of the number of disk reads over all child curso
14、rsDIRECT_WRITESNUMBERSum of the number of direct writes over all child cursorsBUFFER_GETSNUMBERSum of buffer gets over all child cursorsAPPLICATION_WAIT_TIMENUMBERApplication wait timeCONCURRENCY_WAIT_TIMENUMBERConcurrency wait timeCLUSTER_WAIT_TIMENUMBERCluster wait timeUSER_IO_WAIT_TIMENUMBERUser
15、I/O Wait TimePLSQL_EXEC_TIMENUMBERPL/SQL execution timeJAVA_EXEC_TIMENUMBERJava execution timeROWS_PROCESSEDNUMBERTotal number of rows processed on behalf of this SQL statementCOMMAND_TYPENUMBEROracle command type definitionOPTIMIZER_MODEVARCHAR2(25)Mode under which the SQL statement was executedPAR
16、SING_USER_IDNUMBERUser ID of the user that has parsed the very first cursor under this parentPARSING_SCHEMA_IDNUMBERSchema ID that was used to parse this child cursorKEPT_VERSIONSNUMBERNumber of child cursors that have been marked to be kept using the DBMS_SHARED_POOL packageADDRESSRAW(4 | 8)Address
17、 of the handle to the parent for this cursorHASH_VALUENUMBERHash value of the parent statement in the library cacheOLD_HASH_VALUENUMBEROld SQL hash valueMODULEVARCHAR2(64)Contains the name of the module that was executing at the time that the SQL statement was first parsed as set by calling DBMS_APP
18、LICATION_INFO .SET_MODULEMODULE_HASHNUMBERHash value of the module that is named in the MODULE columnACTIONVARCHAR2(64)Contains the name of the action that was executing at the time that the SQL statement was first parsed as set by calling DBMS_APPLICATION_INFO .SET_ACTIONACTION_HASHNUMBERHash value of the action that is n
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年光电技术研发与转让合同
- 环保型绿化垃圾收运方案探讨
- 2024年城市轨道交通建设委托代建合同
- 商业地产环境保护及废物处理方案
- 2024年「版权保护与维权」合同方案
- 临建施工进度控制方案
- 2024年土地使用权出让合同的出让面积、出让价格和付款方式
- 2024年外籍语言教师短期聘用合同
- 2024年互联网金融平台建设合同
- 2024年劳动合同具体条款和标的
- 电脱水、电脱盐讲解
- 违约损失率(LGD)研究
- 新冀教版九年级英语上册第26课课件
- 编写标准必备文件 国家标准 地方标准 行业标准 企业标准 格式模板大全
- 《钻木取火》PPT
- 沟槽回填施工方案(完整版)
- 2021-2025乡村5年规划三篇
- 无线电遥控帆船讲解
- 压力与情绪管理(完整版)
- 各式链轮参数表
- 福建省标准化考点巡视监控系统操作规范
评论
0/150
提交评论