Showing posts with label restore. Show all posts
Showing posts with label restore. Show all posts

Friday, March 30, 2012

Log Shipping will not restore tran logs on secondary server

We're planning to implement log shipping on our databases, and I have been toiling with it all weekend trying to get it to work on some test databases. The result is the same whether I do it via the wizard or manually via T-SQL.

I am using 3 servers, all SQL Server 2005 Standard SP1. All 3 SQL Servers are configured identically.

When I setup log shipping, it initializes with no problems. When it processes the first tran log file, it restores it with no problem. Every successive log file thereafter is not restored. No errors are generated. The only outright indication of a problem is that the monitor server shows that there has not been a recent restore.

The backup and copy both suceed. The restore claims to suceed. If I review the job history for each step, it says that it skipped the log file and then reports that it did not fina any log files to restore.

Message
2006-11-06 05:00:01.92 Skipped log backup file. Secondary DB: 'MyDemo', File: 'D:\MSSQL\Backup\MyDemo\MyDemo_20061106115619.trn'

Message
2006-11-06 05:00:01.95 Could not find a log backup file that could be applied to secondary database 'MyDemo'.
2006-11-06 05:00:01.96 The restore operation was successful. Secondary Database: 'MyDemo', Number of log backup files restored: 0

Any ideas or suggestions?

A little more info for you. I can manually restore the successive log file backups without any errors. However, the output says that there were 0 pages processed. The successive log files are being created empty. Well, these are test databases, so there are no active transactions ocurring, so no big surprise, right? I updated a lot of data in the tables, and the next log file is ....... empty.

So even with committed transactions ocurring, the tran log backup is still empty.

|||

I found the problem. It was a security setting that the Log Shipping wizard does not give you the ability to change. It defaulted to using Windows security (the account used by SQL Agent) for the connection to the Monitor server to update the state of the restore process. Because we use local system accounts, not domain accounts, for SQL Agent, it was not able to update the Monitor.

My scripts were based off of the first log shipping instance that I set up, so the option to change it there wasn’t included in the script generated by SQL Server. Since I originally set it up with the primary, secondary, and monitor on my local machine, it worked fine.

In the wizard, there is a setting for the account that the monitor should use, but it only affects the primary's connection to the monitor, not the secondary's connection.

Monday, March 26, 2012

Log Shipping Restore seems to Time out after 10 minutes

While playing with log shipping it appears that the restore is timing out, without errors. The shipper is successfully backing up to disk, xcopying the backup to the receiver, calling the restore SP on the receiver. The restore runs for exactly 10 minutes
and 1 second then ends with a success. Any ideas on what I missed?
Denny,
I'm not sure about this. How do you know it has timed out - do any of the
transactions get applied on the standby server at all?
Regards,
Paul Ibison
|||I am not sure it is timing out, it was only a guess. When it tries to apply the first log it says that database was only partially restored.
If I manually run the retore SP on the receiver, rather than having the shipper call it, it successfully restores the entire backup file then I can ship the logs with no errors.
|||I ran the restore SP via Query Analyzer on the shipping server and I was correct. The error was (OLE/DB provider returned message: Timeout Expired)..
Did I do my linked server incorrectly?
|||Denny,
your setup is sound, as there is no timeout property in log shipping. I
suspect this is something peripheral - it could be network lag, or
alternatively (and possibly more likely) your database is expanding. I have
a KB article that explains this as a potential cause of this issue:
http://support.microsoft.com/default...;EN-US;Q305635
HTH,
Paul Ibison
|||I was able to narrow it down to a timeout setting with the Linked Servers. Both the connection timeout and query timeout had a value of zero entered, which is supposed to be no timeout (assuming I understood the documentation correctly). As soon as I set
the query timeout to 1200 seconds everything works fine. I will probably set it to 1800 seconds, I'd imagine 30 minutes would be more than enough time to restore from a file.
|||Denny,
but log-shipping doesn't use linked servers. Is this perhaps a custom
inplementation?
Regards,
Paul Ibison
|||Yes it is. I followed the directions from a doc on SQL-Server-Performance. The scheduled task on the production box dumps to disk, copies it to the warm standby server using xcopy, then calls an SP on the warm standby server that restores that file.
|||Denny this makes sense now. If the query timeout is zero, it uses the value
in sp_configure. I thing that you'll find that that is the problem as it is
set too low. Setting the value at the lower level as you have done overrides
the sp_configure value, so that explains why it works now.
Regards,
Paul Ibison

Log Shipping restore problem

I'm implementing SQL Server Log Shipping. I don't have
Enterprise, so I have to create my own jobs. I'm in the
step where I'm executing a store procedure on the stanby
server to restore the database and I get an error stating
that the database state cannot be change because it is in
used by other users. The exact error is at the bottom of
this message.
I'm not sure why I'm getting this and how to fix it.
Nobody else has access to this server but myself and the
database is set to DBO USE ONLY. I closed out
Enterprise manager and SQL Query Analyzer on the standby
server and I still get the error. Please help. The
exact error is:
Executed as user: sa. RESTORE DATABASE is terminating
abnormally. [SQLSTATE 42000] (Error 3013) Exclusive
access could not be obtained because the database is in
use. [SQLSTATE 42000] (Error 3101) ALTER DATABASE
statement failed. [SQLSTATE 42000] (Error 5069) Database
state cannot be changed while other users are using the
database 'myDBName' [SQLSTATE 42000] (Error 5070)
sp_dboption command failed. [SQLSTATE 01000] (Error
15627). The step failed.Before you restore, you need to make sure there's no one in the database.
You will have to kill all user connections in the database, if there are
any. More info can be found at:
http://vyaskn.tripod.com/administration_faq.htm#q16
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Vic" <vduran@.specpro-inc.com> wrote in message
news:017e01c3d93f$dd6bc360$a401280a@.phx.gbl...
I'm implementing SQL Server Log Shipping. I don't have
Enterprise, so I have to create my own jobs. I'm in the
step where I'm executing a store procedure on the stanby
server to restore the database and I get an error stating
that the database state cannot be change because it is in
used by other users. The exact error is at the bottom of
this message.
I'm not sure why I'm getting this and how to fix it.
Nobody else has access to this server but myself and the
database is set to DBO USE ONLY. I closed out
Enterprise manager and SQL Query Analyzer on the standby
server and I still get the error. Please help. The
exact error is:
Executed as user: sa. RESTORE DATABASE is terminating
abnormally. [SQLSTATE 42000] (Error 3013) Exclusive
access could not be obtained because the database is in
use. [SQLSTATE 42000] (Error 3101) ALTER DATABASE
statement failed. [SQLSTATE 42000] (Error 5069) Database
state cannot be changed while other users are using the
database 'myDBName' [SQLSTATE 42000] (Error 5070)
sp_dboption command failed. [SQLSTATE 01000] (Error
15627). The step failed.

Log Shipping restore problem

I'm implementing SQL Server Log Shipping. I don't have
Enterprise, so I have to create my own jobs. I'm in the
step where I'm executing a store procedure on the stanby
server to restore the database and I get an error stating
that the database state cannot be change because it is in
used by other users. The exact error is at the bottom of
this message.
I'm not sure why I'm getting this and how to fix it.
Nobody else has access to this server but myself and the
database is set to DBO USE ONLY. I closed out
Enterprise manager and SQL Query Analyzer on the standby
server and I still get the error. Please help. The
exact error is:
Executed as user: sa. RESTORE DATABASE is terminating
abnormally. [SQLSTATE 42000] (Error 3013) Exclusive
access could not be obtained because the database is in
use. [SQLSTATE 42000] (Error 3101) ALTER DATABASE
statement failed. [SQLSTATE 42000] (Error 5069) Database
state cannot be changed while other users are using the
database 'myDBName' [SQLSTATE 42000] (Error 5070)
sp_dboption command failed. [SQLSTATE 01000] (Error
15627). The step failed.Before you restore, you need to make sure there's no one in the database.
You will have to kill all user connections in the database, if there are
any. More info can be found at:
http://vyaskn.tripod.com/administration_faq.htm#q16
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Vic" <vduran@.specpro-inc.com> wrote in message
news:017e01c3d93f$dd6bc360$a401280a@.phx.gbl...
I'm implementing SQL Server Log Shipping. I don't have
Enterprise, so I have to create my own jobs. I'm in the
step where I'm executing a store procedure on the stanby
server to restore the database and I get an error stating
that the database state cannot be change because it is in
used by other users. The exact error is at the bottom of
this message.
I'm not sure why I'm getting this and how to fix it.
Nobody else has access to this server but myself and the
database is set to DBO USE ONLY. I closed out
Enterprise manager and SQL Query Analyzer on the standby
server and I still get the error. Please help. The
exact error is:
Executed as user: sa. RESTORE DATABASE is terminating
abnormally. [SQLSTATE 42000] (Error 3013) Exclusive
access could not be obtained because the database is in
use. [SQLSTATE 42000] (Error 3101) ALTER DATABASE
statement failed. [SQLSTATE 42000] (Error 5069) Database
state cannot be changed while other users are using the
database 'myDBName' [SQLSTATE 42000] (Error 5070)
sp_dboption command failed. [SQLSTATE 01000] (Error
15627). The step failed.sql

log shipping restore failure

I don't understand, have sql 2000 on a win2000server. I set the sqlserver to
startup using the ./administrator account.
I use Windows XP on my destkop and use desktop connection to get to the
server. I log on as the administrator account.
I created a log shipping maintenance plan. As long as I am logged on to the
server, and use the SA account to register the servers in in Ent Manager.
The jobs ALL run fine. Until I log off. Once off, the jobs all go to hell..
The restores all start to fail. The backups still work, but the restores
fail. This happens every time I recreate the jobs. I get the following
erron on the restore
.....Executed as user: CHLSNT010\Administrator. sqlmaint.exe failed.
[SQLSTATE 42000] (Error 22029). The step failed.
I can't find anything on error 22029.
Can anyone help with this.
Thanks
Gordon
You'll find more details when you right click on the plan and view history
or details ..
"gordon" <gordon@.discussions.microsoft.com> wrote in message
news:EBFCF72E-CE7A-4660-9C4C-812BEE4336E6@.microsoft.com...
> I don't understand, have sql 2000 on a win2000server. I set the sqlserver
to
> startup using the ./administrator account.
> I use Windows XP on my destkop and use desktop connection to get to the
> server. I log on as the administrator account.
> I created a log shipping maintenance plan. As long as I am logged on to
the
> server, and use the SA account to register the servers in in Ent Manager.
> The jobs ALL run fine. Until I log off. Once off, the jobs all go to
hell..
> The restores all start to fail. The backups still work, but the restores
> fail. This happens every time I recreate the jobs. I get the following
> erron on the restore
> ....Executed as user: CHLSNT010\Administrator. sqlmaint.exe failed.
> [SQLSTATE 42000] (Error 22029). The step failed.
> I can't find anything on error 22029.
> Can anyone help with this.
> Thanks
> Gordon
|||Yes, there is no failure there. Only as below. Any ideas why?
"Hassan" wrote:

> You'll find more details when you right click on the plan and view history
> or details ..
> "gordon" <gordon@.discussions.microsoft.com> wrote in message
> news:EBFCF72E-CE7A-4660-9C4C-812BEE4336E6@.microsoft.com...
> to
> the
> hell..
>
>

Log Shipping Restore Failing

**PLEASE help. Restore of Log Shippng is failing**
Job error is: sqlmaint.exe failed. [SQLSTATE 42000] (Error 22029). The step failed.
Detailed output of the job says: [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 4305: [Microsoft][ODBC SQL Server Driver][SQL Server]The log in this backup set begins at LSN 31433000001386500001, which is too late to apply to the database. An earlier lo
g backup that includes LSN 314320
00002000300001 can be restored.[Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE LOG is terminating abnormally. (null) [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 4305: [Microsoft][ODBC SQL Server Driver][SQL Server]The log in this backup set be
gins at LSN 31433000001386500001, which is too late to apply to the database. An earlier log backup that includes LSN 31432000002000300001 can be restored. [Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE LOG is terminating abnormally.(null) [Micros
oft SQL-DMO (ODBC SQLState: 42000)] Error 3201: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open backup device 'D:\SHIPPEDLOGS\LVBOEProd_tlog_200406272345.TRN'. Device error or device off-line. See the SQL Server error log for more details.[Micr
osoft][ODBC SQL Server Driver][SQL Server]RESTORE LOG is terminating abnormally.(null Loaded 0 files
**All of my shares/directories are correct. I have tried this at least a dozen times. It was successfull the 1st time the restore ran, but after that it has failed every time.
VC,
have a look at your chain of log backups and the log-shipping monitor. See
if you have any logs before 27th June 11:45pm which haven't been transfered
and/or restored. Manually restoring these 'missing' logs then restarting the
logshipping job should fix the problem.
HTH,
Paul Ibison
|||Paul, thank you very much for your reply. this is very important that i get this working ASAP. i have been fighting this day in and day out.
i re-did the log shipping and it's the same problem. do you have an email account that i can email the log to. it has been appending since the 1st restore. you can email me at v_c@.hotmail.com and i'll reply with the log.
there are no files earlier than the 1st file. in fact, this time around, it was successful.
|||VC,
no need to send over the log - it won't help me solve your issue.
I suspect that someone inadvertantly truncated the transaction log before
the first backup and hence the log sequence numbers were out of sync.
Alternatively it could be that the databases themselves were initially out
of sync. You could use LogExplorer (even the evaluation edn) to test if the
former is the case - to see if there are some records missing from the log.
Still, if it's running OK now then fine.
Regards,
Paul Ibison
|||VC,
no need to send over the log - it won't help me solve your issue.
I suspect that someone inadvertantly truncated the transaction log before
the first backup and hence the log sequence numbers were out of sync.
Alternatively it could be that the databases themselves were initially out
of sync. You could use LogExplorer (even the evaluation edn) to test if the
former is the case - to see if there are some records missing from the log.
Still, if it's running OK now then fine.
Regards,
Paul Ibison
|||i was doing this all night, like 2 in the morning. i doubt anyone was truncating logs. however, this is a good suspicion. any other ideas how the log could have gotten truncated?
|||i was doing this all night, like 2 in the morning. i doubt anyone was truncating logs. however, this is a good suspicion. any other ideas how the log could have gotten truncated?
|||2am - and I thought I worked too long hours ;-)
No other ideas really about how else your log got truncated.
I'd check out the transaction log using a 3rd party tool to try to make
sense of it.
Regards,
Paul Ibison
|||2am - and I thought I worked too long hours ;-)
No other ideas really about how else your log got truncated.
I'd check out the transaction log using a 3rd party tool to try to make
sense of it.
Regards,
Paul Ibison

Log Shipping restore failing

I have a log shipping configuration set up that has been working for several weeks now. Last night starting at about 12:30 am the restore job has started failing periodically. It has gotten worse as the day has gone on, and the job history shows the same
error message each time it fails.
Executed as user: PROMAXONLINE\svcsql. sqlmaint.exe failed. [SQLSTATE 42000] (Error 22029). The step failed.
Can anyone tell me what this means? I am aware of the problem of nameing a directory with a -S in the name, and this is not the case here.
TIA,
Ken
Right-click on the maintenance plan name (not the SQL Agent Job) and select
Maintenance Plan History... for a more detailed error message.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Ken Krause" <anonymous@.discussions.microsoft.com> wrote in message
news:E8A88DA1-CAAA-45DB-A063-A4D5315D20F0@.microsoft.com...
> I have a log shipping configuration set up that has been working for
several weeks now. Last night starting at about 12:30 am the restore job has
started failing periodically. It has gotten worse as the day has gone on,
and the job history shows the same error message each time it fails.
> Executed as user: PROMAXONLINE\svcsql. sqlmaint.exe failed. [SQLSTATE
42000] (Error 22029). The step failed.
> Can anyone tell me what this means? I am aware of the problem of nameing
a directory with a -S in the name, and this is not the case here.
> TIA,
> Ken
|||I have since found out that running indexing operations on the database while the log shipping file is being created can cause this problem, and that's exactly what happened. My next question is how do I get past a corrupted transaction log file without s
crewing up the whole chain of transaction logs? The rest are stacking up behind it every 15 minutes because this one log file won't restore.
Thanks,
Ken
|||Since the log sequence is broken, you will likely have to re-initialize log
shipping with a full backup-restore.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Ken Krause" <anonymous@.discussions.microsoft.com> wrote in message
news:DC38D04C-0745-400C-8F83-290F3EF46369@.microsoft.com...
> I have since found out that running indexing operations on the database
while the log shipping file is being created can cause this problem, and
that's exactly what happened. My next question is how do I get past a
corrupted transaction log file without screwing up the whole chain of
transaction logs? The rest are stacking up behind it every 15 minutes
because this one log file won't restore.
> Thanks,
> Ken

Log Shipping restore failing

I have a log shipping configuration set up that has been working for several weeks now. Last night starting at about 12:30 am the restore job has started failing periodically. It has gotten worse as the day has gone on, and the job history shows the same error message each time it fails
Executed as user: PROMAXONLINE\svcsql. sqlmaint.exe failed. [SQLSTATE 42000] (Error 22029). The step failed
Can anyone tell me what this means? I am aware of the problem of nameing a directory with a -S in the name, and this is not the case here
TIA
KenRight-click on the maintenance plan name (not the SQL Agent Job) and select
Maintenance Plan History... for a more detailed error message.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Ken Krause" <anonymous@.discussions.microsoft.com> wrote in message
news:E8A88DA1-CAAA-45DB-A063-A4D5315D20F0@.microsoft.com...
> I have a log shipping configuration set up that has been working for
several weeks now. Last night starting at about 12:30 am the restore job has
started failing periodically. It has gotten worse as the day has gone on,
and the job history shows the same error message each time it fails.
> Executed as user: PROMAXONLINE\svcsql. sqlmaint.exe failed. [SQLSTATE
42000] (Error 22029). The step failed.
> Can anyone tell me what this means? I am aware of the problem of nameing
a directory with a -S in the name, and this is not the case here.
> TIA,
> Ken|||Since the log sequence is broken, you will likely have to re-initialize log
shipping with a full backup-restore.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Ken Krause" <anonymous@.discussions.microsoft.com> wrote in message
news:DC38D04C-0745-400C-8F83-290F3EF46369@.microsoft.com...
> I have since found out that running indexing operations on the database
while the log shipping file is being created can cause this problem, and
that's exactly what happened. My next question is how do I get past a
corrupted transaction log file without screwing up the whole chain of
transaction logs? The rest are stacking up behind it every 15 minutes
because this one log file won't restore.
> Thanks,
> Ken

Log Shipping restore failing

I have a log shipping configuration set up that has been working for several
weeks now. Last night starting at about 12:30 am the restore job has starte
d failing periodically. It has gotten worse as the day has gone on, and the
job history shows the same
error message each time it fails.
Executed as user: PROMAXONLINE\svcsql. sqlmaint.exe failed. [SQLSTATE 42
000] (Error 22029). The step failed.
Can anyone tell me what this means? I am aware of the problem of nameing a
directory with a -S in the name, and this is not the case here.
TIA,
KenRight-click on the maintenance plan name (not the SQL Agent Job) and select
Maintenance Plan History... for a more detailed error message.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Ken Krause" <anonymous@.discussions.microsoft.com> wrote in message
news:E8A88DA1-CAAA-45DB-A063-A4D5315D20F0@.microsoft.com...
> I have a log shipping configuration set up that has been working for
several weeks now. Last night starting at about 12:30 am the restore job has
started failing periodically. It has gotten worse as the day has gone on,
and the job history shows the same error message each time it fails.
> Executed as user: PROMAXONLINE\svcsql. sqlmaint.exe failed. [SQLSTATE
42000] (Error 22029). The step failed.
> Can anyone tell me what this means? I am aware of the problem of nameing
a directory with a -S in the name, and this is not the case here.
> TIA,
> Ken|||I have since found out that running indexing operations on the database whil
e the log shipping file is being created can cause this problem, and that's
exactly what happened. My next question is how do I get past a corrupted tra
nsaction log file without s
crewing up the whole chain of transaction logs? The rest are stacking up beh
ind it every 15 minutes because this one log file won't restore.
Thanks,
Ken|||Since the log sequence is broken, you will likely have to re-initialize log
shipping with a full backup-restore.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Ken Krause" <anonymous@.discussions.microsoft.com> wrote in message
news:DC38D04C-0745-400C-8F83-290F3EF46369@.microsoft.com...
> I have since found out that running indexing operations on the database
while the log shipping file is being created can cause this problem, and
that's exactly what happened. My next question is how do I get past a
corrupted transaction log file without screwing up the whole chain of
transaction logs? The rest are stacking up behind it every 15 minutes
because this one log file won't restore.
> Thanks,
> Kensql

Log Shipping Restore Failed - How do I find out why?

I set up log shipping for a database to fire every 10 mins. All the steps on
both servers work the first two times. On the 3rd 10 min interval, the log
bkp is created on the source server and is copied to the destination server.
However, the SQL Agent step, "Log Shipping Restore for
SERVER.APPDB_logshipping" shows failure. The log bkp files are in the
appropriate destination server folder but the restore does not work any more.
Plus, the event interval on the SQL Agent jobs destination server were
showing every 10 mins but now are showing every 15 mins.
How can I determine what happened and how to fix it?
Picine Karppehd
A newbie to VB.Net,
pretty good with VB6,
Certified with SQLServer
Even I was facing the similar issue. Whenever there was huge tlog backups,
restore job in the destination server used to fail. I increased the re-try
attempts by 1 after 1 minute for copy as well as restore job in the
destination server. And it seems to be running fine since.
To do the above, go to the restore job in your destination server,
properties, step, advanced, retry attempts...
HTH
GYK
"Picine Karppehd" wrote:

> I set up log shipping for a database to fire every 10 mins. All the steps on
> both servers work the first two times. On the 3rd 10 min interval, the log
> bkp is created on the source server and is copied to the destination server.
> However, the SQL Agent step, "Log Shipping Restore for
> SERVER.APPDB_logshipping" shows failure. The log bkp files are in the
> appropriate destination server folder but the restore does not work any more.
> Plus, the event interval on the SQL Agent jobs destination server were
> showing every 10 mins but now are showing every 15 mins.
> How can I determine what happened and how to fix it?
> --
> Picine Karppehd
> A newbie to VB.Net,
> pretty good with VB6,
> Certified with SQLServer
|||Picine,
Try restoring the copied log file yourself using Query Analyzer and if
there's an error, what the message is.
Ron
Ron Talmage
SQL Server MVP
"Picine Karppehd" <PicineKarppehd@.hotmail.com.(donotspam)> wrote in message
news:2618C571-9B99-4365-94EC-B22927DF46B9@.microsoft.com...
> I set up log shipping for a database to fire every 10 mins. All the steps
on
> both servers work the first two times. On the 3rd 10 min interval, the
log
> bkp is created on the source server and is copied to the destination
server.
> However, the SQL Agent step, "Log Shipping Restore for
> SERVER.APPDB_logshipping" shows failure. The log bkp files are in the
> appropriate destination server folder but the restore does not work any
more.
> Plus, the event interval on the SQL Agent jobs destination server were
> showing every 10 mins but now are showing every 15 mins.
> How can I determine what happened and how to fix it?
> --
> Picine Karppehd
> A newbie to VB.Net,
> pretty good with VB6,
> Certified with SQLServer

Log Shipping Restore Failed - How do I find out why?

I set up log shipping for a database to fire every 10 mins. All the steps o
n
both servers work the first two times. On the 3rd 10 min interval, the log
bkp is created on the source server and is copied to the destination server.
However, the SQL Agent step, "Log Shipping Restore for
SERVER.APPDB_logshipping" shows failure. The log bkp files are in the
appropriate destination server folder but the restore does not work any more
.
Plus, the event interval on the SQL Agent jobs destination server were
showing every 10 mins but now are showing every 15 mins.
How can I determine what happened and how to fix it?
Picine Karppehd
A newbie to VB.Net,
pretty good with VB6,
Certified with SQLServerEven I was facing the similar issue. Whenever there was huge tlog backups,
restore job in the destination server used to fail. I increased the re-try
attempts by 1 after 1 minute for copy as well as restore job in the
destination server. And it seems to be running fine since.
To do the above, go to the restore job in your destination server,
properties, step, advanced, retry attempts...
HTH
GYK
"Picine Karppehd" wrote:

> I set up log shipping for a database to fire every 10 mins. All the steps
on
> both servers work the first two times. On the 3rd 10 min interval, the lo
g
> bkp is created on the source server and is copied to the destination serve
r.
> However, the SQL Agent step, "Log Shipping Restore for
> SERVER.APPDB_logshipping" shows failure. The log bkp files are in the
> appropriate destination server folder but the restore does not work any mo
re.
> Plus, the event interval on the SQL Agent jobs destination server were
> showing every 10 mins but now are showing every 15 mins.
> How can I determine what happened and how to fix it?
> --
> Picine Karppehd
> A newbie to VB.Net,
> pretty good with VB6,
> Certified with SQLServer|||Picine,
Try restoring the copied log file yourself using Query Analyzer and if
there's an error, what the message is.
Ron
--
Ron Talmage
SQL Server MVP
"Picine Karppehd" <PicineKarppehd@.hotmail.com.(donotspam)> wrote in message
news:2618C571-9B99-4365-94EC-B22927DF46B9@.microsoft.com...
> I set up log shipping for a database to fire every 10 mins. All the steps
on
> both servers work the first two times. On the 3rd 10 min interval, the
log
> bkp is created on the source server and is copied to the destination
server.
> However, the SQL Agent step, "Log Shipping Restore for
> SERVER.APPDB_logshipping" shows failure. The log bkp files are in the
> appropriate destination server folder but the restore does not work any
more.
> Plus, the event interval on the SQL Agent jobs destination server were
> showing every 10 mins but now are showing every 15 mins.
> How can I determine what happened and how to fix it?
> --
> Picine Karppehd
> A newbie to VB.Net,
> pretty good with VB6,
> Certified with SQLServer

Log Shipping Restore Failed - How do I find out why?

I set up log shipping for a database to fire every 10 mins. All the steps on
both servers work the first two times. On the 3rd 10 min interval, the log
bkp is created on the source server and is copied to the destination server.
However, the SQL Agent step, "Log Shipping Restore for
SERVER.APPDB_logshipping" shows failure. The log bkp files are in the
appropriate destination server folder but the restore does not work any more.
Plus, the event interval on the SQL Agent jobs destination server were
showing every 10 mins but now are showing every 15 mins.
How can I determine what happened and how to fix it?
--
Picine Karppehd
A newbie to VB.Net,
pretty good with VB6,
Certified with SQLServerEven I was facing the similar issue. Whenever there was huge tlog backups,
restore job in the destination server used to fail. I increased the re-try
attempts by 1 after 1 minute for copy as well as restore job in the
destination server. And it seems to be running fine since.
To do the above, go to the restore job in your destination server,
properties, step, advanced, retry attempts...
HTH
GYK
"Picine Karppehd" wrote:
> I set up log shipping for a database to fire every 10 mins. All the steps on
> both servers work the first two times. On the 3rd 10 min interval, the log
> bkp is created on the source server and is copied to the destination server.
> However, the SQL Agent step, "Log Shipping Restore for
> SERVER.APPDB_logshipping" shows failure. The log bkp files are in the
> appropriate destination server folder but the restore does not work any more.
> Plus, the event interval on the SQL Agent jobs destination server were
> showing every 10 mins but now are showing every 15 mins.
> How can I determine what happened and how to fix it?
> --
> Picine Karppehd
> A newbie to VB.Net,
> pretty good with VB6,
> Certified with SQLServer|||Picine,
Try restoring the copied log file yourself using Query Analyzer and if
there's an error, what the message is.
Ron
--
Ron Talmage
SQL Server MVP
"Picine Karppehd" <PicineKarppehd@.hotmail.com.(donotspam)> wrote in message
news:2618C571-9B99-4365-94EC-B22927DF46B9@.microsoft.com...
> I set up log shipping for a database to fire every 10 mins. All the steps
on
> both servers work the first two times. On the 3rd 10 min interval, the
log
> bkp is created on the source server and is copied to the destination
server.
> However, the SQL Agent step, "Log Shipping Restore for
> SERVER.APPDB_logshipping" shows failure. The log bkp files are in the
> appropriate destination server folder but the restore does not work any
more.
> Plus, the event interval on the SQL Agent jobs destination server were
> showing every 10 mins but now are showing every 15 mins.
> How can I determine what happened and how to fix it?
> --
> Picine Karppehd
> A newbie to VB.Net,
> pretty good with VB6,
> Certified with SQLServer

log shipping restore fail

We've been experiencing above average "Log Shipping
Restore" fails. All copy and restore can be worked for
first two or three times. For no apparent reason, the job
of log shipping restore fails. I checked the windows event
viewer,the message is "SQL Server Scheduled Job 'Log
Shipping Restore for Test2.NorthwindCopy_logshipping'
(0x63382D0A9860D541B191C36DCB658480) - Status: Failed -
Invoked on: 2003-10-31 12:30:00 - Message: The job
failed. The Job was invoked by Schedule 12 (Schedule 1).
The last step to run was step 1 (Log Shipping Restore)."
I'm sure that disk space and netowkr access isn't an issue
and the secondary server isn't busy.Anyone knows what
might cause this .Thanks.Are users accessing the database at the time of failure?
Can you run the restore command yourself? Does it work?
You can get more information regarding log shipping here:
http://sqlguy.home.comcast.net/logship.htm
-- Keith
"kelly" <kelly_lu@.kingston.com.tw> wrote in message =news:45bd01c39f73$9f9f2b90$7d02280a@.phx.gbl...
> We've been experiencing above average "Log Shipping > Restore" fails. All copy and restore can be worked for > first two or three times. For no apparent reason, the job > of log shipping restore fails. I checked the windows event > viewer,the message is "SQL Server Scheduled Job 'Log > Shipping Restore for Test2.NorthwindCopy_logshipping' > (0x63382D0A9860D541B191C36DCB658480) - Status: Failed - > Invoked on: 2003-10-31 12:30:00 - Message: The job > failed. The Job was invoked by Schedule 12 (Schedule 1). > The last step to run was step 1 (Log Shipping Restore)."
> I'm sure that disk space and netowkr access isn't an issue > and the secondary server isn't busy.Anyone knows what > might cause this .Thanks. >

Log Shipping Restore Error 3456

Hi,
I've got a production server log shipping a 280GB database to a remote DR
site server. It has been running without incident for months now, but last
week it stopped restoring logs (the copy process was still running) with an
error 3456:
[Microsoft SQL-DMO (ODBC SQLState: HY000)] Error 3456: [Microsoft][ODBC SQL
Server Driver][SQL Server]Could not redo log record (500478:68225:4), for
transaction ID (3:1085081790), on page (3:2789016), database 'JDE_Prod' (5).
Page: LSN = (500478:57038:10), type = 2. Log: OpCode = 2, context 3,
PrevPageLSN: (500478:68221:4).
I restored the remote database from a full tape backup shipped to the site
via courier (because we weren't sure if the link was to blame for the problem
restoring). Log shipping worked well again for a few days, but this morning
has again stopped restoring with the exact same error!
I've read the article "http://support.microsoft.com/kb/831950", and although
it describes the same error, it doesnt seem to apply to us as we weren't
doing any role changing, and weren't backing up the database manually with
the NORECOVERY switch (i.e. the backups were being done as usual by the log
shipping maint. plan).
Local server build is 8.00.997, and remote (DR) server build is 8.00.818.
Could the fact that they are slightly different versions have anything to do
with this problem?
Could this be corruption introducted by the network link? If so, is the
only way to fix this to fully restore the database again? Or is there some
way to get good copies of the log it failed on and restore those manually? I
don't have a huge amount of experience with log shipping, so any help would
be greatly appreciated - especially being a 24/7 mission critical DR server,
and in the middle of the holidays! Murphy's Law!
Thanks,
david
Hi David
The SQL Builds may cause a problem. I am not sure about it.
Rearding the file restore; it isn't necessary that you restore the entire
db. I would suggest the following steps:
1) Check the table msdb..log_shipping_plan_history for the last loaded file.
try
select * from msdb..log_shipping_plan_history order by endtime desc
2) Try restoring tha tfile manually from the Query Analyzer. try
restore log
<db_name>
from
disk = 'file_path'
with
standby = 'undo.txt'
3) if the above step succeeds keep restoring the successive trn files till
the step fails. Then that file at which the step fails is the corrupt file.
4) Copy only that file from the primary server and try step 2 with it.
5) re-run the LS Jobs and the ywill succeed.
Hope this helps.
I shall get back with mpre information about the affect of SQL builds on LS.
Thanks
Amer M J
MCP
"DavidCur" wrote:

> Hi,
> I've got a production server log shipping a 280GB database to a remote DR
> site server. It has been running without incident for months now, but last
> week it stopped restoring logs (the copy process was still running) with an
> error 3456:
> [Microsoft SQL-DMO (ODBC SQLState: HY000)] Error 3456: [Microsoft][ODBC SQL
> Server Driver][SQL Server]Could not redo log record (500478:68225:4), for
> transaction ID (3:1085081790), on page (3:2789016), database 'JDE_Prod' (5).
> Page: LSN = (500478:57038:10), type = 2. Log: OpCode = 2, context 3,
> PrevPageLSN: (500478:68221:4).
> I restored the remote database from a full tape backup shipped to the site
> via courier (because we weren't sure if the link was to blame for the problem
> restoring). Log shipping worked well again for a few days, but this morning
> has again stopped restoring with the exact same error!
> I've read the article "http://support.microsoft.com/kb/831950", and although
> it describes the same error, it doesnt seem to apply to us as we weren't
> doing any role changing, and weren't backing up the database manually with
> the NORECOVERY switch (i.e. the backups were being done as usual by the log
> shipping maint. plan).
> Local server build is 8.00.997, and remote (DR) server build is 8.00.818.
> Could the fact that they are slightly different versions have anything to do
> with this problem?
> Could this be corruption introducted by the network link? If so, is the
> only way to fix this to fully restore the database again? Or is there some
> way to get good copies of the log it failed on and restore those manually? I
> don't have a huge amount of experience with log shipping, so any help would
> be greatly appreciated - especially being a 24/7 mission critical DR server,
> and in the middle of the holidays! Murphy's Law!
>
> Thanks,
> david
|||Thanks for the quick response. The log files are copied and restored every
15 minutes. The problem occurred this morning around 12:15am. I've tried
your suggestion about restoring manually with the standby undo file.
I ran the following command (using the 12:00am file) successfully, but the
12:15am file produces the following output:
restore log JDE_Prod
from disk = 'K:\Backups\DRLogsIn\JDE_Prod_tlog_200512300015.TR N'
with standby = 'K:\Backups\DRLogsIn\LogUndo.tuf'
Deleting database file 'K:\Backups\DRLogsIn\LogUndo.tuf'.
Processed 34415 pages for database 'JDE_Prod', file 'JDE_PRODUCTION_log' on
file 1.
Server: Msg 3456, Level 21, State 1, Line 1
Could not redo log record (500478:68225:4), for transaction ID
(3:1085081790), on page (3:2789016), database 'JDE_Prod' (5). Page: LSN =
(500478:57038:10), type = 2. Log: OpCode = 2, context 3, PrevPageLSN:
(500478:68221:4).
Connection Broken
This 12:15 file has already been re-copied, but I will try again.
Would be interesting to see if you find any issues with different builds in
log shipping. The patches were applied to the local server a few months ago
(3 or 4 months), and log shipping has been running without incident this
whole time.
Thanks again,
Dave
"Amer M J" wrote:

> Hi David
> The SQL Builds may cause a problem. I am not sure about it.
> Rearding the file restore; it isn't necessary that you restore the entire
> db. I would suggest the following steps:
> 1) Check the table msdb..log_shipping_plan_history for the last loaded file.
> try
> select * from msdb..log_shipping_plan_history order by endtime desc
> 2) Try restoring tha tfile manually from the Query Analyzer. try
> restore log
> <db_name>
> from
> disk = 'file_path'
> with
> standby = 'undo.txt'
> 3) if the above step succeeds keep restoring the successive trn files till
> the step fails. Then that file at which the step fails is the corrupt file.
> 4) Copy only that file from the primary server and try step 2 with it.
> 5) re-run the LS Jobs and the ywill succeed.
> Hope this helps.
> I shall get back with mpre information about the affect of SQL builds on LS.
> Thanks
> Amer M J
> MCP
|||Hi Dave
I am curious here. Was the '.tuf' file deleted as per a part of the process
of manually ?
Also the builds do play a major role here. From what I can see as per your
information, the primary server is of a higher build than the secondary
server. So I was wondering how a log file of a db from a higher build was
getting restored onto a lower build server.
Also I would suggest checking out the integrity of the trn files on the
primary server. try
restore verifyonly command to check the backup set's integrity.
Please do check if anyother process is accessing the db on the secondary
server as this may disrupt the LS process.
Also check this link.
http://support.microsoft.com/kb/329487/en-us
Thanks
Amer M J
MCP
"DavidCur" wrote:
[vbcol=seagreen]
> Thanks for the quick response. The log files are copied and restored every
> 15 minutes. The problem occurred this morning around 12:15am. I've tried
> your suggestion about restoring manually with the standby undo file.
> I ran the following command (using the 12:00am file) successfully, but the
> 12:15am file produces the following output:
> restore log JDE_Prod
> from disk = 'K:\Backups\DRLogsIn\JDE_Prod_tlog_200512300015.TR N'
> with standby = 'K:\Backups\DRLogsIn\LogUndo.tuf'
> Deleting database file 'K:\Backups\DRLogsIn\LogUndo.tuf'.
> Processed 34415 pages for database 'JDE_Prod', file 'JDE_PRODUCTION_log' on
> file 1.
> Server: Msg 3456, Level 21, State 1, Line 1
> Could not redo log record (500478:68225:4), for transaction ID
> (3:1085081790), on page (3:2789016), database 'JDE_Prod' (5). Page: LSN =
> (500478:57038:10), type = 2. Log: OpCode = 2, context 3, PrevPageLSN:
> (500478:68221:4).
> Connection Broken
> This 12:15 file has already been re-copied, but I will try again.
> Would be interesting to see if you find any issues with different builds in
> log shipping. The patches were applied to the local server a few months ago
> (3 or 4 months), and log shipping has been running without incident this
> whole time.
> Thanks again,
> Dave
>
> "Amer M J" wrote:
|||Hi again,
Yes, the standby file (whatever it has been called) is automatically deleted
by the restore process.
Good news though, I seem to have log shipping going again! :-)
I re-copied the 12:15am log file (yet again, 3rd time) and restored it with
the same syntax as in my previous post, and it worked. So the problem must
lie with our link to the remote DR server. Its now been logged to the
telecom company who provide the WAN pipe.
As a precautionary measure I will schedule the remote server to be patched
to the same build level as our local server (will be next year though as we
are in a "holiday change freeze" now).
Funnily enough, the restore headeronly, verifyonly and filelistonly all
seemed to work fine with the corrupt file. Is it possible that the header of
the file was okay, while the actual data was bad?
Thanks very much for the help though, and I will update with anything new we
find.
Dave
"Amer M J" wrote:

> Hi Dave
> I am curious here. Was the '.tuf' file deleted as per a part of the process
> of manually ?
> Also the builds do play a major role here. From what I can see as per your
> information, the primary server is of a higher build than the secondary
> server. So I was wondering how a log file of a db from a higher build was
> getting restored onto a lower build server.
> Also I would suggest checking out the integrity of the trn files on the
> primary server. try
> restore verifyonly command to check the backup set's integrity.
> Please do check if anyother process is accessing the db on the secondary
> server as this may disrupt the LS process.
> Also check this link.
> http://support.microsoft.com/kb/329487/en-us
> Thanks
> Amer M J
> MCP
sql

Log Shipping Restore Error 3456

Hi,
I've got a production server log shipping a 280GB database to a remote DR
site server. It has been running without incident for months now, but last
week it stopped restoring logs (the copy process was still running) with an
error 3456:
[Microsoft SQL-DMO (ODBC SQLState: HY000)] Error 3456: [Microsoft]&#
91;ODBC SQL
Server Driver][SQL Server]Could not redo log record (500478:68225:4), fo
r
transaction ID (3:1085081790), on page (3:2789016), database 'JDE_Prod' (5).
Page: LSN = (500478:57038:10), type = 2. Log: OpCode = 2, context 3,
PrevPageLSN: (500478:68221:4).
I restored the remote database from a full tape backup shipped to the site
via courier (because we weren't sure if the link was to blame for the proble
m
restoring). Log shipping worked well again for a few days, but this morning
has again stopped restoring with the exact same error!
I've read the article "http://support.microsoft.com/kb/831950", and although
it describes the same error, it doesnt seem to apply to us as we weren't
doing any role changing, and weren't backing up the database manually with
the NORECOVERY switch (i.e. the backups were being done as usual by the log
shipping maint. plan).
Local server build is 8.00.997, and remote (DR) server build is 8.00.818.
Could the fact that they are slightly different versions have anything to do
with this problem?
Could this be corruption introducted by the network link? If so, is the
only way to fix this to fully restore the database again? Or is there some
way to get good copies of the log it failed on and restore those manually?
I
don't have a huge amount of experience with log shipping, so any help would
be greatly appreciated - especially being a 24/7 mission critical DR server,
and in the middle of the holidays! Murphy's Law!
Thanks,
davidHi David
The SQL Builds may cause a problem. I am not sure about it.
Rearding the file restore; it isn't necessary that you restore the entire
db. I would suggest the following steps:
1) Check the table msdb..log_shipping_plan_history for the last loaded file.
try
select * from msdb..log_shipping_plan_history order by endtime desc
2) Try restoring tha tfile manually from the Query Analyzer. try
restore log
<db_name>
from
disk = 'file_path'
with
standby = 'undo.txt'
3) if the above step succeeds keep restoring the successive trn files till
the step fails. Then that file at which the step fails is the corrupt file.
4) Copy only that file from the primary server and try step 2 with it.
5) re-run the LS Jobs and the ywill succeed.
Hope this helps.
I shall get back with mpre information about the affect of SQL builds on LS.
Thanks
Amer M J
MCP
"DavidCur" wrote:

> Hi,
> I've got a production server log shipping a 280GB database to a remote DR
> site server. It has been running without incident for months now, but las
t
> week it stopped restoring logs (the copy process was still running) with a
n
> error 3456:
> [Microsoft SQL-DMO (ODBC SQLState: HY000)] Error 3456: [Microsoft]
[ODBC SQL
> Server Driver][SQL Server]Could not redo log record (500478:68225:4),
for
> transaction ID (3:1085081790), on page (3:2789016), database 'JDE_Prod' (5
).
> Page: LSN = (500478:57038:10), type = 2. Log: OpCode = 2, context 3,
> PrevPageLSN: (500478:68221:4).
> I restored the remote database from a full tape backup shipped to the site
> via courier (because we weren't sure if the link was to blame for the prob
lem
> restoring). Log shipping worked well again for a few days, but this morni
ng
> has again stopped restoring with the exact same error!
> I've read the article "http://support.microsoft.com/kb/831950", and althou
gh
> it describes the same error, it doesnt seem to apply to us as we weren't
> doing any role changing, and weren't backing up the database manually with
> the NORECOVERY switch (i.e. the backups were being done as usual by the lo
g
> shipping maint. plan).
> Local server build is 8.00.997, and remote (DR) server build is 8.00.818.
> Could the fact that they are slightly different versions have anything to
do
> with this problem?
> Could this be corruption introducted by the network link? If so, is the
> only way to fix this to fully restore the database again? Or is there some
> way to get good copies of the log it failed on and restore those manually?
I
> don't have a huge amount of experience with log shipping, so any help woul
d
> be greatly appreciated - especially being a 24/7 mission critical DR serve
r,
> and in the middle of the holidays! Murphy's Law!
>
> Thanks,
> david|||Thanks for the quick response. The log files are copied and restored every
15 minutes. The problem occurred this morning around 12:15am. I've tried
your suggestion about restoring manually with the standby undo file.
I ran the following command (using the 12:00am file) successfully, but the
12:15am file produces the following output:
---
restore log JDE_Prod
from disk = 'K:\Backups\DRLogsIn\JDE_Prod_tlog_20051
2300015.TRN'
with standby = 'K:\Backups\DRLogsIn\LogUndo.tuf'
---
Deleting database file 'K:\Backups\DRLogsIn\LogUndo.tuf'.
Processed 34415 pages for database 'JDE_Prod', file 'JDE_PRODUCTION_log' on
file 1.
Server: Msg 3456, Level 21, State 1, Line 1
Could not redo log record (500478:68225:4), for transaction ID
(3:1085081790), on page (3:2789016), database 'JDE_Prod' (5). Page: LSN =
(500478:57038:10), type = 2. Log: OpCode = 2, context 3, PrevPageLSN:
(500478:68221:4).
Connection Broken
---
This 12:15 file has already been re-copied, but I will try again.
Would be interesting to see if you find any issues with different builds in
log shipping. The patches were applied to the local server a few months ago
(3 or 4 months), and log shipping has been running without incident this
whole time.
Thanks again,
Dave
"Amer M J" wrote:

> Hi David
> The SQL Builds may cause a problem. I am not sure about it.
> Rearding the file restore; it isn't necessary that you restore the entire
> db. I would suggest the following steps:
> 1) Check the table msdb..log_shipping_plan_history for the last loaded fil
e.
> try
> select * from msdb..log_shipping_plan_history order by endtime desc
> 2) Try restoring tha tfile manually from the Query Analyzer. try
> restore log
> <db_name>
> from
> disk = 'file_path'
> with
> standby = 'undo.txt'
> 3) if the above step succeeds keep restoring the successive trn files till
> the step fails. Then that file at which the step fails is the corrupt file
.
> 4) Copy only that file from the primary server and try step 2 with it.
> 5) re-run the LS Jobs and the ywill succeed.
> Hope this helps.
> I shall get back with mpre information about the affect of SQL builds on L
S.
> Thanks
> Amer M J
> MCP|||Hi Dave
I am curious here. Was the '.tuf' file deleted as per a part of the process
of manually ?
Also the builds do play a major role here. From what I can see as per your
information, the primary server is of a higher build than the secondary
server. So I was wondering how a log file of a db from a higher build was
getting restored onto a lower build server.
Also I would suggest checking out the integrity of the trn files on the
primary server. try
restore verifyonly command to check the backup set's integrity.
Please do check if anyother process is accessing the db on the secondary
server as this may disrupt the LS process.
Also check this link.
http://support.microsoft.com/kb/329487/en-us
Thanks
Amer M J
MCP
"DavidCur" wrote:
[vbcol=seagreen]
> Thanks for the quick response. The log files are copied and restored ever
y
> 15 minutes. The problem occurred this morning around 12:15am. I've tried
> your suggestion about restoring manually with the standby undo file.
> I ran the following command (using the 12:00am file) successfully, but the
> 12:15am file produces the following output:
> ---
> restore log JDE_Prod
> from disk = 'K:\Backups\DRLogsIn\JDE_Prod_tlog_20051
2300015.TRN'
> with standby = 'K:\Backups\DRLogsIn\LogUndo.tuf'
> ---
> Deleting database file 'K:\Backups\DRLogsIn\LogUndo.tuf'.
> Processed 34415 pages for database 'JDE_Prod', file 'JDE_PRODUCTION_log' o
n
> file 1.
> Server: Msg 3456, Level 21, State 1, Line 1
> Could not redo log record (500478:68225:4), for transaction ID
> (3:1085081790), on page (3:2789016), database 'JDE_Prod' (5). Page: LSN =
> (500478:57038:10), type = 2. Log: OpCode = 2, context 3, PrevPageLSN:
> (500478:68221:4).
> Connection Broken
> ---
> This 12:15 file has already been re-copied, but I will try again.
> Would be interesting to see if you find any issues with different builds i
n
> log shipping. The patches were applied to the local server a few months a
go
> (3 or 4 months), and log shipping has been running without incident this
> whole time.
> Thanks again,
> Dave
>
> "Amer M J" wrote:
>|||Hi again,
Yes, the standby file (whatever it has been called) is automatically deleted
by the restore process.
Good news though, I seem to have log shipping going again! :-)
I re-copied the 12:15am log file (yet again, 3rd time) and restored it with
the same syntax as in my previous post, and it worked. So the problem must
lie with our link to the remote DR server. Its now been logged to the
telecom company who provide the WAN pipe.
As a precautionary measure I will schedule the remote server to be patched
to the same build level as our local server (will be next year though as we
are in a "holiday change freeze" now).
Funnily enough, the restore headeronly, verifyonly and filelistonly all
seemed to work fine with the corrupt file. Is it possible that the header o
f
the file was okay, while the actual data was bad'
Thanks very much for the help though, and I will update with anything new we
find.
Dave
"Amer M J" wrote:

> Hi Dave
> I am curious here. Was the '.tuf' file deleted as per a part of the proces
s
> of manually ?
> Also the builds do play a major role here. From what I can see as per your
> information, the primary server is of a higher build than the secondary
> server. So I was wondering how a log file of a db from a higher build was
> getting restored onto a lower build server.
> Also I would suggest checking out the integrity of the trn files on the
> primary server. try
> restore verifyonly command to check the backup set's integrity.
> Please do check if anyother process is accessing the db on the secondary
> server as this may disrupt the LS process.
> Also check this link.
> http://support.microsoft.com/kb/329487/en-us
> Thanks
> Amer M J
> MCP

Log Shipping Restore Error 3456

Hi,
I've got a production server log shipping a 280GB database to a remote DR
site server. It has been running without incident for months now, but last
week it stopped restoring logs (the copy process was still running) with an
error 3456:
[Microsoft SQL-DMO (ODBC SQLState: HY000)] Error 3456: [Microsoft][ODBC SQL
Server Driver][SQL Server]Could not redo log record (500478:68225:4), for
transaction ID (3:1085081790), on page (3:2789016), database 'JDE_Prod' (5).
Page: LSN = (500478:57038:10), type = 2. Log: OpCode = 2, context 3,
PrevPageLSN: (500478:68221:4).
I restored the remote database from a full tape backup shipped to the site
via courier (because we weren't sure if the link was to blame for the problem
restoring). Log shipping worked well again for a few days, but this morning
has again stopped restoring with the exact same error!
I've read the article "http://support.microsoft.com/kb/831950", and although
it describes the same error, it doesnt seem to apply to us as we weren't
doing any role changing, and weren't backing up the database manually with
the NORECOVERY switch (i.e. the backups were being done as usual by the log
shipping maint. plan).
Local server build is 8.00.997, and remote (DR) server build is 8.00.818.
Could the fact that they are slightly different versions have anything to do
with this problem?
Could this be corruption introducted by the network link? If so, is the
only way to fix this to fully restore the database again? Or is there some
way to get good copies of the log it failed on and restore those manually? I
don't have a huge amount of experience with log shipping, so any help would
be greatly appreciated - especially being a 24/7 mission critical DR server,
and in the middle of the holidays! Murphy's Law!
Thanks,
davidHi David
The SQL Builds may cause a problem. I am not sure about it.
Rearding the file restore; it isn't necessary that you restore the entire
db. I would suggest the following steps:
1) Check the table msdb..log_shipping_plan_history for the last loaded file.
try
select * from msdb..log_shipping_plan_history order by endtime desc
2) Try restoring tha tfile manually from the Query Analyzer. try
restore log
<db_name>
from
disk = 'file_path'
with
standby = 'undo.txt'
3) if the above step succeeds keep restoring the successive trn files till
the step fails. Then that file at which the step fails is the corrupt file.
4) Copy only that file from the primary server and try step 2 with it.
5) re-run the LS Jobs and the ywill succeed.
Hope this helps.
I shall get back with mpre information about the affect of SQL builds on LS.
Thanks
Amer M J
MCP
"DavidCur" wrote:
> Hi,
> I've got a production server log shipping a 280GB database to a remote DR
> site server. It has been running without incident for months now, but last
> week it stopped restoring logs (the copy process was still running) with an
> error 3456:
> [Microsoft SQL-DMO (ODBC SQLState: HY000)] Error 3456: [Microsoft][ODBC SQL
> Server Driver][SQL Server]Could not redo log record (500478:68225:4), for
> transaction ID (3:1085081790), on page (3:2789016), database 'JDE_Prod' (5).
> Page: LSN = (500478:57038:10), type = 2. Log: OpCode = 2, context 3,
> PrevPageLSN: (500478:68221:4).
> I restored the remote database from a full tape backup shipped to the site
> via courier (because we weren't sure if the link was to blame for the problem
> restoring). Log shipping worked well again for a few days, but this morning
> has again stopped restoring with the exact same error!
> I've read the article "http://support.microsoft.com/kb/831950", and although
> it describes the same error, it doesnt seem to apply to us as we weren't
> doing any role changing, and weren't backing up the database manually with
> the NORECOVERY switch (i.e. the backups were being done as usual by the log
> shipping maint. plan).
> Local server build is 8.00.997, and remote (DR) server build is 8.00.818.
> Could the fact that they are slightly different versions have anything to do
> with this problem?
> Could this be corruption introducted by the network link? If so, is the
> only way to fix this to fully restore the database again? Or is there some
> way to get good copies of the log it failed on and restore those manually? I
> don't have a huge amount of experience with log shipping, so any help would
> be greatly appreciated - especially being a 24/7 mission critical DR server,
> and in the middle of the holidays! Murphy's Law!
>
> Thanks,
> david|||Thanks for the quick response. The log files are copied and restored every
15 minutes. The problem occurred this morning around 12:15am. I've tried
your suggestion about restoring manually with the standby undo file.
I ran the following command (using the 12:00am file) successfully, but the
12:15am file produces the following output:
---
restore log JDE_Prod
from disk = 'K:\Backups\DRLogsIn\JDE_Prod_tlog_200512300015.TRN'
with standby = 'K:\Backups\DRLogsIn\LogUndo.tuf'
---
Deleting database file 'K:\Backups\DRLogsIn\LogUndo.tuf'.
Processed 34415 pages for database 'JDE_Prod', file 'JDE_PRODUCTION_log' on
file 1.
Server: Msg 3456, Level 21, State 1, Line 1
Could not redo log record (500478:68225:4), for transaction ID
(3:1085081790), on page (3:2789016), database 'JDE_Prod' (5). Page: LSN =(500478:57038:10), type = 2. Log: OpCode = 2, context 3, PrevPageLSN:
(500478:68221:4).
Connection Broken
---
This 12:15 file has already been re-copied, but I will try again.
Would be interesting to see if you find any issues with different builds in
log shipping. The patches were applied to the local server a few months ago
(3 or 4 months), and log shipping has been running without incident this
whole time.
Thanks again,
Dave
"Amer M J" wrote:
> Hi David
> The SQL Builds may cause a problem. I am not sure about it.
> Rearding the file restore; it isn't necessary that you restore the entire
> db. I would suggest the following steps:
> 1) Check the table msdb..log_shipping_plan_history for the last loaded file.
> try
> select * from msdb..log_shipping_plan_history order by endtime desc
> 2) Try restoring tha tfile manually from the Query Analyzer. try
> restore log
> <db_name>
> from
> disk = 'file_path'
> with
> standby = 'undo.txt'
> 3) if the above step succeeds keep restoring the successive trn files till
> the step fails. Then that file at which the step fails is the corrupt file.
> 4) Copy only that file from the primary server and try step 2 with it.
> 5) re-run the LS Jobs and the ywill succeed.
> Hope this helps.
> I shall get back with mpre information about the affect of SQL builds on LS.
> Thanks
> Amer M J
> MCP|||Hi Dave
I am curious here. Was the '.tuf' file deleted as per a part of the process
of manually ?
Also the builds do play a major role here. From what I can see as per your
information, the primary server is of a higher build than the secondary
server. So I was wondering how a log file of a db from a higher build was
getting restored onto a lower build server.
Also I would suggest checking out the integrity of the trn files on the
primary server. try
restore verifyonly command to check the backup set's integrity.
Please do check if anyother process is accessing the db on the secondary
server as this may disrupt the LS process.
Also check this link.
http://support.microsoft.com/kb/329487/en-us
Thanks
Amer M J
MCP
"DavidCur" wrote:
> Thanks for the quick response. The log files are copied and restored every
> 15 minutes. The problem occurred this morning around 12:15am. I've tried
> your suggestion about restoring manually with the standby undo file.
> I ran the following command (using the 12:00am file) successfully, but the
> 12:15am file produces the following output:
> ---
> restore log JDE_Prod
> from disk = 'K:\Backups\DRLogsIn\JDE_Prod_tlog_200512300015.TRN'
> with standby = 'K:\Backups\DRLogsIn\LogUndo.tuf'
> ---
> Deleting database file 'K:\Backups\DRLogsIn\LogUndo.tuf'.
> Processed 34415 pages for database 'JDE_Prod', file 'JDE_PRODUCTION_log' on
> file 1.
> Server: Msg 3456, Level 21, State 1, Line 1
> Could not redo log record (500478:68225:4), for transaction ID
> (3:1085081790), on page (3:2789016), database 'JDE_Prod' (5). Page: LSN => (500478:57038:10), type = 2. Log: OpCode = 2, context 3, PrevPageLSN:
> (500478:68221:4).
> Connection Broken
> ---
> This 12:15 file has already been re-copied, but I will try again.
> Would be interesting to see if you find any issues with different builds in
> log shipping. The patches were applied to the local server a few months ago
> (3 or 4 months), and log shipping has been running without incident this
> whole time.
> Thanks again,
> Dave
>
> "Amer M J" wrote:
> > Hi David
> >
> > The SQL Builds may cause a problem. I am not sure about it.
> >
> > Rearding the file restore; it isn't necessary that you restore the entire
> > db. I would suggest the following steps:
> >
> > 1) Check the table msdb..log_shipping_plan_history for the last loaded file.
> > try
> >
> > select * from msdb..log_shipping_plan_history order by endtime desc
> >
> > 2) Try restoring tha tfile manually from the Query Analyzer. try
> >
> > restore log
> > <db_name>
> > from
> > disk = 'file_path'
> > with
> > standby = 'undo.txt'
> >
> > 3) if the above step succeeds keep restoring the successive trn files till
> > the step fails. Then that file at which the step fails is the corrupt file.
> >
> > 4) Copy only that file from the primary server and try step 2 with it.
> >
> > 5) re-run the LS Jobs and the ywill succeed.
> >
> > Hope this helps.
> >
> > I shall get back with mpre information about the affect of SQL builds on LS.
> >
> > Thanks
> > Amer M J
> > MCP|||Hi again,
Yes, the standby file (whatever it has been called) is automatically deleted
by the restore process.
Good news though, I seem to have log shipping going again! :-)
I re-copied the 12:15am log file (yet again, 3rd time) and restored it with
the same syntax as in my previous post, and it worked. So the problem must
lie with our link to the remote DR server. Its now been logged to the
telecom company who provide the WAN pipe.
As a precautionary measure I will schedule the remote server to be patched
to the same build level as our local server (will be next year though as we
are in a "holiday change freeze" now).
Funnily enough, the restore headeronly, verifyonly and filelistonly all
seemed to work fine with the corrupt file. Is it possible that the header of
the file was okay, while the actual data was bad'
Thanks very much for the help though, and I will update with anything new we
find.
Dave
"Amer M J" wrote:
> Hi Dave
> I am curious here. Was the '.tuf' file deleted as per a part of the process
> of manually ?
> Also the builds do play a major role here. From what I can see as per your
> information, the primary server is of a higher build than the secondary
> server. So I was wondering how a log file of a db from a higher build was
> getting restored onto a lower build server.
> Also I would suggest checking out the integrity of the trn files on the
> primary server. try
> restore verifyonly command to check the backup set's integrity.
> Please do check if anyother process is accessing the db on the secondary
> server as this may disrupt the LS process.
> Also check this link.
> http://support.microsoft.com/kb/329487/en-us
> Thanks
> Amer M J
> MCP

log shipping restore & recovery test

I am trying to imitate a DR situation where the primary db is down and I need to recover the secondary db on another server. They are a log shipping pair and so to imitate a DR, I remove the log shipping in the primary server maintenance plan. Then I go to the secondary server and disable the log shipping jobs there and attempt to do the following

RESTORE DATABASE database_name WITH RECOVERY

but I can't get exclusive use because the database is in use. But I don't see any other users... am I wrong in thinking that the log shipping was completely deleted? Anything I can do to force exclusive access?

Try as below,

Code Snippet

ALTER DATABASE yourdb SET SINGLE_USER WITH ROLLBACK IMMEDIATE

then restore the db as,

Restore database dbname with recovery

just disable the jobs in primary server no need to delete the maintenance plan it should work fine !

you can refer the articles related to log shipping in,

http://sql-articles.com/articles/lship/lship.htm

http://sql-articles.com/articles.php

For failover in SQL 2005, refer

http://sql-articles.com/articles/lship/fail-lship.htm

refer the link for

http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/logship2.mspx

Thanxx

Deepak

|||

the alter database command was successful HOWEVER, the restore still did not work because of the same reason...

Server: Msg 3101, Level 16, State 1, Line 1
Exclusive access could not be obtained because the database is in use.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

|||

you need to ensure that you dont have any connections to the db accidentally ! !

just go to SSMS or enterprise manager and type sp_who2 and see the dbname column and see the corresponding spid column if the value is less than greater than 50 type as follows,

kill spid value and then perform the restore it will work ! the problem is someone is accessing the db

Thanxx

Deepak

|||

I did the sp_who2 and saw two connections, one was the EM and one was the query analyzer... I killed the EM but when I tried the restore on query analyzer, it still gave me the same error about not being able to get exclusive use...

|||

ah... I changed the db in the drop down to point to the master and then did the recovery... it worked! thanks....

log shipping restore & recovery test

I am trying to imitate a DR situation where the primary db is down and I need to recover the secondary db on another server. They are a log shipping pair and so to imitate a DR, I remove the log shipping in the primary server maintenance plan. Then I go to the secondary server and disable the log shipping jobs there and attempt to do the following

RESTORE DATABASE database_name WITH RECOVERY

but I can't get exclusive use because the database is in use. But I don't see any other users... am I wrong in thinking that the log shipping was completely deleted? Anything I can do to force exclusive access?

Try as below,

Code Snippet

ALTER DATABASE yourdb SET SINGLE_USER WITH ROLLBACK IMMEDIATE

then restore the db as,

Restore database dbname with recovery

just disable the jobs in primary server no need to delete the maintenance plan it should work fine !

you can refer the articles related to log shipping in,

http://sql-articles.com/articles/lship/lship.htm

http://sql-articles.com/articles.php

For failover in SQL 2005, refer

http://sql-articles.com/articles/lship/fail-lship.htm

refer the link for

http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/logship2.mspx

Thanxx

Deepak

|||

the alter database command was successful HOWEVER, the restore still did not work because of the same reason...

Server: Msg 3101, Level 16, State 1, Line 1
Exclusive access could not be obtained because the database is in use.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

|||

you need to ensure that you dont have any connections to the db accidentally ! !

just go to SSMS or enterprise manager and type sp_who2 and see the dbname column and see the corresponding spid column if the value is less than greater than 50 type as follows,

kill spid value and then perform the restore it will work ! the problem is someone is accessing the db

Thanxx

Deepak

|||

I did the sp_who2 and saw two connections, one was the EM and one was the query analyzer... I killed the EM but when I tried the restore on query analyzer, it still gave me the same error about not being able to get exclusive use...

|||

ah... I changed the db in the drop down to point to the master and then did the recovery... it worked! thanks....

log shipping restore & recovery test

I am trying to imitate a DR situation where the primary db is down and I need to recover the secondary db on another server. They are a log shipping pair and so to imitate a DR, I remove the log shipping in the primary server maintenance plan. Then I go to the secondary server and disable the log shipping jobs there and attempt to do the following

RESTORE DATABASE database_name WITH RECOVERY

but I can't get exclusive use because the database is in use. But I don't see any other users... am I wrong in thinking that the log shipping was completely deleted? Anything I can do to force exclusive access?

Try as below,

Code Snippet

ALTER DATABASE yourdb SET SINGLE_USER WITH ROLLBACK IMMEDIATE

then restore the db as,

Restore database dbname with recovery

just disable the jobs in primary server no need to delete the maintenance plan it should work fine !

you can refer the articles related to log shipping in,

http://sql-articles.com/articles/lship/lship.htm

http://sql-articles.com/articles.php

For failover in SQL 2005, refer

http://sql-articles.com/articles/lship/fail-lship.htm

refer the link for

http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/logship2.mspx

Thanxx

Deepak

|||

the alter database command was successful HOWEVER, the restore still did not work because of the same reason...

Server: Msg 3101, Level 16, State 1, Line 1
Exclusive access could not be obtained because the database is in use.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

|||

you need to ensure that you dont have any connections to the db accidentally ! !

just go to SSMS or enterprise manager and type sp_who2 and see the dbname column and see the corresponding spid column if the value is less than greater than 50 type as follows,

kill spid value and then perform the restore it will work ! the problem is someone is accessing the db

Thanxx

Deepak

|||

I did the sp_who2 and saw two connections, one was the EM and one was the query analyzer... I killed the EM but when I tried the restore on query analyzer, it still gave me the same error about not being able to get exclusive use...

|||

ah... I changed the db in the drop down to point to the master and then did the recovery... it worked! thanks....

sql

Friday, March 23, 2012

log shipping problem

In our enviornment we have many databases that participate
in log shipping to a standby server. I find that every
once in a while the restore of the log will fail with the
following error (Example)

[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 4305:
[Microsoft][ODBC SQL Server Driver][SQL Server]The log in
this backup set begins at LSN 11797000000035000001, which
is too late to apply to the database. An earlier log
backup that includes LSN 11715000000012500001 can be
restored.
[Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE LOG
is terminating abnormally.

What I find is that there is no missing log file. My
first thought was that a log file didn't copy over
correctly. Basically its the next log that was backed up
and copied over and now trying to be restored. So where
did these missing transactiong go? To log heaven maybe?
What I do notice is now that also where my trn files are
there is a new file with a TUF extension. Is this where
my missing transactions are? Can I restore this file?

So do i have any other options here rather than deleting
log shipping and reinitalize the destination database once
again. Thanks

rcronin@.apcc.com

.The error 4305 indicates that the restore operation found a gap between
the last restore and the transaction log that you attempted to apply.
So, to resolve this error you should restore transaction logs in the
same order in which they were backed up.

Make sure to refer SQL error log on both the machines and take network admin help to find out any network bottlenecks.

By any reason if this occurs, just restore the full database on secondary server and restart LS.sql