January 13, 2004 at 11:51 am
In BOL I found in the Transact-SQL reference: It may be necessary to create a copy of an existing database on the same computer for testing purposes. In this case, the database files for the original database already exist, so different file names need to be specified when the database copy is created during the restore operation. Make a copy of a database using BACKUP and RESTORE: This example uses both the BACKUP and RESTORE statements to make a copy of the Northwind database (I changed the destination path)
January 13, 2004 at 11:58 am
What is your question?
January 13, 2004 at 12:02 pm
How to place a CR/LF. I have a lot of lines but the message accepts only a single line
January 13, 2004 at 12:06 pm
I don't know. Steven may have better answers to CR/LF. I try to
familiarize this new Forum too.
January 13, 2004 at 12:27 pm
I found this: Carriage returns not converted to P/BR in HTML mode when posting a reply (Priority 2). I'll come back later with my question.
January 13, 2004 at 12:59 pm
Henk,
I think what you need is something like this...
Backup your original DB.
BACKUP DATABASE Northwind TO DISK = 'D:\Junk\Northwind_data.bak'
Then run something like this...
RESTORE DATABASE Northwind_Copy
FROM DISK = 'D:\Junk\Northwind_data.bak'
WITH MOVE 'Northwind' = 'D:\MSSQL\Data\Northwind_Copy_Data.mdf'
, 'Northwind_Log' = 'D:\MSSQL\Log\Northwind_Copy_Log.ldf
, STATS
Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer
This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.
January 13, 2004 at 1:19 pm
Gary thank you. I found this about the same lines in BOL, but the BOL example has an extra line between the BACKUP and RESTORE Line: RESTORE FILELISTONLY FROM DISK = 'c:\Northwind.bak' When I use the BOL example with Northwind it works fine. But when I replace Nordwind with my databasename (Vineadb) I get a error message: Server: Msg 3234, Level 16, State 2, Line 5 Logical file 'Vineadb' is not part of database 'TestDB'. Use RESTORE FILELISTONLY to list the logical file names. Server: Msg 3013, Level 16, State 1, Line 5 RESTORE DATABASE is terminating abnormally. What could be the reason? I use SQLserver 2000 Developper, the Vineadb.bak is made (15MB)
January 13, 2004 at 1:46 pm
Run sp_helpfile on your database will give you the logical file names your database have.
Following Gary's suggestion to restore the database.
January 13, 2004 at 6:36 pm
Just to clarify Allen's point the logical filename is what comes directly after the MOVE and before the = sign. You can either use the SP or you can go to enterprise manager and look at the properties for the original database. The logical filename is the filename shown for the data and log files in the dialog box. These must be retained the same in the new database. BTW: the Restore Database command will automagically create the new database for you!
Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer
This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.
January 14, 2004 at 1:44 am
Gary, Using the Enterprise Manager I get tab General: Name VineaDb, Tab DataFiles: Filename VineaDb_Data. Could it be the Captital 'D' in 'VineaDb', I did use 'Vineadb'
January 14, 2004 at 8:03 am
Garry and Allen Thank you for your help. With this help I found out that the name I had to support in the WITH MOVE was VineaDb_Data in stead of VineaDb. Now all worked fine. Henk
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply