Database Maintenance for Orchestrator

Database maintenance

Step1 : Take back up of PROD DB (UiPath) in RDS instance

Step 2: Run the queries to delete the rows in table

1. DELETE FROM [dbo]. [AuditLogEntities] WHERE AuditLogId in (select Id from dbo.auditlogs where DateDiff(day, ExecutionTime, GetDate()) > 30)
2. Delete from dbo.auditlogs where DateDiff(day, ExecutionTime, GetDate()) > 30
3. DELETE FROM [dbo]. [AuditLogEntities] WHERE AuditLogId < ?????
4. DELETE FROM [dbo].[jobs] WHERE DateDiff(day, CreationTime, GetDate()) > 30
5. DELETE FROM [dbo].[QueueItemEvents] WHERE DateDiff(day, CreationTime, GetDate()) > 30
6. DELETE FROM [dbo].[QueueItems] WHERE DateDiff(day, CreationTime, GetDate()) > 30
7. DELETE FROM [dbo].[RobotLicenseLogs] WHERE EndDate is not null and DateDiff(day, EndDate, GetDate()) > 30
8. DELETE FROM [dbo]. [TenantNotifications] WHERE DateDiff(day, CreationTime, GetDate()) > 30
9. DELETE FROM [dbo]. [UserLoginAttempts] WHERE DateDiff(day, CreationTime, GetDate()) > 30
10. DELETE FROM [dbo]. [UserNotifications] WHERE DateDiff(day, CreationTime, GetDate()) > 365

Step 3 :  Rebuild and re-organize indexes  - This will be done by Database team. Capture steps with screenshots on rebuild. In case, you want to get more details about Rebuild and Reorganize of indexes please serach for KB article "SQl Server Index Rebuild and Index Reorganize"