Oracle 视图 V$SORT_SEGMENT 官方解释,作用,如何使用详细说明

本站中文解释

Oracle视图V$SORT_SEGMENT提供了排序操作的所有非缓存段的信息,它用于实时显示当前用户有多少正在排序操作的非缓存段。

这些视图的结构和字段如下:

OWNER 拥有此段的用户

SPACE 该段申请的总空间

MAX_SIZE 此段中可用最大排序空间大小,如果排序段在物理存储结构中最大大小为0表示此排序段是共享的

SEGMENT_TYPE 此段的类型,如果此段是专用的,则显示PRIVATE,如果此段是共享的,则显示SHARED

ALLOCATED_EXTENTS 该段已分配的扩展数

EXTENTS 该段可用的最大扩展数

SESSION_ID 有此非缓存段的会话ID

SEGMENT_ID 排序段ID

EXTENT# 如果此部分是专用的,则返回从0开始的扩展序号,如果此段是共享的,则返回-1.

BLOCK# 如果此部分是专用的,则返回扩展的起始块号,如果此段是共享的,则返回NULL.

BLOCKS 此段可利用的块数

STATUS 此段的状态

可以使用这个视图来查询如何使用存储空间不足的系统,因为它能够显示每一个正在排序操作的段,以及这些段已分配的空间大小。可以利用这个视图了解按用户或会话ID活动的排序操作。

例如,要查看某个用户排序操作当前请求的空间,可以使用以下查询:

SELECT SESSION_ID,Owner,Space FROM V$SORT_SEGMENT WHERE Owner = ;

官方英文解释

V$SORT_SEGMENT displays information about every sort segment in a given instance. The view is only updated when the tablespace is of the TEMPORARY type.

Column Datatype Description

TABLESPACE_NAME

VARCHAR2(30)

Name of the tablespace

SEGMENT_FILE

NUMBER

File number of the first extent

SEGMENT_BLOCK

NUMBER

Block number of the first extent

EXTENT_SIZE

NUMBER

Extent size

CURRENT_USERS

NUMBER

Number of active users of the segment

TOTAL_EXTENTS

NUMBER

Total number of extents in the segment

TOTAL_BLOCKS

NUMBER

Total number of blocks in the segment

USED_EXTENTS

NUMBER

Extents allocated to active sorts

USED_BLOCKS

NUMBER

Blocks allocated to active sorts

FREE_EXTENTS

NUMBER

Extents not allocated to any sort

FREE_BLOCKS

NUMBER

Blocks not allocated to any sort

ADDED_EXTENTS

NUMBER

Number of extent allocations

EXTENT_HITS

NUMBER

Number of times an unused extent was found in the pool

FREED_EXTENTS

NUMBER

Number of deallocated extents

FREE_REQUESTS

NUMBER

Number of requests to deallocate

MAX_SIZE

NUMBER

Maximum number of extents ever used

MAX_BLOCKS

NUMBER

Maximum number of blocks ever used

MAX_USED_SIZE

NUMBER

Maximum number of extents used by all sorts

MAX_USED_BLOCKS

NUMBER

Maximum number of blocks used by all sorts

MAX_SORT_SIZE

NUMBER

Maximum number of extents used by an individual sort

MAX_SORT_BLOCKS

NUMBER

Maximum number of blocks used by an individual sort

RELATIVE_FNO

NUMBER

Relative file number of the sort segment header

TS#

NUMBER

Tablespace number

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data

IS_LOCAL_TEMP

NUMBER

Indicates whether the sort segment is allocated from a local temporary tablespace (1) or not (0).


数据运维技术 » Oracle 视图 V$SORT_SEGMENT 官方解释,作用,如何使用详细说明