How do I reset the IMCASdb? - c06315828
PROBLEM:
If you've been testing with SSO or Internal Users and require a refresh of the IMCAS DB, you can follow these steps to clear it.
So far we've taken this action in cases where customers are making changes to the grants provided during the userinfo calls we are making in order for PrinterOn to successfully collect the job owner.
In 4.0 and earlier, PrinterOn primarily relied on the UserInfo endpoint to create the imcas user and collect the "claims" about the user. If the Userinfo does not return a claim which contains their user details as they would like to see it set in the job owner field, CPS will apply a value based on the claims it does receive.
(See Article: What is the order of preference for collecting username values from an iDM integration?) As of 4.1, CPS will trust the JWT first, then add any additional information found in the UserInfo response.
The consequence of that change is that the username must be determined from the JWT, it can be retrieved from userInfo later on , but if it is missing from the JWT/ IDToken response then we will not be able to collect the correct job owner.
SOLUTION :
- To clear the imcasdb : Stop the CPS server (THIS IS IMPORTANT!)
- Launch Command Prompt as an admin user
- Run the command sqlcmd -S localhost\ cpsdb
-
Run the below commands in Command Prompt
NOTE:
You can copy all the lines and enter it as a single paste entry in command prompt, just hit enter at the end of it -
use master
GO
alter database imcasdb set single_user with rollback immediate
IF EXISTS (SELECT name FROM sys.databases WHERE name = ' imcasdb ')
DROP DATABASE imcasdb
GO
create database imcasdb ;
go
CREATE LOGIN [NT AUTHORITY\SYSTEM] FROM WINDOWS WITH DEFAULT_DATABASE=[ imcasdb ];
GO
alter database imcasdb set auto_close off;
go
alter database imcasdb set auto_shrink off;
go
use imcasdb
go
ALTER DATABASE imcasdb SET READ_COMMITTED_SNAPSHOT ON;
GO
create user [NT AUTHORITY\SYSTEM] from login [NT AUTHORITY\SYSTEM] with default_schema = dbo ;
GO
exec sp_addrolemember ' db_owner ', 'NT AUTHORITY\SYSTEM ';
go
use imcasdb
go - Start the CPS service