Solved

How To Track Changes in SQL 2005 databases?

Posted on 2011-09-28
6
171 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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