学习动态性能表(三)
[font=Times New Roman]V$SQL[/font][font=宋体]中存储具体的[/font][font=Times New Roman]SQL[/font][font=宋体]语句。[/font][font=Times New Roman] [/font]
[font=宋体] 一条语句可以映射多个[/font][font=Times New Roman]cursor,[/font][font=宋体]因为对象所指的[/font][font=Times New Roman]cursor[/font][font=宋体]可以有不同用户[/font][font=Times New Roman]([/font][font=宋体]如例[/font][font=Times New Roman]1)[/font][font=宋体]。如果有多个[/font][font=Times New Roman]cursor([/font][font=宋体]子游标[/font][font=Times New Roman])[/font][font=宋体]存在,在[/font][font=Times New Roman]V$SQLAREA[/font][font=宋体]为所有[/font][font=Times New Roman]cursor[/font][font=宋体]提供集合信息。[/font]
[b][font=宋体]例[/font][font=Times New Roman]1[/font][/b][b][font=宋体]:[/font][/b]
[font=宋体]这里介绍以下[/font][font=Times New Roman]child cursor [/font]
[font=Times New Roman]user A: select * from tbl [/font]
[font=Times New Roman]user B: select * from tbl [/font]
[font=宋体]大家认为这两条语句是不是一样的啊,可能会有很多人会说是一样的,但我告诉你不一定,那为什么呢?[/font][font=Times New Roman] [/font]
[font=宋体]这个[/font][font=Times New Roman]tblA[/font][font=宋体]看起来是一样的,但是不一定哦,一个是[/font][font=Times New Roman]A[/font][font=宋体]用户的[/font][font=Times New Roman], [/font][font=宋体]一个是[/font][font=Times New Roman]B[/font][font=宋体]用户的,这时他们的执行计划分析代码差别可能就大了哦,改下写法大家就明白了[/font][font=Times New Roman]: [/font]
[font=Times New Roman]select * from A.tbl[/font]
[font=Times New Roman]select * from B.tbl [/font]
[font=Times New Roman] [/font]
[font=宋体] 在个别[/font][font=Times New Roman]cursor[/font][font=宋体]上,[/font][font=Times New Roman]v$sql[/font][font=宋体]可被使用。该视图包含[/font][font=Times New Roman]cursor[/font][font=宋体]级别资料。当试图定位[/font][font=Times New Roman]session[/font][font=宋体]或用户以分析[/font][font=Times New Roman]cursor[/font][font=宋体]时被使用。[/font]
[font=宋体] [/font][font=Times New Roman]PLAN_HASH_VALUE[/font][font=宋体]列存储的是数值表示的[/font][font=Times New Roman]cursor[/font][font=宋体]执行计划。可被用来对比执行计划。[/font][font=Times New Roman]PLAN_HASH_VALUE[/font][font=宋体]让你不必一行一行对比即可轻松鉴别两条执行计划是否相同。[/font]
[font=Times New Roman] [/font]
[b][font=Times New Roman]V$SQL[/font][/b][b][font=宋体]中的列说明:[/font][/b]
[font=Wingdings]l
[/font][font=Times New Roman]SQL_TEXT[/font][font=宋体]:[/font][font=Times New Roman]SQL[/font][font=宋体]文本的前[/font][font=Times New Roman]1000[/font][font=宋体]个字符[/font]
[font=Wingdings]l
[/font][font=Times New Roman]SHARABLE_MEM[/font][font=宋体]:占用的共享内存大小[/font][font=Times New Roman]([/font][font=宋体]单位:[/font][font=Times New Roman]byte)[/font]
[font=Wingdings]l
[/font][font=Times New Roman]PERSISTENT_MEM[/font][font=宋体]:生命期内的固定内存大小[/font][font=Times New Roman]([/font][font=宋体]单位:[/font][font=Times New Roman]byte)[/font]
[font=Wingdings]l
[/font][font=Times New Roman]RUNTIME_MEM[/font][font=宋体]:执行期内的固定内存大小[/font]
[font=Wingdings]l
[/font][font=Times New Roman]SORTS[/font][font=宋体]:完成的排序数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]LOADED_VERSIONS[/font][font=宋体]:显示上下文堆是否载入,[/font][font=Times New Roman]1[/font][font=宋体]是[/font][font=Times New Roman]0[/font][font=宋体]否[/font]
[font=Wingdings]l
[/font][font=Times New Roman]OPEN_VERSIONS[/font][font=宋体]:显示子游标是否被锁,[/font][font=Times New Roman]1[/font][font=宋体]是[/font][font=Times New Roman]0[/font][font=宋体]否[/font]
[font=Wingdings]l
[/font][font=Times New Roman]USERS_OPENING[/font][font=宋体]:执行语句的用户数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]FETCHES[/font][font=宋体]:[/font][font=Times New Roman]SQL[/font][font=宋体]语句的[/font][font=Times New Roman]fetch[/font][font=宋体]数。[/font]
[font=Wingdings]l
[/font][font=Times New Roman]EXECUTIONS[/font][font=宋体]:自它被载入缓存库后的执行次数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]USERS_EXECUTING[/font][font=宋体]:执行语句的用户数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]LOADS[/font][font=宋体]:对象被载入过的次数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]FIRST_LOAD_TIME[/font][font=宋体]:初次载入时间[/font]
[font=Wingdings]l
[/font][font=Times New Roman]INVALIDATIONS[/font][font=宋体]:无效的次数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]PARSE_CALLS[/font][font=宋体]:解析调用次数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]DISK_READS[/font][font=宋体]:读磁盘次数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]BUFFER_GETS[/font][font=宋体]:读缓存区次数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]ROWS_PROCESSED[/font][font=宋体]:解析[/font][font=Times New Roman]SQL[/font][font=宋体]语句返回的总列数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]COMMAND_TYPE[/font][font=宋体]:命令类型代号[/font]
[font=Wingdings]l
[/font][font=Times New Roman]OPTIMIZER_MODE[/font][font=宋体]:[/font][font=Times New Roman]SQL[/font][font=宋体]语句的优化器模型[/font]
[font=Wingdings]l
[/font][font=Times New Roman]OPTIMIZER_COST[/font][font=宋体]:优化器给出的本次查询成本[/font]
[font=Wingdings]l
[/font][font=Times New Roman]PARSING_USER_ID[/font][font=宋体]:第一个解析的用户[/font][font=Times New Roman]ID[/font]
[font=Wingdings]l
[/font][font=Times New Roman]PARSING_SCHEMA_ID[/font][font=宋体]:第一个解析的计划[/font][font=Times New Roman]ID[/font]
[font=Wingdings]l
[/font][font=Times New Roman]KEPT_VERSIONS[/font][font=宋体]:指出是否当前子游标被使用[/font][font=Times New Roman]DBMS_SHARED_POOL[/font][font=宋体]包标记为常驻内存[/font]
[font=Wingdings]l
[/font][font=Times New Roman]ADDRESS[/font][font=宋体]:当前游标父句柄地址[/font]
[font=Wingdings]l
[/font][font=Times New Roman]TYPE_CHK_HEAP[/font][font=宋体]:当前堆类型检查说明[/font]
[font=Wingdings]l
[/font][font=Times New Roman]HASH_VALUE[/font][font=宋体]:缓存库中父语句的[/font][font=Times New Roman]Hash[/font][font=宋体]值[/font]
[font=Wingdings]l
[/font][font=Times New Roman]PLAN_HASH_VALUE[/font][font=宋体]:数值表示的执行计划。[/font]
[font=Wingdings]l
[/font][font=Times New Roman]CHILD_NUMBER[/font][font=宋体]:子游标数量[/font]
[font=Wingdings]l
[/font][font=Times New Roman]MODULE[/font][font=宋体]:在第一次解析这条语句是通过调用[/font][font=Times New Roman]DBMS_APPLICATION_INFO.SET_MODULE[/font][font=宋体]设置的模块名称。[/font]
[font=Wingdings]l
[/font][font=Times New Roman]ACTION[/font][font=宋体]:在第一次解析这条语句是通过调用[/font][font=Times New Roman]DBMS_APPLICATION_INFO.SET_ACTION[/font][font=宋体]设置的动作名称。[/font]
[font=Wingdings]l
[/font][font=Times New Roman]SERIALIZABLE_ABORTS[/font][font=宋体]:事务未能序列化次数[/font]
[font=Wingdings]l
[/font][font=Times New Roman]OUTLINE_CATEGORY[/font][font=宋体]:如果[/font][font=Times New Roman]outline[/font][font=宋体]在解释[/font][font=Times New Roman]cursor[/font][font=宋体]期间被应用,那么本列将显示出[/font][font=Times New Roman]outline[/font][font=宋体]各类,否则本列为空[/font]
[font=Wingdings]l
[/font][font=Times New Roman]CPU_TIME[/font][font=宋体]:解析[/font][font=Times New Roman]/[/font][font=宋体]执行[/font][font=Times New Roman]/[/font][font=宋体]取得等[/font][font=Times New Roman]CPU[/font][font=宋体]使用时间[/font][font=Times New Roman]([/font][font=宋体]单位,毫秒[/font][font=Times New Roman])[/font]
[font=Wingdings]l
[/font][font=Times New Roman]ELAPSED_TIME[/font][font=宋体]:解析[/font][font=Times New Roman]/[/font][font=宋体]执行[/font][font=Times New Roman]/[/font][font=宋体]取得等消耗时间[/font][font=Times New Roman]([/font][font=宋体]单位,毫秒[/font][font=Times New Roman])[/font]
[font=Wingdings]l
[/font][font=Times New Roman]OUTLINE_SID[/font][font=宋体]:[/font][font=Times New Roman]outline session[/font][font=宋体]标识[/font]
[font=Wingdings]l
[/font][font=Times New Roman]CHILD_ADDRESS[/font][font=宋体]:子游标地址[/font]
[font=Wingdings]l
[/font][font=Times New Roman]SQLTYPE[/font][font=宋体]:指出当前语句使用的[/font][font=Times New Roman]SQL[/font][font=宋体]语言版本[/font]
[font=Wingdings]l
[/font][font=Times New Roman]REMOTE[/font][font=宋体]:指出是否游标是一个远程映象[/font][font=Times New Roman](Y/N)[/font]
[font=Wingdings]l
[/font][font=Times New Roman]OBJECT_STATUS[/font][font=宋体]:对象状态[/font][font=Times New Roman](VALID or INVALID)[/font]
[font=Wingdings]l
[/font][font=Times New Roman]IS_OBSOLETE[/font][font=宋体]:当子游标的数量太多的时候,指出游标是否被废弃[/font][font=Times New Roman](Y/N)[/font]
页:
[1]