Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-05-30 : 08:50:33
|
| Gianni writes "Hi all.I have a database with a single datafile (mdf) of 15Gb.I need to split the datafile in 2 data files (a new db would be ok).How can I do ?thanks in advance,Gianni" |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-05-30 : 23:02:44
|
quote: Originally posted by AskSQLTeam Gianni writes "Hi all.I have a database with a single datafile (mdf) of 15Gb.I need to split the datafile in 2 data files (a new db would be ok).How can I do ?thanks in advance,Gianni"
you cannot split it into 2 datafiles (2 mdf's), you can howeverFrom BOLquote: B. Create a database specifying multiple data and transaction log filesThis example creates a database called Archive with three 100-MB data files and two 100-MB transaction log files. The primary file is the first file in the list and is explicitly specified with the PRIMARY keyword. The transaction log files are specified following the LOG ON keywords. Note the extensions used for the files in the FILENAME option: .mdf is used for primary data files, .ndf is used for the secondary data files, and .ldf is used for transaction log files.USE masterGOCREATE DATABASE Archive ONPRIMARY ( NAME = Arch1, FILENAME = 'c:\program files\microsoft sql server\mssql\data\archdat1.mdf', SIZE = 100MB, MAXSIZE = 200, FILEGROWTH = 20),( NAME = Arch2, FILENAME = 'c:\program files\microsoft sql server\mssql\data\archdat2.ndf', SIZE = 100MB, MAXSIZE = 200, FILEGROWTH = 20),( NAME = Arch3, FILENAME = 'c:\program files\microsoft sql server\mssql\data\archdat3.ndf', SIZE = 100MB, MAXSIZE = 200, FILEGROWTH = 20)LOG ON ( NAME = Archlog1, FILENAME = 'c:\program files\microsoft sql server\mssql\data\archlog1.ldf', SIZE = 100MB, MAXSIZE = 200, FILEGROWTH = 20),( NAME = Archlog2, FILENAME = 'c:\program files\microsoft sql server\mssql\data\archlog2.ldf', SIZE = 100MB, MAXSIZE = 200, FILEGROWTH = 20)GO
--------------------keeping it simple... |
 |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2005-05-31 : 02:38:57
|
| As jen said, you can't split the file - but you can add a new on. If you are running out of space, just add a new datafile to the database located on another drive.-ec |
 |
|
|
|
|
|
|
|