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

相关推荐
ivanfor66632 分钟前
多租户架构的三级权限体系:设计逻辑与精准控制实现
java·开发语言·数据库
TDengine (老段)2 小时前
TDengine IDMP 重塑智慧水务运营(内附 Step by Step 步骤)
大数据·数据库·物联网·时序数据库·iot·tdengine·涛思数据
LSL666_5 小时前
1 概述及简单登录(不涉及数据库)
数据库·servlet
q***06478 小时前
MySQL的UPDATE(更新数据)详解
数据库·mysql
8***B8 小时前
MySQL性能
数据库·mysql
q***72198 小时前
oracle使用PLSQL导出表数据
数据库·oracle
数据库生产实战8 小时前
Oracle DG备库日志切换解析,Private strand flush not complete如何理解?(基础知识)
数据库·oracle
百***75748 小时前
从 SQL 语句到数据库操作
数据库·sql·oracle
i***39588 小时前
SQL 注入详解:原理、危害与防范措施
数据库·sql·oracle
m***56729 小时前
Win10下安装 Redis
数据库·redis·缓存