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 版权协议,转载请附上原文出处链接和本声明。

相关推荐
WangYaolove13148 分钟前
请解释Python中的装饰器是什么?如何使用它们?
linux·数据库·python
我是黄大仙29 分钟前
利用飞书多维表格自动发布版本
运维·服务器·数据库·飞书
曾经的三心草29 分钟前
Mysql之约束与事件
android·数据库·mysql·事件·约束
WuMingf_37 分钟前
redis
数据库·redis
张某布响丸辣44 分钟前
SQL中的时间类型:深入解析与应用
java·数据库·sql·mysql·oracle
脸ル粉嘟嘟1 小时前
常用命令之Linux&Oracle&Hive&Python
linux·hive·oracle
P.H. Infinity2 小时前
【RabbitMQ】10-抽取MQ工具
数据库·分布式·rabbitmq
zgscwxd2 小时前
thinkphp6 --数据库操作 增删改查
数据库·thinkphp6
代码小鑫2 小时前
A031-基于SpringBoot的健身房管理系统设计与实现
java·开发语言·数据库·spring boot·后端