Solved

Is there a way to programmatically change the recovery model on user DB's in MS SQL Server 2000?

Posted on 2006-06-09
3
425 Views
Last Modified: 2011-09-20
Here's my situation:  I have a developer who consistently forgets to reset the recovery model to Full after he works on his database (usually when he restores or if he changes models just for speed sake).  Unfortunately, the DB server he's working with houses about 40 other databases.  His is by far the largest, and the transaction log for him alone gets to the point where it chokes the server and brings down other DB's.

Ideally what I would like to do is set up a job that runs every night before the backup runs that changes the recovery model on any user databases (or even specific ones if I have to) via a stored procedure, etc.

Can anyone point me in the right direction?  It would save immense amounts of grief.

Thanks!
0
Comment
Question by:vferrari
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 16870702
Alter database <dbname> set recovery <simple/full>
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16870726
http://doc.ddart.net/mssql/sql70/sp_da-di_4.htm

to activate the full recovery mode:
exec sp_dboption 'trunc. log on chkpt.', 'FALSE'

to activate the simple recovery mode:
exec sp_dboption 'trunc. log on chkpt.', 'TRUE'
0
 

Author Comment

by:vferrari
ID: 16870788
Aneeshattingal,

That was EXACTLY what I was looking for.  Thanks!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

920 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

14 Experts available now in Live!

Get 1:1 Help Now