Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMAG and version 7.15
Sv translation
languageru

Для анализа загруженности ежедневных табличных пространств (ЕТП) вы можете использовать скрипт /opt/iw/tm5/bin/dbtools/tablespace_stat_postgres/tablespace_stat_postgres.sh . С его помощью вы можете получить статистику по содержимому ТП за выбранный период. Скрипт выполняет один из шести сценариев, и в каждом собирается различная информация. Подробнее сценарии описаны ниже.

Чтобы вывести информацию об использовании скрипта:

  1. Перейдите в директорию, где располагается скрипт, с помощью команды:
    cd /opt/iw/tm5/bin/dbtools/tablespace_stat_postgres/
  2. Запустите скрипт без указания параметров, выполнив команду:
    ./tablespace_stat_postgres.sh

В результате будет выведена справочная информация:

Чтобы использовать скрипт:

  1. Перейдите в директорию, где располагается скрипт, выполнив команду:
    cd /opt/iw/tm5/bin/dbtools/tablespace_stat_postgres/
  2. Запустите скрипт с помощью команды:
    ./tablespace_stat_postgres.sh <номер_сценария> <-e>
    где номер сценария задается цифрой от 1 до 6;
    -e или --export – это ключ, который вы можете указать, чтобы выгрузить результаты работы скрипта в .csv формате CSV.
    Пример команды запуска скрипта:
    ./tablespace_stat_postgres.sh 1
  3. Укажите параметры в зависимости от сценария:
    • Для для сценариев 1, 2, 4, 5, 6 – период, за который нужно вывести статистику:
      1. Введите нижнюю границу периода в формате dd.mm.yyyy и нажмите Enter;.
      2. Введите верхнюю границу и нажмите Enter;.

        Информация
        titleПримечание:

        Если не вводить значения для границ периода и нажать Enter дважды, то по умолчанию будет выведена статистика за последние две недели.
        Если задать только нижнюю границу, то будет выведена информация за период с указанной даты до текущей.

    • Для для сценария 3 – ID табличного пространства;
    • Для для сценария 6 – ID сотрудника.

В случае выгрузки результатов выполнения скрипта файл будет сохранен в директории, где находится скрипт, и будет иметь имя:
report_<название сценария>_<дата>.csv
где <название сценария> имеет значение в зависимости от номера сценария:

Номер сценария

Название сценария

Краткое описание

1

tbs_stat_period

Статистика за период времени.

2

tbs_stat_period_count

Статистика за период времени с указанием количества событий в ТП.

3

tbs_stat_by_tbs_id

Статистика по конкретному ТП.

4

tbs_stat_by_event_type

Статистика по типам событий за период.

5

tbs_stat_by_persons

Статистика по топ-10 сотрудников.

6

tbs_stat_by_person_id

Статистика по конкретной персоне.

<дата> - – дата выполнения скрипта. Имеет формат <год-месяц-день_часы-минуты-секунды>.
Пример имени файла выгрузки: report_tbs_stat_period_count_2024-12-17_18-20-39.csv

Якорь
scenarios
scenarios
Сценарии работы скрипта

Сценарий 1

В результате выполнения сценария 1 будет выведена статистика по месту, занимаемому в базе данных (БД) табличными пространствами, за указанный период времени.

В столбцах будет указана следующая информация:

tbs_type

Тип ТП:

0 - – Без нарушения;

1 - – Нарушение;

2 - – Другой (снимки экрана).

part_date

Дата создания ТП.

tbs_size

Размер ТП.

avg_tbs_size

Средний размер ТП за указанный период времени.

Сценарий 2

В результате выполнения сценария 2 будет выведена более подробная статистика по ТП за указанный период.

В столбцах будет указана следующая информация:

tbs_id

Идентификационный номер (ID) ТП.

part_date

Дата создания ТП.

tbs_type

Тип ТП:

0 - – Без нарушения;

1 - – Нарушение;

2 - – Другой (снимки экрана).

tbs_status

Статус ТП:

0 - – online (подключено, в нормальном состоянии);
3 - – read only (только для чтения);
5 - – before exchange (перед отключением для архивации);
7 - – prepared offline (подготовлено к отключению для архивации);
9 - – disconnected (отключено перед перемещением в архив);
10 - – offline (архивировано и отключено);
11 - – plugged (подключено перед восстановлением);
13 - – before update (перед обновлением для восстановления);
15 - – after update (после обновления для восстановления);
17 - – before revert (перед восстановлением из архива);
20 - – restored (восстановлено из архива).

count_objects

Количество событий в ТП.

tbs_size

Размер ТП.

Сценарий 3

В результате выполнения сценария 3 будет выведена статистика по конкретному ТП.

В столбцах будет указана следующая информация:

type_name

Тип событий.

tbs_size

Общий размер событий указанного типа в ТП.

Сценарий 4

В результате выполнения сценария 4 будет выведена статистика по типам событий за указанный период.

В столбцах будет указана следующая информация:

object_type

Тип событий.

objects_size

Общий размер событий указанного типа.

count_objects

Количество событий указанного типа.

max_objects_in_hour

Максимальное количество событий в час в течение дня.

Сценарий 5

В результате выполнения сценария 5 будет выведена статистика по топ-10 сотрудников, события с участием которых занимают наибольшее место в БД, за указанный период времени.

В столбцах будет указана следующая информация:

person_id

Идентификационный номер (ID) сотрудника.

display_name

Отображаемое имя (ФИО) сотрудника.

object_count

Количество событий.

objects_size

Общий размер событий с участием сотрудника.

Сценарий 6

В результате выполнения сценария 6 будет выведена статистика по конкретному сотруднику за указанный период времени.

В столбцах будет указана следующая информация:

object_type

Тип событий.

object_count

Количество событий.

objects_size

Общий размер событий с участием сотрудника.

Sv translation
languageen

To analyze a load of daily tablespaces, you can use the /opt/iw/tm5/bin/dbtools/tablespace_stat_postgres/tablespace_stat_postgres.sh script. With its help, you can get the statistics on TBS content for the selected period. The script executes one of the six scenarios and in each case it collects different information. The scenarios are described in more detail below.

To display the information on the script usage:

  1. Go to the directory where the script is located by running the command:
    cd /opt/iw/tm5/bin/dbtools/tablespace_stat_postgres/
  2. Run the script without parameters by running the command:
    ./tablespace_stat_postgres.sh

As a result, you will see the help information:

To use the script:

  1. Go to the directory where the script is located by running the command:
    cd /opt/iw/tm5/bin/dbtools/tablespace_stat_postgres/
  2. Run the script by running the command:
    ./tablespace_stat_postgres.sh <scenario_number> <-e>
    where the scenario number is a digit from 1 to 6;
    -e or --export is a key that you can specify to unload the results of script execution in .csv format.
    Example of a command running the script:
    ./tablespace_stat_postgres.sh 1
  3. Specify the parameters depending on a scenario:
    • For scenarios 1, 2, 4, 5, 6 – a period for which the statistics should be displayed:
      1. Specify the lower bound of the period in the dd.mm.yyyy format and press Enter;
      2. Specify the upper bound and press Enter;

        Информация
        titleNote:
        If you do not specify values for bounds and just press Enter twice then, by default, statistics for last two weeks will be displayed.
        If you specify only the lower bound then information for the period from the specified date to the current one will be displayed.
    • For scenario 3 – ID of the tablespace;
    • For scenario 6 – person’s ID.

In case of unloading the results of script performing, the file is saved in the directory where the script is located. The file has the following name:
report_<scenario_name>_<date>.csv
where <scenario_name> has a value depending on the scenario number:

Scenario number

Scenario name

Short description

1

tbs_stat_period

Statistics for the period of time

2

tbs_stat_period_count

Statistics for the period of time including count of events in TBS

3

tbs_stat_by_tbs_id

Statistics on a particular TBS

4

tbs_stat_by_event_type

Statistics on event types for the period

5

tbs_stat_by_persons

Statistics on top-10 persons

6

tbs_stat_by_person_id

Statistics on a particular person

<date> - date of script execution. It has the <yyyy-mm-dd_HH-mm-ss> format.
Example of the unloading file name: report_tbs_stat_period_count_2024-12-17_18-20-39.csv

Якорь
scenarios
scenarios
Scenarios of script execution

Scenario 1

As a result of scenario 1 execution, statistics on space that tablespaces take up in DB for the period of time will be displayed.

The following information will be shown in columns:

tbs_type

TBS type:

0 - No Violations;

1 - Violation;

2 - Other (screenshots).

part_date

Date of TBS creation

tbs_size

TBS size

avg_tbs_size

Average TBS size for the specified period of time

Scenario 2

As a result of scenario 2 execution, more detailed statistics on tablespaces for the period of time will be displayed.

The following information will be shown in columns:

tbs_id

TBS ID

part_date

Date of TBS creation

tbs_type

TBS type:

0 - No Violations;

1 - Violation;

2 - Other (screenshots).

tbs_status

TBS status:

0 - online (connected, in normal state);
3 - read only (only for reading);
5 - before exchange (before disconnecting for archiving);
7 - prepared offline (prepared to be disconnected for archiving);
9 - disconnected (disconnected before moving to archive);
10 - offline (archived and disconnected);
11 - plugged (plugged in before restoration);
13 - before update (before updating for restoration);
15 - after update (after updating for restoration);
17 - before revert (before restoring from archive);
20 - restored (restored from archive).

count_objects

Count of events in a TBS

tbs_size

TBS size

Scenario 3

As a result of scenario 3 execution, statistics on a particular TBS will be displayed.

The following information will be shown in columns:

type_name

Event type

tbs_size

Overall size of the events of the particular type in TBS

Scenario 4

As a result of scenario 4 execution, statistics on event types for the specified period of time will be displayed.

The following information will be shown in columns:

object_type

Event type

objects_size

Overall size of the events of the particular type

count_objects

Count of the events of the particular type

max_objects_in_hour

Maximum count of events per hour during the day

Scenario 5

As a result of scenario 5 execution, statistics on top-10 persons for the specified period of time will be displayed. Events with participation of top-10 persons take up the largest space in DB.

The following information will be shown in columns:

person_id

Person ID

display_name

Person display name

object_count

Count of events

objects_size

Overall size of the events with participation of the person

Scenario 6

As a result of scenario 6 execution, statistics on particular person for the specified period of time will be displayed.

The following information will be shown in columns:

object_type

Event type

object_count

Count of events

objects_size

Overall size of the events with participation of the person