Dav_笔记2-管理自动负载存储库 之 ASH概述

生成ASH报告

ashrpt.sql SQL脚本生成一个HTML或文本报告,显示指定持续时间的ASH信息。

要生成ASH报告:

1.At the SQL prompt, enter:

@$ORACLE_HOME/rdbms/admin/ashrpt.sql

2.Specify whether you want an HTML or a text report:

Enter value for report_type: text

In this example, a text report is chosen.

3.Specify the begin time in minutes before the system date:

Enter value for begin_time: -10

In this example, 10 minutes before the current time is selected.

4.Enter the duration in minutes that the report for which you want to capture ASH information from the begin time.

Enter value for duration:

In this example, the default duration of system date minus begin time is accepted.

5.Enter a report name, or accept the default report name:

Enter value for report_name:

Using the report name ashrpt_1_0310_0131.txt

在此示例中,接受默认名称并生成名为ashrpt_1_0310_0131的ASH报告。 报告将从当前时间的前10分钟开始收集ASH信息,并在当前时间结束。

在特定数据库实例上生成ASH报告

ashrpti.sql SQL脚本生成一个HTML或文本报告,用于显示指定数据库和实例的指定持续时间的ASH信息。 通过此脚本,您可以在设置收集ASH信息的时间范围之前指定数据库和实例。

要在指定的数据库实例上生成ASH报告:

To generate an ASH report on a specified database instance:

1.At the SQL prompt, enter:

@$ORACLE_HOME/rdbms/admin/ashrpti.sql

2.Specify whether you want an HTML or a text report:

Enter value for report_type: html

In this example, an HTML report is chosen.

3.A list of available database IDs and instance numbers are displayed:

Instances in this Workload Repository schema

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DB Id Inst Num DB Name Instance Host


3309173529 1 MAIN main examp1690

3309173529 1 TINT251 tint251 samp251

Enter the values for the database identifier (dbid) and instance number (inst_num):

Enter value for dbid: 3309173529

Using 3309173529 for database id

Enter value for inst_num: 1

4.This step is applicable only if you are generating an ASH report on an Active Data Guard physical standby instance. If this is not the case, you may skip this step.

To generate an ASH report on a physical standby instance, the standby database must be opened read-only. The ASH data on disk represents activity on the primary database and the ASH data in memory represents activity on the standby database.

Specify whether to generate the report using data sampled from the primary or standby database:

You are running ASH report on a Standby database.

To generate the report over data sampled on the Primary database, enter 'P'.

Defaults to 'S' - data sampled in the Standby database.

Enter value for stdbyflag:

Using Primary (P) or Standby (S): S

In this example, the default value of Standby (S) is selected.

5.Specify the begin time in minutes before the system date:

Enter value for begin_time: -10

In this example, 10 minutes before the current time is selected.

6.Enter the duration in minutes that the report for which you want to capture ASH information from the begin time.

Enter value for duration:

In this example, the default duration of system date minus begin time is accepted.

7.Specify the slot width in seconds that will be used in the Activity Over Time section of the report:

Enter value for slot_width:

In this example, the default value is accepted. For more information about the Activity Over Time section and how to specify the slot width, see "Activity Over Time" on page 5-41.

8.Follow the instructions as explained in the subsequent prompts and enter values for the following report targets:

■target_session_id

■target_sql_id

■target_wait_class

■target_service_hash

■target_module_name

■target_action_name

■target_client_id

■target_plsql_entry

9.Enter a report name, or accept the default report name:

Enter value for report_name:

Using the report name ashrpt_1_0310_0131.txt

在此示例中,接受默认名称并生成名为ashrpt_1_0310_0131的ASH报告。 该报告将收集数据库实例上的ASH信息,数据库ID值为3309173529,从当前时间的前10分钟开始到当前时间结束。

生成Oracle RAC ASH报告

ashrpti.sql SQL脚本生成一个HTML或文本报告,用于在Oracle RAC环境中显示指定数据库和实例的指定持续时间的ASH信息。 只有写入磁盘的ASH数据才会用于生成报告。 此报告将仅使用DBA_HIST_ACTIVE_SESS_HISTORY表中找到的最近10分钟的ASH样本。

要在Oracle RAC环境中生成ASH报告,请执行以下操作:

1.At the SQL prompt, enter:

@$ORACLE_HOME/rdbms/admin/ashrpti.sql

2.Specify whether you want an HTML or a text report:

Enter value for report_type: html

In this example, an HTML report is chosen.

3.A list of available database IDs and instance numbers are displayed:

Instances in this Workload Repository schema

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DB Id Inst Num DB Name Instance Host


3309173529 1 MAIN main examp1690

3309173529 1 TINT251 tint251 samp251

3309173529 2 TINT251 tint252 samp252

3309173529 3 TINT251 tint253 samp253

3309173529 4 TINT251 tint254 samp254

Enter the values for the database identifier (dbid) and instance number (inst_num):

Enter value for dbid: 3309173529

Using database id: 3309173529

Enter instance numbers. Enter 'ALL' for all instances in an Oracle

RAC cluster or explicitly specify list of instances (e.g., 1,2,3).

Defaults to current instance.

Enter value for inst_num: ALL

Using instance number(s): ALL

4.Specify the begin time in minutes before the system date:

Enter value for begin_time: -1:10

In this example, 1 hour and 10 minutes before the current time is selected.

5.Enter the duration in minutes that the report for which you want to capture ASH information from the begin time:

Enter value for duration: 10

In this example, the duration is set to 10 minutes.

6.Specify the slot width in seconds that will be used in the Activity Over Time section of the report:

Enter value for slot_width:

In this example, the default value is accepted. For more information about the Activity Over Time section and how to specify the slot width, see "Activity Over Time" on page 5-41.

7.Follow the instructions as explained in the subsequent prompts and enter values for the following report targets:

■target_session_id

■target_sql_id

■target_wait_class

■target_service_hash

■target_module_name

■target_action_name

■target_client_id

■target_plsql_entry

8.Enter a report name, or accept the default report name:

Enter value for report_name:

Using the report name ashrpt_rac_0310_0131.txt

在此示例中,接受默认名称并生成名为ashrpt_rac_0310_0131的ASH报告。 报告将收集关于属于数据库的所有实例的ASH信息,数据库ID值为3309173529,从当前时间前1小时10分钟开始,到当前时间前1小时结束。


版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

相关推荐
若兰幽竹21 小时前
【从零开始编写数据库系统:架构设计与实现】第1章 ToyDB全景架构与核心概念
数据库·架构·数据库内核
-XWB-21 小时前
【Oracle】Oracle诊断系列(5/6):统计信息与执行计划——优化器的“大脑”管理
数据库·oracle
2401_8716965221 小时前
JavaScript中代码覆盖率Coverage在精简脚本中的应用
jvm·数据库·python
NineData21 小时前
NineData将亮相2026德国汉诺威工业博览会
运维·数据库·后端
m0_7349497921 小时前
Python GUI界面如何实现主题美化_引入ttk模块实现原生外观风格
jvm·数据库·python
m0_6784854521 小时前
如何让导航栏的下落动画效果更慢?
jvm·数据库·python
qq_4327036621 小时前
Pandas DataFrame 分组聚合中处理 JSON 列的高效方法
jvm·数据库·python
qq_4240985621 小时前
MySQL高负载下查询中断怎么解决_增加系统内存与调整参数
jvm·数据库·python
2301_7735536221 小时前
SQL中如何处理多维数据的查询:复合索引与SELECT编写
jvm·数据库·python
大江东去浪淘尽千古风流人物21 小时前
【cuVSLAM】项目解析:一套偏工程实战的 GPU 紧耦合视觉惯性 SLAM
数据库·人工智能·python·机器学习·oracle