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

本站中文解释

Oracle视图DBA_HIST_DATABASE_INSTANCE用于查看指定实例时期的数据库实例的性能信息。视图中的字段给出的信息可用于比较数据库实例的系统状况,便于分析系统瓶颈和确定性能优化策略。

使用DBA_HIST_DATABASE_INSTANCE,首先需要在控制台下启用AWR(Automatic Workload Repository),然后收集实例的信息,当任务完成后,即可使用该视图来查看收集的数据,以及系统的性能监控历史数据。

例如,可以使用下面的SQL语句来查询某个时期内的实例性能指标:
SELECT Instance_Number, Snap_Id, Begin_Interval_Time, SGA_Size, Begin_Disk_Reads, End_Disk_Reads, Begin_Disk_Writes, End_Disk_Writes
FROM DBA_HIST_DATABASE_INSTANCE
WHERE Begin_Interval_Time between and ;

以上SQL语句,可以用来查看某个时间段内实例的开始和结束指标,比如SGA大小、磁盘读/写IO数等信息。

官方英文解释

DBA_HIST_DATABASE_INSTANCE displays the databases and instances in the Workload Repository.

Column Datatype NULL Description

DBID

NUMBER

NOT NULL

Database ID

INSTANCE_NUMBER

NUMBER

NOT NULL

Instance number

STARTUP_TIME

TIMESTAMP(3)

NOT NULL

Startup time of the instance

PARALLEL

VARCHAR2(3)

NOT NULL

Indicates whether the instance is running in an Oracle Real Application Clusters (Oracle RAC) environment (YES) or not (NO)

VERSION

VARCHAR2(17)

NOT NULL

Database version

DB_NAME

VARCHAR2(9)

Name of the database

INSTANCE_NAME

VARCHAR2(16)

Name of the instance

HOST_NAME

VARCHAR2(64)

Name of the host

LAST_ASH_SAMPLE_ID

NUMBER

NOT NULL

Last sample ID for the active session history

PLATFORM_NAME

VARCHAR2(101)

Platform on which the instance is running

CDB

VARCHAR2(3)

Possible values are:

  • YES if the database is a CDB

  • NO if the database is not a CDB

EDITION

VARCHAR2(7)

The edition of the database.

Possible values include:

  • CORE EE: CORE Enterprise Edition

  • EE: Enterprise Edition

  • PO: Personal Edition

  • XE: Express Edition

DB_UNIQUE_NAME

VARCHAR2(30)

Unique database name

DATABASE_ROLE

VARCHAR2(16)

Current role of the database:

  • SNAPSHOT STANDBY

  • LOGICAL STANDBY
  • PHYSICAL STANDBY

  • PRIMARY

  • FAR SYNC

CDB_ROOT_DBID

NUMBER

The database ID of the CDB root for the sampled session

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

STARTUP_TIME_TZ

TIMESTAMP(3) WITH TIME ZONE

Startup time of the instance

See Also:

“DB_UNIQUE_NAME”


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