Quantcast
Channel: Database Mirroring forum
Viewing all articles
Browse latest Browse all 1024

Issue with Scripting Log Shipping set up

$
0
0

I have been trying to set up log shipping, due to the number of database and on going maintenance i need to scrip this. 

I have log shipping working have is set it up with SSMS and then generated a script from that so i know all the settings are correct.  

however the scrip does not do the initial backup and restore which is where I assume I am going wrong. 

my back up code is running at the start of the script and creating the bak file directly on the second server 

here is an example of the code 

BACKUP DATABASE [DBName] to DISK='UNCPathToSocondServer' BACKUP LOG [Database] to DISK='UNCPathToSocondServer')

I then run the rest of the setup on the Primary server 

Then do the restore on to the secondary server like so 

RESTORE DATABASE [DatabaseName] FROM  DISK = 'LocalPathTo . bak file'

WITH  FILE = 1,   
MOVE N'LogicalName' TO N'MyDB.mdf', 
MOVE N'LogicalNameLog' TO N'my.ldf''
,  NORECOVERY,  NOUNLOAD,  STATS = 5')

then run the rest of the setup on the secondary server. 

everything seems to work but in the restore job it tells me that i can not find a valid trn file to restore but they are in the correct folder. 


Regards Dagz


Viewing all articles
Browse latest Browse all 1024

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>