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

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

Ключ

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

...

Sv translation
languageen

If you do not need to further store the data, you can use the procedure for deleting daily TS (IWTM_DELETE_TABLESPACES). The procedure automatically deletes all the data in a tablespace, segments, and also the tablespace and data files.

Предупреждение
titleWarning!
  1. Deleting tablespaces cannot be undone. If you complete the operation, you will not be able to restore the deleted data.
  2. After removal of the tablespaces disconnected from the database (with Offline status), the data files will be kept. To free space on your hard drive, delete these files manually.
  3. IWTM_DELETE_TABLESPACES job cannot operate tablespaces which were disconnected/connected manually

As a result, this procedure will remove all the daily TS (and including information about the archived daily TS), which satisfy the following condition:

The date of creating a tablespace is less or equal to the difference between the current date and the specified time interval for deleting the tablespace.

Информация
titleNote:

If the archived daily TS cannot be restored (because the information in it was removed from the database), then you can delete the data files of the daily TS from the archive.

While the tablespaces are being deleted, the iw_deliverd, iw_dbloaderx2db, iw_updater daemons are automatically stopped. When the deletion procedure is completed, the processes will be automatically restarted. It is recommended to run the job to delete data on a daily basis. Otherwise, the amount of deleted data increases, which in turn increases the time for running the procedure and consequently increases the idle time of the Traffic Monitor Server.

Предупреждение
titleWarning!

If months or years are used as a time interval, then we recommend you to apply the maximal interval value in the counting: 31 days for a month and 366 days for a year. For example, to delete daily TS older than 4 years, specify 366*4=1464 days interval in the IWTM_DELETE_TABLESPACES job.

Setting the interval of daily TS deletion

To perform TS deletion automatically (by default the function is disabled) you can use the following scripts (run under the account of the database schema owner):

  • For daily TS storing objects with Violation status:

begin

sp_setting_set('violation_delete_enabled', 1);

sp_setting_set('violation_delete_period', D);

  commit;

end;
/ 

where:

1 indicates that authomatical deletion is enabled (to disable specify 0 instead);

D is a number of days at the end of which the daily TS will be deleted by the System.

  • For daily TS storing objects with No Violation status:

begin

  sp_setting_set('noviolation_delete_enabled', 1);

  sp_setting_set('noviolation_delete_period', D);

  commit;

end;
/ 

where:

1 indicates that automatical deletion is enabled (to disable specify 0 instead);

D is a number of days at the end of which the daily TS will be deleted by the System.

  • For daily TS storing screenshots:

begin

  sp_setting_set('other_delete_enabled', 1);

  sp_setting_set('other_delete_period', D);

  commit;

end;
/ 

where:

1 indicates that automatical deletion is enabled (to disable specify 0 instead);

D is a number of days at the end of which the daily TS will be deleted by the System.

Enabling procedure autorun according to schedule

By default, automatic deletion of daily TS is disabled. To enable the deletion of daily TS according to schedule (every day at 00 h 30 min 00 s), run the following script under the account of the database schema owner:

BEGIN

dbms_scheduler.enable('IWTM_DELETE_TABLESPACES ');

COMMIT;

END;

/

To disable procedure autorun, run the following script:

BEGIN

dbms_scheduler.disable('IWTM_DELETE_TABLESPACES');

COMMIT;

END;

/

Manual run

If you need an immediate launch of procedure for deletion of daily TS (e.g., due to file system space shortage the interval of deletion was changed, but the next launch of the job will not happen soon), run the following script:

BEGIN

dbms_scheduler.run_job('IWTM_DELETE_TABLESPACES');

END;

/

Procedure implementation using script

If you require setting up an automatic deletion of  daily TS, /opt/iw/tm5/bin/dbtools/dbconf-iwdrop-oracle.sh. script is to be used. To use it, run the following command:

Purpose
Command

Set up deletion period

/opt/iw/tm5/bin/dbconf-iwdrop-oracle.sh set violation|noviolation|other <days> [-v] 

Enable automatic deletion

/opt/iw/tm5/bin/dbconf-iwdrop-oracle.sh enable violation|noviolation|other [-v]

Disable automatic deletion

/opt/iw/tm5/bin/dbconf-iwdrop-oracle.sh disable violation|noviolation|other [-v]
Go through state of settings
/opt/iw/tm5/bin/dbconf-iwdrop-oracle.sh show [-v]

Example.

Objective: delete all the objects with "No violation" status, made in the last 15 days.

Solution: 

  1. Run the command: /opt/iw/tm5/bin/dbconf-iwdrop-oracle.sh set noviolation 15 [-v]
  2. Run the command: /opt/iw/tm5/bin/dbconf-iwdrop-oracle.sh enable noviolation [-v]