0

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?

Daniel
  • 13
  • 6
  • 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. – rvsc48 Oct 25 '21 at 21:21
  • @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? – Daniel Oct 27 '21 at 10:17
  • Great news! Moving my comment to Answer for the credit. Glad to hear you figured it out. – rvsc48 Oct 27 '21 at 18:27

2 Answers2

0

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 :-)

0

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.

rvsc48
  • 431
  • 2
  • 7