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

本站中文解释

Oracle视图DBA_OBJECT_SIZE用于显示当前数据库中对象(表,索引,视图等)的大小信息。它通常在DBA为优化数据库性能而进行性能分析时被使用。

使用DBA_OBJECT_SIZE有以下几个步骤:

1. 连接到数据库并打开一个SQL命令提示符窗口

2. 使用 SELECT 语句从 DBA_OBJECT_SIZE 视图中检索数据库对象的大小信息,如:

SELECT segment_name, segment_type, bytes/1024/1024 AS MB FROM dba_segments;

3. 可以使用 ORDER BY 子句根据对象大小对查询结果排序,例如:

SELECT segment_name, segment_type, bytes/1024/1024 AS MB FROM dba_segments ORDER BY MB DESC;

4. 同样可以使用 WHERE 子句只查询特定类型的对象,例如:

SELECT segment_name, segment_type, bytes/1024/1024 AS MB FROM dba_segments WHERE segment_type = ‘TABLE’ ORDER BY MB DESC;

通过使用DBA_OBJECT_SIZE来查找要优化的大对象,DBA可以缩小数据库的存储空间并提高数据库性能。

官方英文解释

DBA_OBJECT_SIZE lists the sizes, in bytes, of various PL/SQL objects.

Related View

  • USER_OBJECT_SIZE lists the size of PL/SQL objects owned by the current user.

Column Datatype NULL Description

OWNER

VARCHAR2(128)

NOT NULL

Owner of the object

NAME

VARCHAR2(128)

NOT NULL

Name of the object

TYPE

VARCHAR2(18)

Type of the object: TYPE, TYPE BODY, TABLE, VIEW, SYNONYM, SEQUENCE, PROCEDURE, FUNCTION, PACKAGE, PACKAGE BODY, JAVA SOURCE, JAVA CLASS or JAVA RESOURCE

SOURCE_SIZE

NUMBER

Size of the source in bytes. Must be in memory during compilation, or dynamic recompilation.

PARSED_SIZE

NUMBER

Size of the parsed form of the object, in bytes. Must be in memory when an object is being compiled that references this object.

CODE_SIZE

NUMBER

Code size, in bytes. Must be in memory when this object is executing.

ERROR_SIZE

NUMBER

Size of error messages, in bytes. In memory during the compilation of the object when there are compilation errors.

See Also:

“USER_OBJECT_SIZE”


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