SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How to add secondary file group in sql server2000
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kamii47
Constraint Violating Yak Guru

352 Posts

Posted - 12/05/2006 :  06:14:13  Show Profile  Reply with Quote
Can any body let me know that How can I add secondary file group in my existing database {with data} in sql server2000.
I can't find any option in sql server enterprise manager to add secondary filegroup.

harsh_athalye
Flowing Fount of Yak Knowledge

India
5581 Posts

Posted - 12/05/2006 :  06:24:03  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
In the database properties dialog box in Enterprise Manager, fourth tab from the left. Click on the empty row, type in the new filegroup name and Bingo...You have added new filegroup. Now start adding data files to the newly created filegroup.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

TonyTheDBA
Posting Yak Master

United Kingdom
121 Posts

Posted - 12/05/2006 :  07:19:27  Show Profile  Reply with Quote
Copy and Paste this into Query Analyser
ALTER DATABASE <db_name, Sysname , DBName>
  ADD FILE ( NAME       = <logical_file_name , , DBCurrName>_<data_or_log , dat|log , dat>
           , FILENAME   = '<OS_Drive, , D:><OS_Path, , \data\><db_name, Sysname , DBName>\<OS_Filename, ,Filename.ndf>'
           , FILEGROWTH = <filegrowth , 128 | 10 , 128><suffix, % | KB | MB | GB | TB , MB>  
           , SIZE       = <size , , 512><Size_suffix , KB | MB | GB | TB , MB>
           , MAXSIZE    = <maxsize , 512|UNLIMITED , 512><Size_suffix , KB | MB | GB | TB , MB>
           ) TO FILEGROUP <DB_Filegroup, , [PRIMARY]>

Presh <CTRL>+<SHFT>+<M> and fill in the appropriate values for your database.

Remember "The GUI is evil! Query Analyser is your friend"


--
Regards
Tony The DBA
Go to Top of Page

sponguru_dba
Yak Posting Veteran

India
93 Posts

Posted - 12/05/2006 :  07:22:21  Show Profile  Reply with Quote
Hi

1.Create File group
ALTER DATABASE <Database name> ADD FILEGROUP <desire filegroupname>

2.Add the Data file to that group
Alter database <Db_name> add file
(name=<Data file name>,filename='c:\<ndfdatafile_name>.ndf',size=1Mb,maxsize=2mb,filegrowth=1mb)
to filegroup <Created file group name>


Cheers...

SreenivasaRao
Bangalore,INDIA
Go to Top of Page

TonyTheDBA
Posting Yak Master

United Kingdom
121 Posts

Posted - 12/05/2006 :  07:24:31  Show Profile  Reply with Quote
Doh! Oh Bother! Copied the wrong script fragment! Try this
ALTER DATABASE <db_name, Sysname , DBName>
  ADD FILEGROUP <filegroupname , , NewFilegroup>
to create the filegroup, followed by the other fragment to add files to the filegroup


--
Regards
Tony The DBA
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000