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

相关推荐
Mahir0818 小时前
Redis 与 MySQL 数据同步:一致性保证的完整解决方案
数据库·redis·mysql·缓存·面试·数据一致性
2301_7693406718 小时前
如何在 Vuetify 中可靠捕获 Chip 关闭事件(包括键盘触发).txt
jvm·数据库·python
AC赳赳老秦18 小时前
供应链专员提效:OpenClaw自动跟踪物流信息、更新库存数据,异常自动提醒
java·大数据·服务器·数据库·人工智能·自动化·openclaw
灵犀学长19 小时前
基于 Spring ThreadPoolTaskScheduler + CronTrigger 实现的动态定时任务调度系统
java·数据库·spring
北秋,19 小时前
PostgreSQL(Postgres)数据库基础用法 + 数字型 + 字符型 完整联合注入实战
数据库·postgresql·开源
m0_5967490920 小时前
JavaScript中手动实现一个new操作符的底层逻辑
jvm·数据库·python
多加点辣也没关系20 小时前
Redis 的安装(详细教程)
数据库·redis·缓存
数据库小学妹20 小时前
数据库连接池避坑指南:告别“连接超时”与“资源耗尽”,让系统跑得更快!
数据库·redis·sql·mysql·缓存·dba
dishugj21 小时前
HANA 数据库备份与恢复
数据库·oracle
前进的李工21 小时前
EXPLAIN输出格式全解析:JSON、TREE与可视化
开发语言·数据库·mysql·性能优化·explain