Solved

How To Track Changes in SQL 2005 databases?

Posted on 2011-09-28
6
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql Permission 6 81
Truncate vs Delete 63 108
Insert from Stored Procedure where some field/s > 0 7 48
Help with stripping out character in SQL LEFT/RIGHT/REPLACE 2 54
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

759 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