dbTalk Databases Forums  

clone databases?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss clone databases? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
MikeV06
 
Posts: n/a

Default clone databases? - 04-13-2006 , 10:20 PM






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.

Reply With Quote
  #2  
Old   
Sue Hoegemeier
 
Posts: n/a

Default Re: clone databases? - 04-13-2006 , 10:55 PM






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:

Quote:
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.


Reply With Quote
  #3  
Old   
MikeV06
 
Posts: n/a

Default Re: clone databases? - 04-13-2006 , 11:37 PM



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.

Quote:
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.

Reply With Quote
  #4  
Old   
Sue Hoegemeier
 
Posts: n/a

Default Re: clone databases? - 04-14-2006 , 08:06 AM



The article doesn't really apply to your case - that's a
different scenario and not for a copy of a databases. It
happens when you have a database on a server, backup the
database, change the logical names of the files, then
restore that databases (not restore a copy).
You should not alter sysaltfiles. You should use the
transact-sql commands instead. Just because you can alter
the values in the system table directly, doesn't mean you
should.

-Sue.

On Thu, 13 Apr 2006 23:37:40 -0500, MikeV06 <me (AT) privacy (DOT) net>
wrote:

Quote:
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.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.