Skip to content

Post-restore configurations on the database

All operations on this page are to be performed in Microsoft SQL Server Management Studio.

Verification of the database owner

Run the two queries below. If both queries do not return the same value, then it is necessary to run another query to change the owner.

Query 1

1
SELECT SD.[SID] ,SL.Name as [LoginName] FROM master..sysdatabases SD inner join master..syslogins SL on SD.SID = SL.SID Where SD.Name = 'Hpliance' 

Query 2

1
Select [SID] From Hpliance.sys.database_principals Where Name = 'DBO'

After executing queries 1 and 2, compare the results:

  • If the results of queries 1 and 2 are identical, no action is required.

  • If the results of queries 1 and 2 are different, execute the following query:

    1
    EXEC sp_changedbowner '<Valeur SL.Name renvoyée par la requête 1>'
    

Verification of certain constants

The following queries can be used to verify that certain constants are preserved:

Query 1

1
select is_trustworthy_on from sys.databases where name = 'Hpliance'

If the result is not 1, execute the following query:

1
ALTER database Hpliance SET TRUSTWORTHY ON

Query 2

1
select * from sys.configurations where name like '%clr%'

If the result is not 1, execute the following query:

1
sp_configure 'clr enabled', 1;

Activation of the broker

To install the broker, run the following query:

1
ALTER DATABASE [HPliance] SET ENABLE_BROKER with rollback immediate