Assets - How to delete Object History logs

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

アトラシアン サポートの提供について

The following approaches that involves SQL queries are beyond Atlassian Support Offerings. Please note that Atlassian does not support direct database INSERT, UPDATE or DELETE queries, as they can easily lead to data integrity problems. Atlassian will not be held liable for any errors or other unexpected events resulting from the use of the following SQL queries.

目的

Remove Object's History logs is not possible through Assets UI. This is how to perform this action using Database queries.

This has been recorded as an improvement area for Assets:

JSDSERVER-8706 - 課題情報を取得中... ステータス

Until the product improvement is in place this Article intends to describe a way of removing Object's History records.

環境

Assets management

ソリューション

はじめる前に

データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。


Table AO_8542F1_IFJ_OBJ_HIST is where all the History values are stored for existing Objects. To verify all of the affected entries, and the database structure for further tweaks, run a select query against the object that you're looking to remove history from:

You can specify the criteria for the deletion of rows, for example - any History row/entry created before December 31st 2020:
SELECT * FROM "AO_8542F1_IFJ_OBJ_HIST" 
WHERE "OBJECT_ID" = XXX;

To remove the history logs, we have 2 options, one to remove by date older than, or by specifying an object ID:

You can specify the criteria for the deletion of rows, for example - any History row/entry created before December 31st 2020:
DELETE FROM "AO_8542F1_IFJ_OBJ_HIST" 
WHERE "CREATED" < '2020-12-31 00:00:00.0';

または

If you want to delete History per specific Object, where xxx is the Object ID of the object you wish to delete History for:
DELETE FROM "AO_8542F1_IFJ_OBJ_HIST" 
WHERE "OBJECT_ID" = XXX;

The Object ID is the numeric part of the Object Key, and will also show in the Object URL when you navigate to the Object

これは PostgreSQL でテスト済みです。Oracle や SQL Server などの他の DBMS では変更が必要になる可能性があります。

Deleting History entries will only remove the History records from the Object, no other part/functionality in Assets should be affected by removing the Object's History

If using PostgreSQL, you must run the VACUUM FULL command to avoid the deleted data to keep using the Table's space. It is most recommended when performing some huge updates, as mentioned on Optimize and Improve PostgreSQL Performance with VACUUM, ANALYZE, and REINDEX





最終更新日 2024 年 4 月 8 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.