Score:0

Log Shipping & Target Database filenames

bn flag

I have a production and disaster recover ('DR') server and have been using log-shipping on a single database ('DB1') between the two servers without issue for a few months.

Recently I've had to duplicate an instance of the application and this required a duplicated database. The duplicate database was restored from a backup of DB1 and was renamed ('DB2'). Setting up log-shipping on DB2 has been an issue. For some reason the logical and data files on the DR server are different names to the database (DB2).

Is there a way to change the logical and data file names of the "target" database to be the same name as the database as reflected in SSMS?

rvsc48 avatar
gh flag
If you are restoring a copy of the same database to the DR Server under a different name, the physical file names must be different as to not conflict with the physical file names for the existing DB1 database on the DR Server. Is this what you mean when you say "... are different names to the database (DB2)? The logical database file names can be identical and shouldn't cause any issues.
Daniel avatar
bn flag
@rvsc48 per the answer from Pete below (which should've been a comment) your comment resolved our issue. Can you please add an answer so that I can reward your bounty?
rvsc48 avatar
gh flag
Great news! Moving my comment to Answer for the credit. Glad to hear you figured it out.
Score:0
gh flag

If you are restoring a copy of the same database to the DR Server under a different name, the physical file names must be different as to not conflict with the physical file names for the existing DB1 database on the DR Server. Is this what you mean when you say "... are different names to the database (DB2)? The logical database file names can be identical and shouldn't cause any issues.

Score:0
in flag

Thanks very much. Your comment highlighted where my problem was. We have been successfully log shipping a single database up until now but when creating a duplicate of this database for another region I did not notice that the logical name was still the same as the original database. So the new log shipping task wanted to create a data file with the same name as the original database. Only when I fixed the logical names of both databases to be the same as the DB names was I able to successfully get the two log shipping tasks to create successfully with separate data files on the DR server. As usual a silly mistake but a simple problem to fix :-)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.