oracle 12c pdb版本,如何在Oracle 12.2或更高版本上为PDB级别创建AWR?

该文档详细介绍了如何在Oracle 12.2及以上版本的多租户环境中,在PDB级别启用并创建Automatic Workload Repository (AWR)报告。步骤包括设置awr_pdb_autoflush_enabled参数、调整快照间隔、设置AWR_SNAPSHOT_TIME_OFFSET以避免性能问题,并展示了如何生成和查看AWR报告。
摘要由CSDN通过智能技术生成

这是12.2或更高版本的新功能。

Oracle Database Performance Tuning Guide

12c Release 2 (12.1)

6.2.7 Managing Automatic Workload Repository in a Multitenant Environment

可以按照以下详细步骤在PDB级别启用和创建AWR报告。

1) 在PDB级别设置awr_pdb_autoflush_enabled=true:

alter session set container=PDB1;

alter system set awr_pdb_autoflush_enabled=true;

wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

2) 正确设置AWR快照

select * from cdb_hist_wr_control;

DBID SNAP_INTERVAL RETENTION TOPNSQL CON_ID

2580889417 +40150 00:01:00.0 +00008 00:00:00.0 DEFAULT 3

execute dbms_workload_repository.modify_snapshot_settings(interval => 60);

select * from cdb_hist_wr_control;

DBID SNAP_INTERVAL RETENTION TOPNSQL CON_ID

2580889417 +00000 01:00:00.0 +00008 00:00:00.0 DEFAULT 3

wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

3) 另请将AWR_SNAPSHOT_TIME_OFFSET设置为1000000,以避免多个PDB同时创建快照时出现性能问题。

Oracle Database 12c Release 2

Database Reference

1.26 AWR_SNAPSHOT_TIME_OFFSET

alter system set AWR_SNAPSHOT_TIME_OFFSET=1000000 scope=both;

wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

AWR_SNAPSHOT_TIME_OFFSET

AWR_SNAPSHOT_TIME_OFFSET specifies an offset for the Automatic Workload Repository (AWR) snapshot start time.

Property

Description

Parameter type

Integer

Default value

There is no offset by default.

Modifiable

ALTER SYSTEM

Modifiable in a PDB

No

Range of values

0 - 3599, or the special value 1000000

Basic

No

Oracle RAC

Multiple instances should use the same value

AWR snapshots normally start at the top of the hour (12:00, 1:00, 2:00, and so on). This parameter allows DBAs to specify an offset for the AWR snapshot start time.

This is a useful parameter to avoid CPU spikes from multiple instances all starting their AWR snapshots at the same time. If you have a large system with many instances on it (like many Exadata installations), and you are experiencing such CPU spikes, this parameter can be very useful.

The parameter is specified in seconds. Normally, you set it to a value less than 3600. If you set the special value 1000000 (1,000,000), you get an automatic mode, in which the offset is based on the database name.

The automatic mode is an effective way of getting a reasonable distribution of offset times when you have a very large number of instances running on the same node.

4) 等待1-2小时以自动生成快照:

select * from awr_pdb_snapshot;

或者您可以手动创建快照:

SQL> connect / as sysdba

SQL> alter session set container=PDB1;

SQL> exec dbms_workload_repository.create_snapshot();

创建AWR报告:

@?/rdbms/admin/awrrpt

Specify the location of AWR Data

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

AWR_ROOT - Use AWR data from root (default)

AWR_PDB - Use AWR data from PDB    ** Use the location AWR_PDB for a PDB level report

wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

5)参考文档

如何在12.2或更高版本的PDB级别创建AWR报告 (文档 ID 2469637.1).docx

wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值