Estimating AWR and SYSAUX size

Olá pessoal, hoje vamos ver aqui como consultar o tamanho de cada componente do AWR e como estimar o tamanho do AWR.

Hi everyone, today we will see how to query the size of each AWR component and how to estimate AWR size.

Vamos só esclarecer um ponto primeiro… AWR significa Automatic Workload Repository, que é um repositório de dados referente à carga do ambiente. Podemos gerar um relatório desse repositório para analisar mudanças na carga de trabalho, mas não é isto que faremos aqui. Para saber mais sobre o AWR e o relatório do AWR você pode consultar este artigo.

First, let me clear a thing… AWR means Automatic Workload Repository, which is a data repository regarding to environment’s workload. We can generate a report of the repository to analyze changes in the workload, but that is not what we are doing here. If you want to know more about the AWR and AWR Report you can read this post.

AWR Architecture

Conteúdo do AWR / AWR contents

Vamos agora verificar como consultar o conteúdo do AWR de maneira fácil. Para isso a Oracle fornece um script chamado awrinfo.sql e ele já é padrão em todas as instalações.

Let us check now how to easily query AWR contents. To do that Oracle provides a simple script called awrinfo.sql and it comes by default in every installation.

Podemos executá-lo da seguinte maneira através do SQL*Plus:

We can run it directly from SQL*Plus:

SQL> @?/rdbms/admin/awrinfo

This script will report general AWR information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Specify the Report File Name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrinfo.txt.  To use this name,
press <return> to continue, otherwise enter an alternative.

Enter value for report_name:

Using the report name awrinfo.txt
No errors.
No errors.
~~~~~~~~~~~~~~~
AWR INFO Report
~~~~~~~~~~~~~~~

******demais linhas do output omitidas******
******other output lines omitted******

Se você não informar nenhum nome específico para o relatório ele será gerado com o nome padrão awrinfo.txt.

If you do not provide any specific name for the report it will be generated with the default name awrinfo.txt.

Este relatório possui várias seções referentes ao conteúdo do AWR:

This report has many sections regarding AWR contents:

(I) AWR Snapshots Information
(1a) SYSAUX usage - Schema breakdown (dba_segments)
(1b) SYSAUX occupants space usage (v$sysaux_occupants)
(1c) SYSAUX usage - Unregistered Schemas
(1d) SYSAUX usage - Unaccounted space in registered schemas
(2) Size estimates for AWR snapshots
(3a) Space usage by AWR components (per database)
(3b) Space usage within AWR Components (> 500K)
(4) Space usage by non-AWR components (> 500K)
(5a) AWR snapshots - last 50
(5b) AWR snapshots with errors or invalid
(5c) AWR snapshots -- OLDEST Non-Baselined snapshots
(6) AWR Control Settings - interval, retention
(7a) AWR Contents - row counts for each snapshots
(7b) AWR Contents - average row counts per snapshot
(7c) AWR total item counts - names, text, plans
(II) Advisor Framework Info
(1) Advisor Tasks - Last 50
(2) Advisor Task - Oldest 5
(3) Advisor Tasks With Errors - Last 50
(III) ASH Usage Info
(1a) ASH histogram (past 3 days)
(1b) ASH histogram (past 1 day)
(2a) ASH details (past 3 days)
(2b) ASH details (past 1 day)
(2c) ASH sessions (Fg Vs Bg) (past 1 day across all instances in RAC)

Veja aqui neste link o relatório gerado como exemplo para este artigo.

Click this link to see the report generated as an example for this article.

Estimando o tamanho do AWR e da tablespace SYSAUX / Estimating AWR and SYSAUX tablespace size

Vimos como gerar o relatório para consultar o conteúdo do AWR, agora vamos ver como estimar o tamanho do AWR conforme nossas especificações.

We just saw how to generate the report to query AWR contents and now we are going to see how to estimate AWR size based on our specification.

Este script também gera um relatório e também está presente por padrão em todas as instalações do Oracle Database.

This script also generates a report and it also comes by default in any Oracle Database installation.

Para gerar o relatório executamos o seguinte script via SQL*Plus:

To generate the report we can execute the following script via SQL*Plus:

SQL> @?/rdbms/admin/utlsyxsz


This script estimates the space required for the SYSAUX tablespace.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
******demais linhas do output omitidas******
******other output lines omitted******

Você vai ver que precisa fornecer alguns dados de acordo com suas necessidades para que a estimativa seja mais precisa.

You will see that you have to provide some data regarding your needs for the estimates to be more precise.

Os dados que você precisa informar são:

Those input data are the following:

~~~~~~~~~~~~~~~~~~~~
AWR Space Estimation
~~~~~~~~~~~~~~~~~~~~

| To estimate the size of the Automatic Workload Repository (AWR)
| in SYSAUX, we need the following values:
|
|     - Interval Setting (minutes)
|     - Retention Setting (days)
|     - Number of Instances
|     - Average Number of Active Sessions
|     - Number of Datafiles

Um output como este será gerado:

Some output like this will be generated:

| ***************************************************
| Estimated size of AWR:                   2,145.6 MB
|
|   The AWR estimate was computed using
|   the following values:
|
|            Interval -        15 minutes
|           Retention -     30.00 days
|       Num Instances -         1
|     Active Sessions -     12.00
|           Datafiles -         5
| ***************************************************

Você também pode estimar o tamanho do histórico de estatísticas (Statistics History) informando mais alguns dados:

Then you can estimate also the size of Statistics History providing some more data:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Optimizer Stat History Space Estimation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

| To estimate the size of the Optimizer Statistics History
| we need the following values:
|
|     - Number of Tables in the Database
|     - Number of Partitions in the Database
|     - Statistics Retention Period (days)
|     - DML Activity in the Database (level)

O output será similar a este:

The output will be similar to this:

| ***************************************************
| Estimated size of Stats history             21.9 MB
|
|   The space for Optimizer Statistics history was
|   estimated using the following values:
|
|                         Tables -      88
|                        Indexes -     100
|                        Columns -     990
|                     Partitions -       0
|          Indexes on Partitions -       0
|          Columns in Partitions -       0
|        Stats Retention in Days -      31
|          Level of DML Activity -  Medium
| ***************************************************

E por fim o relatório estará pronto de acordo com o nome informado.

In the end the report will be ready according to the provided name.

Confira o relatório usado neste exemplo aqui.

Check the report used in this article here.

Espero que tenham gostado, por hoje é só.

I hope you like it, that is all for today.

Franky