Quantcast
Channel: file groups
Viewing all articles
Browse latest Browse all 7

file groups

$
0
0

Hi Johnny,

What is filegroup?

As name suggests - Filegroup is a group or set of files.SQL Server maps a database over a set of operating-system files.Filegroups are named collections of files and are used to help with data placement and administrative tasks such as backup and restore operations.There are two types of filegroups: PRIMARY and USER-DEFINED.

Primary Filegroup: The primary filegroup contains the primary data file and any other files not specifically assigned to another filegroup. All pages for the system tables are allocated in the primary filegroup.

User-defined Filegroup: User-defined filegroups are any filegroups that are specified by using the FILEGROUP keyword in a CREATE DATABASE or ALTER DATABASE statement.

Situation in which we can use filegroup

1. If you have VLDB then spliiting the files into filegroups can improve database performance.

2. You can seperate data & index on different filegroups which helps in easy data management.

3. If your database have major part which is used only for READ then you can create a seperate READ ONLY Filegroup.

4. If you had SQL Server 2008 Enterprise Edition then you can use ONLINE Restore and your database is accessible just after PRIMARY filegroup is restored & you can restore the subsequent filegroups later.

5. Filegroups helps in easy management and better administation.

 

Backing up filegroups:


You can use SSMS(sql server 2005 & above) or EM (sql server 2000) for filegroup backup.

Or you can exectue follwing T-SQL

Backup Database <DBname> Filegroup='Logical Filegroup name'

to disk='Phyical Path'

 

Hope this answers your question.

 

 


Regards, Vishal Srivastava

Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images