UiPath Documentation
automation-suite
2024.10
false
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

EKS/AKS の Automation Suite のインストール ガイド

データベースのメンテナンスを実行する

データベースが乱雑にならないようにすることが重要です。 このためには、以下の操作を実行することをお勧めします。

SQL サーバーのメンテナンスソリューションを使用する

SQL サーバーのメンテナンスソリューションは、バージョン 2005 以降のすべてのバージョンの Microsoft SQL サーバーについてバックアップ、完全性チェック、インデックス、統計のメンテナンスを行います。詳しくは、 こちらの GitHub プロジェクトをご覧ください。

データベースをバックアップする

SQL サーバーのデータベースは、週 1 回の完全バックアップや毎日の差分バックアップなど、定期的にバックアップすることを推奨します。

さらに、この場所でスクリプトを使用して作成した DatabaseBackup 保存プロシージャを利用することを推奨します。

古いデータを定期的に削除する

共有されるスイート機能

削除する項目をあらかじめ保存しておくデータベースを別に作成しておきます。そうすることで、そのデータベースは監査などのために保存しておく必要がある項目のアーカイブとして機能します。

  1. たとえば、UiPathArchives という新しいデータベースを作成します。

    create database UiPathArchives
    create database UiPathArchives
    
  2. 次のバックアップ表を作成します。

    AuditEvent 表と同じ構造の ArchiveAuditEvent

    SELECT * INTO [UiPathArchives].[dbo].[ArchiveAuditEvent] from [AutomationSuite_Platform].[adt].[AuditEvent] where 1 = 2
    SELECT * INTO [UiPathArchives].[dbo].[ArchiveAuditEvent] from [AutomationSuite_Platform].[adt].[AuditEvent] where 1 = 2
    
  3. データをアーカイブします。

    監査イベント レコードをアーカイブするには、次のスクリプト例を使用します。

       DECLARE @NumberOfDaysToKeep INT
       DECLARE @CurrentDate DATETIME
    
       -- Specify the number of days
       SET @NumberOfDaysToKeep = 60
       -- Archive the list of audit event records that you want to delete
       SET @CurrentDate = GetDate()
       BEGIN TRANSACTION
       INSERT INTO [UiPathArchives].[dbo].[ArchiveAuditEvent]
       SELECT
       [Id],[CreatedOn],[Version],[OrganizationId],[Source],[Category],[Action],[IsUserEvent],
       [UserId],[FullName],[Email],[DetailsVersion],[Details],[OperationId]
       FROM [adt].[AuditEvent]
       WHERE DateDiff(day, CreatedOn, @CurrentDate) > @NumberOfDaysToKeep
       -- Delete the audit events
       DELETE FROM [adt].[AuditEvent]
       WHERE EXISTS (SELECT 1 FROM [UiPathArchives].[dbo].[ArchiveAuditEvent] WHERE Id = [adt].[AuditEvent].[Id])
       COMMIT TRANSACTION
       DECLARE @NumberOfDaysToKeep INT
       DECLARE @CurrentDate DATETIME
    
       -- Specify the number of days
       SET @NumberOfDaysToKeep = 60
       -- Archive the list of audit event records that you want to delete
       SET @CurrentDate = GetDate()
       BEGIN TRANSACTION
       INSERT INTO [UiPathArchives].[dbo].[ArchiveAuditEvent]
       SELECT
       [Id],[CreatedOn],[Version],[OrganizationId],[Source],[Category],[Action],[IsUserEvent],
       [UserId],[FullName],[Email],[DetailsVersion],[Details],[OperationId]
       FROM [adt].[AuditEvent]
       WHERE DateDiff(day, CreatedOn, @CurrentDate) > @NumberOfDaysToKeep
       -- Delete the audit events
       DELETE FROM [adt].[AuditEvent]
       WHERE EXISTS (SELECT 1 FROM [UiPathArchives].[dbo].[ArchiveAuditEvent] WHERE Id = [adt].[AuditEvent].[Id])
       COMMIT TRANSACTION
    

    古いデータは、次のクエリを使用すると、削除される前にこれらのアーカイブにコピーされます。

  4. テーブルからデータを削除します。

    重要:

    次のスクリプトを実行する前に、使用する環境に合わせて変更してください。

    監査イベント:

       declare @NumberOfDaysToKeep int
       declare @CurrentDate datetime
    
       -- Specify the number of days
       SET @NumberOfDaysToKeep = 60
       -- Create temporary table with the list of audit event records that you want to delete
       SET @CurrentDate = GetDate()
       SELECT
       [Id],[CreatedOn],[Version],[OrganizationId],[Source],[Category],[Action],[IsUserEvent],
       [UserId],[FullName],[Email],[DetailsVersion],[Details],[OperationId]
       INTO #TempAuditRecordsToDelete
       FROM [adt].[AuditEvent]
       WHERE DateDiff(day, CreatedOn, @CurrentDate) > @NumberOfDaysToKeep
       -- Review the audit event records to be deleted
       SELECT * FROM #TempAuditRecordsToDelete
       -- Delete the audit events
       BEGIN TRANSACTION
       DELETE FROM [adt].[AuditEvent]
       WHERE EXISTS (SELECT 1 FROM #TempAuditRecordsToDelete WHERE Id = [adt].[AuditEvent].[Id])
       DROP TABLE #TempAuditRecordsToDelete
       COMMIT TRANSACTION
       declare @NumberOfDaysToKeep int
       declare @CurrentDate datetime
    
       -- Specify the number of days
       SET @NumberOfDaysToKeep = 60
       -- Create temporary table with the list of audit event records that you want to delete
       SET @CurrentDate = GetDate()
       SELECT
       [Id],[CreatedOn],[Version],[OrganizationId],[Source],[Category],[Action],[IsUserEvent],
       [UserId],[FullName],[Email],[DetailsVersion],[Details],[OperationId]
       INTO #TempAuditRecordsToDelete
       FROM [adt].[AuditEvent]
       WHERE DateDiff(day, CreatedOn, @CurrentDate) > @NumberOfDaysToKeep
       -- Review the audit event records to be deleted
       SELECT * FROM #TempAuditRecordsToDelete
       -- Delete the audit events
       BEGIN TRANSACTION
       DELETE FROM [adt].[AuditEvent]
       WHERE EXISTS (SELECT 1 FROM #TempAuditRecordsToDelete WHERE Id = [adt].[AuditEvent].[Id])
       DROP TABLE #TempAuditRecordsToDelete
       COMMIT TRANSACTION
    

Identity Server

削除する項目をあらかじめ保存しておくデータベースを別に作成しておきます。そうすることで、そのデータベースは監査などのために保存しておく必要がある項目のアーカイブとして機能します。

注:

このセクションに記載されているデータベースのメンテナンス スクリプトは、オンプレミスの SQL Server を使用する場合にのみサポートされます。Azure SQL では機能しません。Automation Suite のデプロイで Azure SQL を使用している場合は、このスクリプトを実行しないでください。

  1. たとえば、UiPathIdentityArchives という新しいデータベースを作成します。

    create database UiPathIdentityArchives
    create database UiPathIdentityArchives
    
  2. 次のバックアップ表を作成します。

    UserLoginAttempts 表と同じ構造の ArchiveLoginAttempts

    select * into [UiPathIdentityArchives].[dbo].[ArchiveUserLoginAttempts] from [AutomationSuite_Platform].[identity].[UserLoginAttempts] where 1=2
    select * into [UiPathIdentityArchives].[dbo].[ArchiveUserLoginAttempts] from [AutomationSuite_Platform].[identity].[UserLoginAttempts] where 1=2
    

    古いデータは、次のクエリを使用すると、削除される前にこれらのアーカイブにコピーされます。

  3. テーブルからデータを削除します。

    重要:

    次のスクリプトを実行する前に、使用する環境に合わせて変更してください。

    たとえば、60 日を経過したログイン試行を削除するには、次のクエリを使用します。手動で実行することも、SQL Server ジョブでスケジュール設定することもできます。

    declare @NumberOfDaysToKeep int
    set @NumberOfDaysToKeep = 60
    if OBJECT_ID('[UiPathIdentityArchives].[dbo].[UserLoginAttemps]') = NULL 
      begin select * into [UiPathIdentityArchives].[dbo].[UserLoginAttemps] from [identity].UserLoginAttempts where 1=2 end
    begin transaction
      set identity_insert [UiPathIdentityArchives].[dbo].[UserLoginAttemps] on
      insert into [UiPathIdentityArchives].[dbo].[UserLoginAttemps] ([Id],[PartitionId],[UserId],[UserNameOrEmailAddress],[ClientIpAddress],[ClientName],[BrowserInfo],[Result],[CreationTime],[AuthenticationProvider],[PartitionName])
        select [Id],[PartitionId],[UserId],[UserNameOrEmailAddress],[ClientIpAddress],[ClientName],[BrowserInfo],[Result],[CreationTime],[AuthenticationProvider],[PartitionName]
          from [identity].UserLoginAttempts where DateDiff(day, CreationTime, GetDate()) > @NumberOfDaysToKeep
      delete from [identity].UserLoginAttempts where DateDiff(day, CreationTime, GetDate()) > @NumberOfDaysToKeep
    commit transaction
    declare @NumberOfDaysToKeep int
    set @NumberOfDaysToKeep = 60
    if OBJECT_ID('[UiPathIdentityArchives].[dbo].[UserLoginAttemps]') = NULL 
      begin select * into [UiPathIdentityArchives].[dbo].[UserLoginAttemps] from [identity].UserLoginAttempts where 1=2 end
    begin transaction
      set identity_insert [UiPathIdentityArchives].[dbo].[UserLoginAttemps] on
      insert into [UiPathIdentityArchives].[dbo].[UserLoginAttemps] ([Id],[PartitionId],[UserId],[UserNameOrEmailAddress],[ClientIpAddress],[ClientName],[BrowserInfo],[Result],[CreationTime],[AuthenticationProvider],[PartitionName])
        select [Id],[PartitionId],[UserId],[UserNameOrEmailAddress],[ClientIpAddress],[ClientName],[BrowserInfo],[Result],[CreationTime],[AuthenticationProvider],[PartitionName]
          from [identity].UserLoginAttempts where DateDiff(day, CreationTime, GetDate()) > @NumberOfDaysToKeep
      delete from [identity].UserLoginAttempts where DateDiff(day, CreationTime, GetDate()) > @NumberOfDaysToKeep
    commit transaction
    

Orchestrator の

Orchestrator データベースから古いデータを定期的に削除する方法の詳細については、「 Orchestrator データベースをクリーンアップする」をご覧ください。

Automation Hub

Automation Hub は、実行時のビューやダッシュボードを履歴データに依存しています。また、その性質上、古いデータをクリーンアップするという概念はありません。 他のサービスと同様に、Automation Hub データベースは、週 1 回の完全バックアップや毎日の差分バックアップなどの方法で定期的にバックアップすることをお勧めします。

Process Mining

Automation Suite の Process Mining には自動データベース クリーンアップ機能が組み込まれており、最適な効率とパフォーマンスを確保します。 これにより、不要なデータを定期的に削除し、リソースを解放するための手動操作を必要とせずに、データベースをクリーンアップして機能させることができます。

Task Mining

Task Mining データベースから古いデータを定期的に削除する方法の詳細については、「 Task Mining データベースをクリーンアップする」をご覧ください。

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得