Forum Discussion
SQL logshipping
Hi Everyone,
has any experience an issue whereby you setup log shopping from SQL 2014 to SQL 2022 , when you choose the paths for data and logs to be stored on destination server it defaults to store both files on the Data drive instead of it being seperate drives like you specified? The initial log setup completes with no errors. Would appreciate any help i can get.
Thanks
R
3 Replies
- deepeshd87Copper Contributor
By default, SQL Server:
- Uses the file paths embedded in the backup
- or falls back to instance default data/log paths
You can check following:
- Select serverproperty('InstanceDefaultDataPath'),serverproperty('InstanceDefaultLogPath')
If Both point to same drive then both files land there.
2. Missing MOVE caluses during restore
Use Move clause during initial restore.
You can try following fix:
- Take FULL backup on primary
- ON Secondary, run restore statement with MOVE clause
- Configure log shipping without initialization
Tip(Based on experience): Always initialize secondary database manually.
- deepeshd87Copper Contributor
By default, SQL Server:
• uses the file paths embedded in the backup
• or falls back to instance default data/log paths
You can check following:
1. SELECT
SERVERPROPERTY('InstanceDefaultDataPath'),
SERVERPROPERTY('InstanceDefaultLogPath')
If both point to same drive then both files land there.
2. Missing MOVE clauses during restore
WITH MOVE 'logical_data_name' TO 'D:\Data\DBfile.mdf',
MOVE 'logical_log_name' TO 'L:\Logs\DBfile_LOG.ldf'
Without this, SQL uses original or default paths.
You can try following fix:
1. Take FULL backup on primary
2. On secondary, run:
RESTORE DATABASE YourDB
FROM DISK = backuplocation
WITH
MOVE 'YourDB_Data' TO 'D:\SQLData\YourDB.mdf',
MOVE 'YourDB_Log' TO 'L:\SQLLogs\YourDB.ldf',
NORECOVERY;
3. Then configure log shipping without initialization
Tip(Based on experience): Always initialize secondary database manually
- rmxCopper Contributor
hi everyone,
did anyone experience such an issue