Orchestrator
2021.10
バナーの背景画像
Orchestrator インストール ガイド
最終更新日 2024年4月19日

メンテナンスに関する考慮事項

Identity Server のパフォーマンス低下や障害を防ぐためにデータベースをメンテナンスすることは重要です。そのために、次のことが推奨されます。

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

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

アーカイブ データベースの作成

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

  1. たとえば、UiPathIdentityArchives という新しいデータベースを作成します。
    create database UiPathIdentityArchivescreate database UiPathIdentityArchives
  2. 次のバックアップ表を作成します。

    1. UserLoginAttempts 表と同じ構造の ArchiveLoginAttempts
      select * into [UiPathIdentityArchives].[dbo].[ArchiveUserLoginAttempts] from [UiPath].[dbo].[UserLoginAttempts] where 1=2select * into [UiPathIdentityArchives].[dbo].[ArchiveUserLoginAttempts] from [UiPath].[dbo].[UserLoginAttempts] where 1=2

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

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

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

ユーザー ログインの試行

60 日を経過したログイン試行を削除するには、以下のようなクエリを使用します。SQL サーバーのジョブで手動で実行するか、スケジュールに従って実行することができます。

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 transactiondeclare @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

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

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

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

Was this page helpful?

サポートを受ける
RPA について学ぶ - オートメーション コース
UiPath コミュニティ フォーラム
UiPath ロゴ (白)
信頼とセキュリティ
© 2005-2024 UiPath. All rights reserved.