You are here: Re: QUESTION: Performance issue on *one* database on a server « MsSQL Server « IT news, forums, messages
Re: QUESTION: Performance issue on *one* database on a server

Posted by Erland Sommarskog on 09/21/06 21:56

BD (robert.drea@gmail.com) writes:
> -Used 'Create SQL script' to generate a create db statement from the
> current db.
> -Changed the db name, and all file paths to not conflict with the
> current db.
> -Created a new db in a new directory with this script.
> -Restored last night's backup from the 'real' db to the new one.

That's a bit overkill. You can use the RESTORE command to do all that:

RESTORE newdbname FROM disk = '...'
WITH MOVE 'datafile' TO 'newpath',
MOVE 'logfile' TO 'newpath',
REPLACE

You can get the values for datafile and logfile from sp_helpdb or
RESTORE FILELISTONLY if there is no copy of the database online.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация