Sql-server – One of the Disaster recovery server every day sp_configure values are changing

sql server

We have a DR server, Daily databases are restoring from Production to DR server.

From last week onward, the Sp_Configure Value (Show Advanced) is changing.

How do I find out from where these values are coming from, they are different from the Production server Sp_Configure values.

Best Answer

This will be in your Log File.

For example, if I run:

EXEC sys.sp_configure @configname = 'Show Advanced', @configvalue = 0
RECONFIGURE WITH OVERRIDE


EXEC sys.sp_configure @configname = 'Show Advanced', @configvalue = 1
RECONFIGURE WITH OVERRIDE

It shows up in my Error Log like this:

Nuts

If you want to search through your error log for other instances of this occurring, you can click filter, and then fill out a search condition.

Nuts

If you want to dig a little bit deeper, you can check the default trace for events as well (adapted from Aaron's code here):

DECLARE @path NVARCHAR(260);

SELECT @path = REVERSE(SUBSTRING(REVERSE(path), CHARINDEX('\', REVERSE(path)), 260)) + N'log.trc'
FROM   sys.traces
WHERE  is_default = 1;

SELECT   TOP 1000 TextData,
                  NTUserName,
                  NTDomainName,
                  HostName,
                  ApplicationName,
                  LoginName,
                  ServerName,
                  DatabaseName,
                  SessionLoginName
FROM     sys.fn_trace_gettable(@path, DEFAULT)
WHERE    EventClass = 22
AND TextData LIKE '%Configuration%'
ORDER BY StartTime DESC;