Orchestrator
2021.10
False
横幅背景图像
Orchestrator 安装指南
上次更新日期 2024年4月19日

维护注意事项

保持 Identity Server 数据库整洁有序,这一点很重要。为此,我们建议:

使用 SQL Server 维护解决方案

SQL Server 维护解决方案是一组脚本,让您可以从 2005 版本开始在所有版本的 Microsoft SQL Server 上运行备份、完整性检查以及索引和统计信息维护。请参阅此 GitHub 项目以获取更多信息。请参阅此 GitHub 项目以获取更多信息。

创建存档数据库

建议您在删除项目之前创建一个单独的数据库以在其中保存项目。此数据库充当因某些原因(例如审核)可能需要存储的项目的存档。

  1. 创建一个新的调用数据库,例如 UiPathIdentityArchives
    create database UiPathIdentityArchivescreate database UiPathIdentityArchives
  2. 创建以下备份表:

    1. ArchiveLoginAttempts,其结构与 UserLoginAttempts 表相同:
      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 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 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 Server 数据库实施定期备份,例如每周完整备份或每日增量备份。

此外,我们建议您使用在该位置使用脚本创建的 DatabaseBackup 存储程序。

  • 使用 SQL Server 维护解决方案
  • 创建存档数据库
  • 定期删除旧数据
  • 用户登录尝试次数
  • 备份数据库

此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.