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

相关推荐
羱滒15 分钟前
sql调优之数据库开发规范
java·数据库·数据库开发
程序员Android18 分钟前
MTK多帧拍照流程分析
数据库
不剪发的Tony老师19 分钟前
Apache Doris:一款高性能的实时数据仓库
数据库·数据仓库
甜可儿30 分钟前
redis序列化设置
数据库·redis
GGBondlctrl35 分钟前
【SpringBoot】论坛项目中如何进行实现发布文章,以及更新对应数据库的数据更新
数据库·springboot项目·三层设计思想·文章发布项目
若云止水1 小时前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_init_cycle 函数 - 详解(4)
数据库·nginx·ubuntu
jay丿1 小时前
Django模板系统深入
数据库·django·sqlite
千层冷面2 小时前
Redis除了做缓存还能做什么?
数据库·redis·缓存
码有余悸3 小时前
Redis:高性能的键值存储系统
数据库·redis·缓存
剑客狼心7 小时前
Oracle:什么是存储过程
数据库·oracle