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
Solved

How to retrieve from master dabase in T-SQL

Posted on 2011-03-18
6
269 Views
Last Modified: 2012-05-11
I want a list of all databases from the master database categorised into SIMPLE, FULL and BULK-LOGGED recovery models
0
Comment
Question by:mamlaide
  • 3
  • 2
6 Comments
 
LVL 32

Accepted Solution

by:
ewangoya earned 500 total points
ID: 35168497

select name, recovery_model_desc
from sys.databases
order by recovery_model
0
 

Author Comment

by:mamlaide
ID: 35168638
I am right to say that if a database is not used for read or write processes that often its recovery model should be always set to SIMPLE
0
 
LVL 32

Expert Comment

by:ewangoya
ID: 35168670

Not exactly, recovery model is not solely based on how you access your data.
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

Author Comment

by:mamlaide
ID: 35168697
Can you please explain to me what goes into setting the recovery model as say SIMPLE?
0
 
LVL 15

Expert Comment

by:Aaron Shilo
ID: 35168848
credit mike chapple:

Simple Recovery Model
The simple recovery model is just that: simple. In this approach, SQL Server maintains only a minimal amount of information in the transaction log. SQL Server truncates the transaction log each time the database reaches a transaction checkpoint, leaving no log entries for disaster recovery purposes.

In databases using the simple recovery model, you may restore full or differential backups only. It is not possible to restore such a database to a given point in time, you may only restore it to the exact time when a full or differential backup occurred. Therefore, you will automatically lose any data modifications made between the time of the most recent full/differential backup and the time of the failure.

Full Recovery Model
The full recovery model also bears a self-descriptive name. With this model, SQL Server preserves the transaction log until you back it up. This allows you to design a disaster recovery plan that includes a combination of full and differential database backups in conjunction with transaction log backups.

In the event of a database failure, you have the most flexibility restoring databases using the full recovery model. In addition to preserving data modifications stored in the transaction log, the full recovery model allows you to restore a database to a specific point in time. For example, if an erroneous modification corrupted your data at 2:36AM on Monday, you could use SQL Server’s point-in-time restore to roll your database back to 2:35AM, wiping out the effects of the error.

Bulk-logged Recovery Model
The bulk-logged recovery model is a special-purpose model that works in a similar manner to the full recovery model. The only difference is in the way it handles bulk data modification operations. The bulk-logged model records these operations in the transaction log using a technical known as minimal logging. This saves significantly on processing time, but prevents you from using the point-in-time restore option.

Microsoft recommends that the bulk-logged recovery model only be used for short periods of time. Best practice dictates that you switch a database to the bulk-logged recovery model immediately before conducting bulk operations and restore it to the full recovery model when those operations complete.

Those are the basics of SQL Server recovery models.
0
 
LVL 32

Expert Comment

by:ewangoya
ID: 35168972
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

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.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

829 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