Hi peeps
Bit of a problem... I did a backup of a database on SQL Server 2000 which
I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
Developer Ed), but I'm getting the following error...
Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
operating system system error 21 (the device is not ready).
I can't think of any reason why this would be happening, apart from the fact
that I've changed the DOMAIN of the network from DSERV to something else, so
is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
missing?
Cheers
DanHi
It looks like your drives/locations don't match the original server? Try
using the move option to specify a new location. If this is a SAN disc make
sure it has been allocated to SQL Server in Cluster Manager.
John
"musosdev" <musoswire@.community.nospam> wrote in message
news:E748D4DB-2FB8-4C16-A2A3-12FBC980F9C7@.microsoft.com...
> Hi peeps
> Bit of a problem... I did a backup of a database on SQL Server 2000 which
> I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
> Developer Ed), but I'm getting the following error...
> Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
> System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
> Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
> operating system system error 21 (the device is not ready).
> --
> I can't think of any reason why this would be happening, apart from the
> fact
> that I've changed the DOMAIN of the network from DSERV to something else,
> so
> is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
> missing?
> Cheers
>
> Dan|||Cheers John, all sorted now!
"John Bell" wrote:
> Hi
> It looks like your drives/locations don't match the original server? Try
> using the move option to specify a new location. If this is a SAN disc mak
e
> sure it has been allocated to SQL Server in Cluster Manager.
> John
> "musosdev" <musoswire@.community.nospam> wrote in message
> news:E748D4DB-2FB8-4C16-A2A3-12FBC980F9C7@.microsoft.com...
>
>
Showing posts with label setup. Show all posts
Showing posts with label setup. Show all posts
Monday, March 26, 2012
restoring to 2005 doesnt work
Hi peeps
Bit of a problem... I did a backup of a database on SQL Server 2000 which
I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
Developer Ed), but I'm getting the following error...
Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
operating system system error 21 (the device is not ready).
I can't think of any reason why this would be happening, apart from the fact
that I've changed the DOMAIN of the network from DSERV to something else, so
is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
missing?
Cheers
Dan
Hi
It looks like your drives/locations don't match the original server? Try
using the move option to specify a new location. If this is a SAN disc make
sure it has been allocated to SQL Server in Cluster Manager.
John
"musosdev" <musoswire@.community.nospam> wrote in message
news:E748D4DB-2FB8-4C16-A2A3-12FBC980F9C7@.microsoft.com...
> Hi peeps
> Bit of a problem... I did a backup of a database on SQL Server 2000 which
> I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
> Developer Ed), but I'm getting the following error...
> Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
> System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
> Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
> operating system system error 21 (the device is not ready).
> --
> I can't think of any reason why this would be happening, apart from the
> fact
> that I've changed the DOMAIN of the network from DSERV to something else,
> so
> is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
> missing?
> Cheers
>
> Dan
|||Cheers John, all sorted now!
"John Bell" wrote:
> Hi
> It looks like your drives/locations don't match the original server? Try
> using the move option to specify a new location. If this is a SAN disc make
> sure it has been allocated to SQL Server in Cluster Manager.
> John
> "musosdev" <musoswire@.community.nospam> wrote in message
> news:E748D4DB-2FB8-4C16-A2A3-12FBC980F9C7@.microsoft.com...
>
>
Bit of a problem... I did a backup of a database on SQL Server 2000 which
I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
Developer Ed), but I'm getting the following error...
Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
operating system system error 21 (the device is not ready).
I can't think of any reason why this would be happening, apart from the fact
that I've changed the DOMAIN of the network from DSERV to something else, so
is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
missing?
Cheers
Dan
Hi
It looks like your drives/locations don't match the original server? Try
using the move option to specify a new location. If this is a SAN disc make
sure it has been allocated to SQL Server in Cluster Manager.
John
"musosdev" <musoswire@.community.nospam> wrote in message
news:E748D4DB-2FB8-4C16-A2A3-12FBC980F9C7@.microsoft.com...
> Hi peeps
> Bit of a problem... I did a backup of a database on SQL Server 2000 which
> I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
> Developer Ed), but I'm getting the following error...
> Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
> System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
> Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
> operating system system error 21 (the device is not ready).
> --
> I can't think of any reason why this would be happening, apart from the
> fact
> that I've changed the DOMAIN of the network from DSERV to something else,
> so
> is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
> missing?
> Cheers
>
> Dan
|||Cheers John, all sorted now!
"John Bell" wrote:
> Hi
> It looks like your drives/locations don't match the original server? Try
> using the move option to specify a new location. If this is a SAN disc make
> sure it has been allocated to SQL Server in Cluster Manager.
> John
> "musosdev" <musoswire@.community.nospam> wrote in message
> news:E748D4DB-2FB8-4C16-A2A3-12FBC980F9C7@.microsoft.com...
>
>
restoring to 2005 doesnt work
Hi peeps
Bit of a problem... I did a backup of a database on SQL Server 2000 which
I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
Developer Ed), but I'm getting the following error...
Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
operating system system error 21 (the device is not ready).
--
I can't think of any reason why this would be happening, apart from the fact
that I've changed the DOMAIN of the network from DSERV to something else, so
is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
missing?
Cheers
DanHi
It looks like your drives/locations don't match the original server? Try
using the move option to specify a new location. If this is a SAN disc make
sure it has been allocated to SQL Server in Cluster Manager.
John
"musosdev" <musoswire@.community.nospam> wrote in message
news:E748D4DB-2FB8-4C16-A2A3-12FBC980F9C7@.microsoft.com...
> Hi peeps
> Bit of a problem... I did a backup of a database on SQL Server 2000 which
> I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
> Developer Ed), but I'm getting the following error...
> Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
> System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
> Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
> operating system system error 21 (the device is not ready).
> --
> I can't think of any reason why this would be happening, apart from the
> fact
> that I've changed the DOMAIN of the network from DSERV to something else,
> so
> is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
> missing?
> Cheers
>
> Dan|||Cheers John, all sorted now!
"John Bell" wrote:
> Hi
> It looks like your drives/locations don't match the original server? Try
> using the move option to specify a new location. If this is a SAN disc make
> sure it has been allocated to SQL Server in Cluster Manager.
> John
> "musosdev" <musoswire@.community.nospam> wrote in message
> news:E748D4DB-2FB8-4C16-A2A3-12FBC980F9C7@.microsoft.com...
> > Hi peeps
> >
> > Bit of a problem... I did a backup of a database on SQL Server 2000 which
> > I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
> > Developer Ed), but I'm getting the following error...
> >
> > Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
> >
> > System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
> > Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
> > operating system system error 21 (the device is not ready).
> >
> > --
> >
> > I can't think of any reason why this would be happening, apart from the
> > fact
> > that I've changed the DOMAIN of the network from DSERV to something else,
> > so
> > is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
> > missing?
> >
> > Cheers
> >
> >
> >
> > Dan
>
>
Bit of a problem... I did a backup of a database on SQL Server 2000 which
I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
Developer Ed), but I'm getting the following error...
Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
operating system system error 21 (the device is not ready).
--
I can't think of any reason why this would be happening, apart from the fact
that I've changed the DOMAIN of the network from DSERV to something else, so
is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
missing?
Cheers
DanHi
It looks like your drives/locations don't match the original server? Try
using the move option to specify a new location. If this is a SAN disc make
sure it has been allocated to SQL Server in Cluster Manager.
John
"musosdev" <musoswire@.community.nospam> wrote in message
news:E748D4DB-2FB8-4C16-A2A3-12FBC980F9C7@.microsoft.com...
> Hi peeps
> Bit of a problem... I did a backup of a database on SQL Server 2000 which
> I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
> Developer Ed), but I'm getting the following error...
> Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
> System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
> Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
> operating system system error 21 (the device is not ready).
> --
> I can't think of any reason why this would be happening, apart from the
> fact
> that I've changed the DOMAIN of the network from DSERV to something else,
> so
> is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
> missing?
> Cheers
>
> Dan|||Cheers John, all sorted now!
"John Bell" wrote:
> Hi
> It looks like your drives/locations don't match the original server? Try
> using the move option to specify a new location. If this is a SAN disc make
> sure it has been allocated to SQL Server in Cluster Manager.
> John
> "musosdev" <musoswire@.community.nospam> wrote in message
> news:E748D4DB-2FB8-4C16-A2A3-12FBC980F9C7@.microsoft.com...
> > Hi peeps
> >
> > Bit of a problem... I did a backup of a database on SQL Server 2000 which
> > I'm now trying to restore to my newly setup server (Win2k3, SQL 2005
> > Developer Ed), but I'm getting the following error...
> >
> > Restore failed for server 'SERVER'. (Microsoft.SqlServer.Smo)
> >
> > System.Data.SqlClient.SqlError: Directory lookup for the file "F:\Program
> > Files\Microsoft SQL Server\MSSQL$DSERV\Data\dartsV2.mdf" failed with the
> > operating system system error 21 (the device is not ready).
> >
> > --
> >
> > I can't think of any reason why this would be happening, apart from the
> > fact
> > that I've changed the DOMAIN of the network from DSERV to something else,
> > so
> > is it looking for MSSQL$DSERV that's causing the prob? Or something I'm
> > missing?
> >
> > Cheers
> >
> >
> >
> > Dan
>
>
Wednesday, March 21, 2012
Restoring Publisher
We are testing SQL 2K Merge replication on a server and we need to restore
from a backup that was created right after the publication was setup. Do we
need to re-run the snapshot before we can re-create a subscriber? Thanks.
David
David,
if you want to reinitialize the subscriber, this will be necessary. In this
case, changes made on the subscriber since your backup will be lost. If you
just want to get things working again, and want to retain the recent
subscriber changes, you can restore the publisher database and synchronize
with the subscriber (assuming all this is on the same server).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||At this point, I don't care about the subscriber changes because we only
have 1 test anonymous laptop subscription. But in real production I
would want to know what can be done. For example, what if the publisher
crashes and we have to restore from a backup. Can the subscribers
simply synchronize with their changes against this newly restored
publisher? If so, do I have to re-run the snapshot? Thanks.
David
*** Sent via Developersdex http://www.codecomments.com ***
|||David,
as long as you have a recent backup in merge, you can restore and
synchronize. Changes are associated with generation numbers in the metadata
which is effectively working as a logical clock. This means that they'll
pick up all the changes made after they last synchronized with the
subscriber, from wherever they originated.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
sql
from a backup that was created right after the publication was setup. Do we
need to re-run the snapshot before we can re-create a subscriber? Thanks.
David
David,
if you want to reinitialize the subscriber, this will be necessary. In this
case, changes made on the subscriber since your backup will be lost. If you
just want to get things working again, and want to retain the recent
subscriber changes, you can restore the publisher database and synchronize
with the subscriber (assuming all this is on the same server).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||At this point, I don't care about the subscriber changes because we only
have 1 test anonymous laptop subscription. But in real production I
would want to know what can be done. For example, what if the publisher
crashes and we have to restore from a backup. Can the subscribers
simply synchronize with their changes against this newly restored
publisher? If so, do I have to re-run the snapshot? Thanks.
David
*** Sent via Developersdex http://www.codecomments.com ***
|||David,
as long as you have a recent backup in merge, you can restore and
synchronize. Changes are associated with generation numbers in the metadata
which is effectively working as a logical clock. This means that they'll
pick up all the changes made after they last synchronized with the
subscriber, from wherever they originated.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
sql
Labels:
backup,
created,
database,
merge,
microsoft,
mysql,
oracle,
publication,
publisher,
replication,
restorefrom,
restoring,
server,
setup,
sql
Tuesday, March 20, 2012
Restoring multiple transaction logs from a single file
Hi all,
I have a home-grown log shipping setup at work which I'm trying to
modify. At present if the standby server cannot apply the logs before
the live server writes a new set (usually because the db cannot be
locked), it fails and we have to do a full resync between the servers.
I've put in a mechanism whereby the status of the last attempt to apply
the logs to the standby database is recorded. If the primary sees that
the last attempt was successful it does a BACKUP LOG ... WITH INIT.
If it sees the last attempt was not successful it does the same but
WITH NOINIT, which I gather appends the new logs onto the end of the
current lot. This way the transaction logs will queue up every hour
until I can solve whatever the issue between the servers is so they can
be applied, thus saving a full 4 hour resync on a 220GB database.
Problem is this. For example, the secondary can't apply logs because
it can't get exclusive lock on the db. It marks that database as out
of sync in a table. Next time the primary backs up logs it sees the
secondary is not up to date so it appends the logs to the last lot
instead of overwriting them (WITH NOINIT). Next time the secondary
does manage to apply the logs. Now I thought that would mean it gets
ALL the logs and applies them, except I get this error message:
Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
begins at LSN 1247944000000500300001, which is too late to apply to the
database. An earlier log backup that includes LSN
1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
The step failed.
Now I know that means that basically there is a gap between the last
log to be applied and the one we're attempting to apply now. What I
don't understand is how that can be since the last lot of logs to be
successfully applied included more than one BACKUP LOG's worth. How
can I tell RESTORE LOG to apply ALL the log backups appended together
instead of just the first ones in the set?
TIA
Niall
> How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
You can't. So you have to write some code that uses RESTORE HEADERONLY, and based the result does
several RESTORE LOG commands.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<niallporter@.yahoo.co.uk> wrote in message
news:1158846017.059168.76240@.m73g2000cwd.googlegro ups.com...
> Hi all,
> I have a home-grown log shipping setup at work which I'm trying to
> modify. At present if the standby server cannot apply the logs before
> the live server writes a new set (usually because the db cannot be
> locked), it fails and we have to do a full resync between the servers.
> I've put in a mechanism whereby the status of the last attempt to apply
> the logs to the standby database is recorded. If the primary sees that
> the last attempt was successful it does a BACKUP LOG ... WITH INIT.
> If it sees the last attempt was not successful it does the same but
> WITH NOINIT, which I gather appends the new logs onto the end of the
> current lot. This way the transaction logs will queue up every hour
> until I can solve whatever the issue between the servers is so they can
> be applied, thus saving a full 4 hour resync on a 220GB database.
> Problem is this. For example, the secondary can't apply logs because
> it can't get exclusive lock on the db. It marks that database as out
> of sync in a table. Next time the primary backs up logs it sees the
> secondary is not up to date so it appends the logs to the last lot
> instead of overwriting them (WITH NOINIT). Next time the secondary
> does manage to apply the logs. Now I thought that would mean it gets
> ALL the logs and applies them, except I get this error message:
> Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
> begins at LSN 1247944000000500300001, which is too late to apply to the
> database. An earlier log backup that includes LSN
> 1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
> RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
> The step failed.
> Now I know that means that basically there is a gap between the last
> log to be applied and the one we're attempting to apply now. What I
> don't understand is how that can be since the last lot of logs to be
> successfully applied included more than one BACKUP LOG's worth. How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
> TIA
> Niall
>
I have a home-grown log shipping setup at work which I'm trying to
modify. At present if the standby server cannot apply the logs before
the live server writes a new set (usually because the db cannot be
locked), it fails and we have to do a full resync between the servers.
I've put in a mechanism whereby the status of the last attempt to apply
the logs to the standby database is recorded. If the primary sees that
the last attempt was successful it does a BACKUP LOG ... WITH INIT.
If it sees the last attempt was not successful it does the same but
WITH NOINIT, which I gather appends the new logs onto the end of the
current lot. This way the transaction logs will queue up every hour
until I can solve whatever the issue between the servers is so they can
be applied, thus saving a full 4 hour resync on a 220GB database.
Problem is this. For example, the secondary can't apply logs because
it can't get exclusive lock on the db. It marks that database as out
of sync in a table. Next time the primary backs up logs it sees the
secondary is not up to date so it appends the logs to the last lot
instead of overwriting them (WITH NOINIT). Next time the secondary
does manage to apply the logs. Now I thought that would mean it gets
ALL the logs and applies them, except I get this error message:
Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
begins at LSN 1247944000000500300001, which is too late to apply to the
database. An earlier log backup that includes LSN
1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
The step failed.
Now I know that means that basically there is a gap between the last
log to be applied and the one we're attempting to apply now. What I
don't understand is how that can be since the last lot of logs to be
successfully applied included more than one BACKUP LOG's worth. How
can I tell RESTORE LOG to apply ALL the log backups appended together
instead of just the first ones in the set?
TIA
Niall
> How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
You can't. So you have to write some code that uses RESTORE HEADERONLY, and based the result does
several RESTORE LOG commands.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<niallporter@.yahoo.co.uk> wrote in message
news:1158846017.059168.76240@.m73g2000cwd.googlegro ups.com...
> Hi all,
> I have a home-grown log shipping setup at work which I'm trying to
> modify. At present if the standby server cannot apply the logs before
> the live server writes a new set (usually because the db cannot be
> locked), it fails and we have to do a full resync between the servers.
> I've put in a mechanism whereby the status of the last attempt to apply
> the logs to the standby database is recorded. If the primary sees that
> the last attempt was successful it does a BACKUP LOG ... WITH INIT.
> If it sees the last attempt was not successful it does the same but
> WITH NOINIT, which I gather appends the new logs onto the end of the
> current lot. This way the transaction logs will queue up every hour
> until I can solve whatever the issue between the servers is so they can
> be applied, thus saving a full 4 hour resync on a 220GB database.
> Problem is this. For example, the secondary can't apply logs because
> it can't get exclusive lock on the db. It marks that database as out
> of sync in a table. Next time the primary backs up logs it sees the
> secondary is not up to date so it appends the logs to the last lot
> instead of overwriting them (WITH NOINIT). Next time the secondary
> does manage to apply the logs. Now I thought that would mean it gets
> ALL the logs and applies them, except I get this error message:
> Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
> begins at LSN 1247944000000500300001, which is too late to apply to the
> database. An earlier log backup that includes LSN
> 1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
> RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
> The step failed.
> Now I know that means that basically there is a gap between the last
> log to be applied and the one we're attempting to apply now. What I
> don't understand is how that can be since the last lot of logs to be
> successfully applied included more than one BACKUP LOG's worth. How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
> TIA
> Niall
>
Restoring multiple transaction logs from a single file
Hi all,
I have a home-grown log shipping setup at work which I'm trying to
modify. At present if the standby server cannot apply the logs before
the live server writes a new set (usually because the db cannot be
locked), it fails and we have to do a full resync between the servers.
I've put in a mechanism whereby the status of the last attempt to apply
the logs to the standby database is recorded. If the primary sees that
the last attempt was successful it does a BACKUP LOG ... WITH INIT.
If it sees the last attempt was not successful it does the same but
WITH NOINIT, which I gather appends the new logs onto the end of the
current lot. This way the transaction logs will queue up every hour
until I can solve whatever the issue between the servers is so they can
be applied, thus saving a full 4 hour resync on a 220GB database.
Problem is this. For example, the secondary can't apply logs because
it can't get exclusive lock on the db. It marks that database as out
of sync in a table. Next time the primary backs up logs it sees the
secondary is not up to date so it appends the logs to the last lot
instead of overwriting them (WITH NOINIT). Next time the secondary
does manage to apply the logs. Now I thought that would mean it gets
ALL the logs and applies them, except I get this error message:
Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
begins at LSN 1247944000000500300001, which is too late to apply to the
database. An earlier log backup that includes LSN
1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
The step failed.
Now I know that means that basically there is a gap between the last
log to be applied and the one we're attempting to apply now. What I
don't understand is how that can be since the last lot of logs to be
successfully applied included more than one BACKUP LOG's worth. How
can I tell RESTORE LOG to apply ALL the log backups appended together
instead of just the first ones in the set?
TIA
Niall> How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
You can't. So you have to write some code that uses RESTORE HEADERONLY, and
based the result does
several RESTORE LOG commands.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<niallporter@.yahoo.co.uk> wrote in message
news:1158846017.059168.76240@.m73g2000cwd.googlegroups.com...
> Hi all,
> I have a home-grown log shipping setup at work which I'm trying to
> modify. At present if the standby server cannot apply the logs before
> the live server writes a new set (usually because the db cannot be
> locked), it fails and we have to do a full resync between the servers.
> I've put in a mechanism whereby the status of the last attempt to apply
> the logs to the standby database is recorded. If the primary sees that
> the last attempt was successful it does a BACKUP LOG ... WITH INIT.
> If it sees the last attempt was not successful it does the same but
> WITH NOINIT, which I gather appends the new logs onto the end of the
> current lot. This way the transaction logs will queue up every hour
> until I can solve whatever the issue between the servers is so they can
> be applied, thus saving a full 4 hour resync on a 220GB database.
> Problem is this. For example, the secondary can't apply logs because
> it can't get exclusive lock on the db. It marks that database as out
> of sync in a table. Next time the primary backs up logs it sees the
> secondary is not up to date so it appends the logs to the last lot
> instead of overwriting them (WITH NOINIT). Next time the secondary
> does manage to apply the logs. Now I thought that would mean it gets
> ALL the logs and applies them, except I get this error message:
> Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
> begins at LSN 1247944000000500300001, which is too late to apply to the
> database. An earlier log backup that includes LSN
> 1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
> RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
> The step failed.
> Now I know that means that basically there is a gap between the last
> log to be applied and the one we're attempting to apply now. What I
> don't understand is how that can be since the last lot of logs to be
> successfully applied included more than one BACKUP LOG's worth. How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
> TIA
> Niall
>
I have a home-grown log shipping setup at work which I'm trying to
modify. At present if the standby server cannot apply the logs before
the live server writes a new set (usually because the db cannot be
locked), it fails and we have to do a full resync between the servers.
I've put in a mechanism whereby the status of the last attempt to apply
the logs to the standby database is recorded. If the primary sees that
the last attempt was successful it does a BACKUP LOG ... WITH INIT.
If it sees the last attempt was not successful it does the same but
WITH NOINIT, which I gather appends the new logs onto the end of the
current lot. This way the transaction logs will queue up every hour
until I can solve whatever the issue between the servers is so they can
be applied, thus saving a full 4 hour resync on a 220GB database.
Problem is this. For example, the secondary can't apply logs because
it can't get exclusive lock on the db. It marks that database as out
of sync in a table. Next time the primary backs up logs it sees the
secondary is not up to date so it appends the logs to the last lot
instead of overwriting them (WITH NOINIT). Next time the secondary
does manage to apply the logs. Now I thought that would mean it gets
ALL the logs and applies them, except I get this error message:
Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
begins at LSN 1247944000000500300001, which is too late to apply to the
database. An earlier log backup that includes LSN
1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
The step failed.
Now I know that means that basically there is a gap between the last
log to be applied and the one we're attempting to apply now. What I
don't understand is how that can be since the last lot of logs to be
successfully applied included more than one BACKUP LOG's worth. How
can I tell RESTORE LOG to apply ALL the log backups appended together
instead of just the first ones in the set?
TIA
Niall> How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
You can't. So you have to write some code that uses RESTORE HEADERONLY, and
based the result does
several RESTORE LOG commands.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<niallporter@.yahoo.co.uk> wrote in message
news:1158846017.059168.76240@.m73g2000cwd.googlegroups.com...
> Hi all,
> I have a home-grown log shipping setup at work which I'm trying to
> modify. At present if the standby server cannot apply the logs before
> the live server writes a new set (usually because the db cannot be
> locked), it fails and we have to do a full resync between the servers.
> I've put in a mechanism whereby the status of the last attempt to apply
> the logs to the standby database is recorded. If the primary sees that
> the last attempt was successful it does a BACKUP LOG ... WITH INIT.
> If it sees the last attempt was not successful it does the same but
> WITH NOINIT, which I gather appends the new logs onto the end of the
> current lot. This way the transaction logs will queue up every hour
> until I can solve whatever the issue between the servers is so they can
> be applied, thus saving a full 4 hour resync on a 220GB database.
> Problem is this. For example, the secondary can't apply logs because
> it can't get exclusive lock on the db. It marks that database as out
> of sync in a table. Next time the primary backs up logs it sees the
> secondary is not up to date so it appends the logs to the last lot
> instead of overwriting them (WITH NOINIT). Next time the secondary
> does manage to apply the logs. Now I thought that would mean it gets
> ALL the logs and applies them, except I get this error message:
> Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
> begins at LSN 1247944000000500300001, which is too late to apply to the
> database. An earlier log backup that includes LSN
> 1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
> RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
> The step failed.
> Now I know that means that basically there is a gap between the last
> log to be applied and the one we're attempting to apply now. What I
> don't understand is how that can be since the last lot of logs to be
> successfully applied included more than one BACKUP LOG's worth. How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
> TIA
> Niall
>
Restoring multiple transaction logs from a single file
Hi all,
I have a home-grown log shipping setup at work which I'm trying to
modify. At present if the standby server cannot apply the logs before
the live server writes a new set (usually because the db cannot be
locked), it fails and we have to do a full resync between the servers.
I've put in a mechanism whereby the status of the last attempt to apply
the logs to the standby database is recorded. If the primary sees that
the last attempt was successful it does a BACKUP LOG ... WITH INIT.
If it sees the last attempt was not successful it does the same but
WITH NOINIT, which I gather appends the new logs onto the end of the
current lot. This way the transaction logs will queue up every hour
until I can solve whatever the issue between the servers is so they can
be applied, thus saving a full 4 hour resync on a 220GB database.
Problem is this. For example, the secondary can't apply logs because
it can't get exclusive lock on the db. It marks that database as out
of sync in a table. Next time the primary backs up logs it sees the
secondary is not up to date so it appends the logs to the last lot
instead of overwriting them (WITH NOINIT). Next time the secondary
does manage to apply the logs. Now I thought that would mean it gets
ALL the logs and applies them, except I get this error message:
Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
begins at LSN 1247944000000500300001, which is too late to apply to the
database. An earlier log backup that includes LSN
1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
The step failed.
Now I know that means that basically there is a gap between the last
log to be applied and the one we're attempting to apply now. What I
don't understand is how that can be since the last lot of logs to be
successfully applied included more than one BACKUP LOG's worth. How
can I tell RESTORE LOG to apply ALL the log backups appended together
instead of just the first ones in the set?
TIA
Niall> How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
You can't. So you have to write some code that uses RESTORE HEADERONLY, and based the result does
several RESTORE LOG commands.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<niallporter@.yahoo.co.uk> wrote in message
news:1158846017.059168.76240@.m73g2000cwd.googlegroups.com...
> Hi all,
> I have a home-grown log shipping setup at work which I'm trying to
> modify. At present if the standby server cannot apply the logs before
> the live server writes a new set (usually because the db cannot be
> locked), it fails and we have to do a full resync between the servers.
> I've put in a mechanism whereby the status of the last attempt to apply
> the logs to the standby database is recorded. If the primary sees that
> the last attempt was successful it does a BACKUP LOG ... WITH INIT.
> If it sees the last attempt was not successful it does the same but
> WITH NOINIT, which I gather appends the new logs onto the end of the
> current lot. This way the transaction logs will queue up every hour
> until I can solve whatever the issue between the servers is so they can
> be applied, thus saving a full 4 hour resync on a 220GB database.
> Problem is this. For example, the secondary can't apply logs because
> it can't get exclusive lock on the db. It marks that database as out
> of sync in a table. Next time the primary backs up logs it sees the
> secondary is not up to date so it appends the logs to the last lot
> instead of overwriting them (WITH NOINIT). Next time the secondary
> does manage to apply the logs. Now I thought that would mean it gets
> ALL the logs and applies them, except I get this error message:
> Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
> begins at LSN 1247944000000500300001, which is too late to apply to the
> database. An earlier log backup that includes LSN
> 1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
> RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
> The step failed.
> Now I know that means that basically there is a gap between the last
> log to be applied and the one we're attempting to apply now. What I
> don't understand is how that can be since the last lot of logs to be
> successfully applied included more than one BACKUP LOG's worth. How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
> TIA
> Niall
>
I have a home-grown log shipping setup at work which I'm trying to
modify. At present if the standby server cannot apply the logs before
the live server writes a new set (usually because the db cannot be
locked), it fails and we have to do a full resync between the servers.
I've put in a mechanism whereby the status of the last attempt to apply
the logs to the standby database is recorded. If the primary sees that
the last attempt was successful it does a BACKUP LOG ... WITH INIT.
If it sees the last attempt was not successful it does the same but
WITH NOINIT, which I gather appends the new logs onto the end of the
current lot. This way the transaction logs will queue up every hour
until I can solve whatever the issue between the servers is so they can
be applied, thus saving a full 4 hour resync on a 220GB database.
Problem is this. For example, the secondary can't apply logs because
it can't get exclusive lock on the db. It marks that database as out
of sync in a table. Next time the primary backs up logs it sees the
secondary is not up to date so it appends the logs to the last lot
instead of overwriting them (WITH NOINIT). Next time the secondary
does manage to apply the logs. Now I thought that would mean it gets
ALL the logs and applies them, except I get this error message:
Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
begins at LSN 1247944000000500300001, which is too late to apply to the
database. An earlier log backup that includes LSN
1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
The step failed.
Now I know that means that basically there is a gap between the last
log to be applied and the one we're attempting to apply now. What I
don't understand is how that can be since the last lot of logs to be
successfully applied included more than one BACKUP LOG's worth. How
can I tell RESTORE LOG to apply ALL the log backups appended together
instead of just the first ones in the set?
TIA
Niall> How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
You can't. So you have to write some code that uses RESTORE HEADERONLY, and based the result does
several RESTORE LOG commands.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<niallporter@.yahoo.co.uk> wrote in message
news:1158846017.059168.76240@.m73g2000cwd.googlegroups.com...
> Hi all,
> I have a home-grown log shipping setup at work which I'm trying to
> modify. At present if the standby server cannot apply the logs before
> the live server writes a new set (usually because the db cannot be
> locked), it fails and we have to do a full resync between the servers.
> I've put in a mechanism whereby the status of the last attempt to apply
> the logs to the standby database is recorded. If the primary sees that
> the last attempt was successful it does a BACKUP LOG ... WITH INIT.
> If it sees the last attempt was not successful it does the same but
> WITH NOINIT, which I gather appends the new logs onto the end of the
> current lot. This way the transaction logs will queue up every hour
> until I can solve whatever the issue between the servers is so they can
> be applied, thus saving a full 4 hour resync on a 220GB database.
> Problem is this. For example, the secondary can't apply logs because
> it can't get exclusive lock on the db. It marks that database as out
> of sync in a table. Next time the primary backs up logs it sees the
> secondary is not up to date so it appends the logs to the last lot
> instead of overwriting them (WITH NOINIT). Next time the secondary
> does manage to apply the logs. Now I thought that would mean it gets
> ALL the logs and applies them, except I get this error message:
> Executed as user: STEWARTMILNE\sqlosp1. The log in this backup set
> begins at LSN 1247944000000500300001, which is too late to apply to the
> database. An earlier log backup that includes LSN
> 1247592000000017600001 can be restored. [SQLSTATE 42000] (Error 4305)
> RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
> The step failed.
> Now I know that means that basically there is a gap between the last
> log to be applied and the one we're attempting to apply now. What I
> don't understand is how that can be since the last lot of logs to be
> successfully applied included more than one BACKUP LOG's worth. How
> can I tell RESTORE LOG to apply ALL the log backups appended together
> instead of just the first ones in the set?
> TIA
> Niall
>
Subscribe to:
Posts (Atom)