![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to find a method to clone a database within a server. I have tried Backup/Recovery and detach/attach approaches. I can create the clone with its own set of data/log files. However, the cloned database's property data tab and log tab still lists the original file name even though everything else has changed. I have looked through master trying to find where that is defined. Can anyone shed some light on this please? Thanks. |
#3
| |||
| |||
|
|
The File Name listed is the logical file name - those will stay as they were in the original database. They only need to be unique in a database so it's not a problem if they are the same in the two different databases. You can rename them if you want by executing an alter database..modify file, e.g. alter database YourCloneDB modify file (name = OriginalLogicalName, newname = NewLogicalName) -Sue On Thu, 13 Apr 2006 22:20:36 -0500, MikeV06 <me (AT) privacy (DOT) net wrote: I am trying to find a method to clone a database within a server. I have tried Backup/Recovery and detach/attach approaches. I can create the clone with its own set of data/log files. However, the cloned database's property data tab and log tab still lists the original file name even though everything else has changed. I have looked through master trying to find where that is defined. Can anyone shed some light on this please? Thanks. |
#4
| |||
| |||
|
|
On Thu, 13 Apr 2006 21:55:28 -0600, Sue Hoegemeier wrote: Thanks. Your comments helped. I found http://support.microsoft.com/kb/817089/. Basically it says, "When you restore a database, recovery of logical file names of the database can fail, and the logical file names that correspond to the database in the master..sysaltfiles and the Database_name>..sysfiles tables may differ." Turns out one can edit the master.sysaltfiles, YourCloneDB.sysfiles1, and YourCloneDB.sysfile as well. I am going to use the alter command now and see what happens to those files. Thank you very much. I was really going around in circles!! Mike. The File Name listed is the logical file name - those will stay as they were in the original database. They only need to be unique in a database so it's not a problem if they are the same in the two different databases. You can rename them if you want by executing an alter database..modify file, e.g. alter database YourCloneDB modify file (name = OriginalLogicalName, newname = NewLogicalName) -Sue On Thu, 13 Apr 2006 22:20:36 -0500, MikeV06 <me (AT) privacy (DOT) net wrote: I am trying to find a method to clone a database within a server. I have tried Backup/Recovery and detach/attach approaches. I can create the clone with its own set of data/log files. However, the cloned database's property data tab and log tab still lists the original file name even though everything else has changed. I have looked through master trying to find where that is defined. Can anyone shed some light on this please? Thanks. |
![]() |
| Thread Tools | |
| Display Modes | |
| |