Solved

How To Track Changes in SQL 2005 databases?

Posted on 2011-09-28
6
170 Views
Last Modified: 2012-08-13
Hi all,
how to track the changes happening in database?

I have a database, some process is trying to change the recovery model to simple and set it back to full.

so, how to identify these kind of scenarios?
please help, Thanks!
0
Comment
Question by:msdba
6 Comments
 
LVL 21

Accepted Solution

by:
JestersGrind earned 250 total points
ID: 36718784
I would run a profiler trace to capture what is happening.  Does it always happen at a specific time or is it random?  Make sure that you capture the login name, starttime and the textdata columns.

Greg


0
 

Author Comment

by:msdba
ID: 36719071
Thanks for the comments, Is there any other way other than running profiler?
0
 
LVL 21

Assisted Solution

by:JestersGrind
JestersGrind earned 250 total points
ID: 36719203
When the recovery model is changed, I believe, something is written to the SQL Server log.  There maybe something in the Windows Application log too.  I'm not sure how much information is given though.

Greg

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 25

Assisted Solution

by:TempDBA
TempDBA earned 125 total points
ID: 36813260
You can create a trigger on the server for alter database command

create Trigger ResetRecoveryMode
on all server
for ALTER_DATABASE
as
begin
declare @tsql nvarchar(max)
SELECT @tsql=EVENTDATA().value('(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]','nvarchar(max)')
if(CHARINDEX('RECOVERY',@tsql)>0)--verify whether the user is altering the recovery model
print 'some body alter the database RECOVERY setting'
rollback --if find the user alter the recovery model,then rollback
--alter database AdventureWorks
--SET RECOVERY FULL
end


Ref: http://social.msdn.microsoft.com/Forums/en-US/sqlgetstarted/thread/24ab1c40-310d-4bae-95f3-891ecdf8fa4c/
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 125 total points
ID: 36895323
If this is a large corporation and you had SQL Server 2008 you could use Policy Based Management to prevent this from happening:
http://msdn.microsoft.com/en-us/library/bb510667.aspx:

A better approach is to control who/what has permission to ALTER the Recovery Model.
0
 

Author Closing Comment

by:msdba
ID: 36986285
Thanks 2 All for the valuable comments.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now