扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
刚才Kamus说起V$TEMPSEG_USAGE这个视图,看着很眼生,我说没注意过,然后动手查一下这个东西究竟来自何方.
查询dba_objects视图,发现原来这是一个同义词。
SQL> select object_type from dba_objects OBJECT_TYPE |
再追本溯源原来V$TEMPSEG_USAGE是V_$SORT_USAGE的同义词,也就是和V$SORT_USAGE同源。
SQL> select * from dba_synonyms OWNER SYNONYM_NAME TABLE_OWNE TABLE_NAME DB_LINK |
SQL> SELECT view_definition FROM v$fixed_view_definition
|
SELECT x$ktsso.inst_id, username, username, ktssoses, ktssosno, prev_sql_addr, |
我们注意到在Oracle文档中SEGFILE#的定义为:
|
|
File number of initial extent |
在视图中,这个字段来自:x$ktsso.ktssofno .
也就是说这个字段实际上代表的是绝对文件号.
这个绝对文件号可以和<View:V$DATAFILE> . FILE# 进行联合查询.或者和TEMPFILE的绝对文件号进行联合查询.
临时文件的绝对文件号并不能从V$TEMPFILE中得到,需要从v$tempfile的底层表x$kcctf 中获得. x$kcctf.TFAFN 可以和v$sort_usage.SEGFILE#进行关联.
Kamus提醒我,在Oracle Concept手册中有这样一段话值得注意并自行阅读.
Sort Segments
One or more temporary tablespaces can be used only for sort segments. A temporary
tablespace is not the same as a tablespace that a user designates for temporary
segments, which can be any tablespace available to the user. No permanent schema
objects can reside in a temporary tablespace.
Sort segments are used when a segment is shared by multiple sort operations. One sort
segment exists for every instance that performs a sort operation in a given tablespace.
Temporary tablespaces provide performance improvements when you have multiple
sorts that are too large to fit into memory. The sort segment of a given temporary
tablespace is created at the time of the first sort operation. The sort segment expands
by allocating extents until the segment size is equal to or greater than the total storage
demands of all of the active sorts running on that instance.
收录于此,不再多做说明.
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者