Showing posts with label mode. Show all posts
Showing posts with label mode. Show all posts

Sunday, March 25, 2012

backup error - single user mode needed?

Hi Everyone,
One of my clients is running SQL 2000 SP4 and the Data Maintenance Plan
logs shows a log with...
Database master: Check Data and Index Linkage...
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft][ODBC
SQL Server Driver][SQL Server]Repair statement not processed. Database
needs to be in single user mode.
The following errors were found:
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
processed. Database needs to be in single user mode.
** Execution Time: 0 hrs, 0 mins, 1 secs **
...
[5] Database master: Database Backup...
The backup was not performed since data verification errors were found.

There are similar messages for databases model and msdb.
Questions:
- should master, model and msdb be included in the daily backup?
- how does one get into single user mode and repair this?
Thanks
Richard
Hi,
In your maintenance plan, uncheck the Attempt to repair minor problems
checkbox in Integrity tab.
With that checkbox unchecked, integrity checks will be still done on the
databases and as a good practice verify your maintenance logs
for any integroty errors. If there is any error you could manually correct
it.
Thanks
Hari
SQL Server MVP
"Richard Fagen" <no_spam@.aol.com> wrote in message
news:O3JolEukFHA.2792@.TK2MSFTNGP10.phx.gbl...
> Hi Everyone,
> One of my clients is running SQL 2000 SP4 and the Data Maintenance Plan
> logs shows a log with...
> --
> Database master: Check Data and Index Linkage...
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft][ODBC
> SQL Server Driver][SQL Server]Repair statement not processed. Database
> needs to be in single user mode.
> The following errors were found:
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> ...
> [5] Database master: Database Backup...
> The backup was not performed since data verification errors were
> found.
>
> --
> There are similar messages for databases model and msdb.
> Questions:
> - should master, model and msdb be included in the daily backup?
> - how does one get into single user mode and repair this?
> Thanks
> Richard
|||hi Richard,
Richard Fagen wrote:
is the disk damaged?

> Questions:
> - should master, model and msdb be included in the daily backup?
usually not.. only when server modifications occur, like implementing new
jobs, alerts, logins and so on...

> - how does one get into single user mode and repair this?
http://msdn.microsoft.com/library/de...start_4nhh.asp
http://msdn.microsoft.com/library/de...kprst_4g4w.asp
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Andrea Montanari wrote:
> hi Richard,
> Richard Fagen wrote:
> is the disk damaged?
always forget the Maintenance Plan is that intrusive (and bugged ) ..
always prefer self written jobs :D
yep.. Hari is right
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Hi Hari,
I'll uncheck the box and try it again.
I use SQL as part of SBS 2000/2003 and that seems to go against what
I've read in books. All the books say be sure to check that box
However, since your both SQL MVPs and Andrea has helped me out before,
I'll go with your recommendations.
Richard
p.s. the one who says to check it, Harry Brelsford, is an MVP too, but
of SBS not SQL
Hari Prasad wrote:
> Hi,
> In your maintenance plan, uncheck the Attempt to repair minor problems
> checkbox in Integrity tab.
> With that checkbox unchecked, integrity checks will be still done on the
> databases and as a good practice verify your maintenance logs
> for any integroty errors. If there is any error you could manually correct
> it.
> Thanks
> Hari
> SQL Server MVP
>
> "Richard Fagen" <no_spam@.aol.com> wrote in message
> news:O3JolEukFHA.2792@.TK2MSFTNGP10.phx.gbl...
>
>
|||Hi Andrea,

> is the disk damaged?
Not that I know of. Besides, I remotely logged into a few SBS clients
to test the data maintenance plan with backing up master, model and msdb
and they all had the same error messages.
I guess it wouldn't hurt to have everyone run a scandisk (I try to get
them to do it on their own, but they never remember) and doublecheck.

> usually not.. only when server modifications occur, like implementing new
> jobs, alerts, logins and so on...
I can manually backup master, model and msdb via the Enterprise Manager,
just not via the maintenance plan.
I hope they fix this in SQL 2005

> http://msdn.microsoft.com/library/de...start_4nhh.asp
> http://msdn.microsoft.com/library/de...kprst_4g4w.asp
Thanks for the links
Richard
|||hi Richard,
Richard Fagen wrote:
> Hi Andrea,
> Not that I know of. Besides, I remotely logged into a few SBS clients
> to test the data maintenance plan with backing up master, model and
> msdb and they all had the same error messages.
see Hari post... Maintenance Plan is "intrusive" by default and tryes to
perform activities requiring single user access...

> I guess it wouldn't hurt to have everyone run a scandisk (I try to get
> them to do it on their own, but they never remember) and doublecheck.
but ok. checking disk integrity is always neat :D

> I can manually backup master, model and msdb via the Enterprise
> Manager, just not via the maintenance plan.
again, see Hari answer...

> I hope they fix this in SQL 2005
SQLExpress will not include the Agent, so no Maintenance Plan at all... but
worse, no jobs at all, and that includes both admin/house keeping jobs as
other dataload,dml jobs
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||From Microsoft Article 290622:
BUG: Databse Manintenance Plan on System Databases faile on Intergrity
Check if "Attempt to repair minor problems" is Selected
... The database maintenance plan attempts to place the system databases
in the single user mode in order to execute CkDBRepair. However the
Master and MSDB databases cannot be placed in single user mode because of
constantly running system processes like LAZYWRITER, LOG WRITER, SQL
Agent... The repair step fails to run and the job reports a failure...
There is no fix for tis bug as yet. The workaround is to disable the
"Attempt to repair any minor problems" option in your maintenance plan.
Lyle
In article <O3JolEukFHA.2792@.TK2MSFTNGP10.phx.gbl>, no_spam@.aol.com
says...
> Hi Everyone,
> One of my clients is running SQL 2000 SP4 and the Data Maintenance Plan
> logs shows a log with...
> --
> Database master: Check Data and Index Linkage...
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft][ODBC
> SQL Server Driver][SQL Server]Repair statement not processed. Database
> needs to be in single user mode.
> The following errors were found:
> [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not
> processed. Database needs to be in single user mode.
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> ...
> [5] Database master: Database Backup...
> The backup was not performed since data verification errors were found.
>
> --
> There are similar messages for databases model and msdb.
> Questions:
> - should master, model and msdb be included in the daily backup?
> - how does one get into single user mode and repair this?
> Thanks
> Richard
>
|||Hi Lyle,
Thanks for the article. Finally, a great explanation
Richard
Lyle wrote:

> From Microsoft Article 290622:
> BUG: Databse Manintenance Plan on System Databases faile on Intergrity
> Check if "Attempt to repair minor problems" is Selected
> ... The database maintenance plan attempts to place the system databases
> in the single user mode in order to execute CkDBRepair. However the
> Master and MSDB databases cannot be placed in single user mode because of
> constantly running system processes like LAZYWRITER, LOG WRITER, SQL
> Agent... The repair step fails to run and the job reports a failure...
> There is no fix for tis bug as yet. The workaround is to disable the
> "Attempt to repair any minor problems" option in your maintenance plan.
> Lyle
sql

Wednesday, March 7, 2012

backup and restore trouble.

Hello,
We want to do a restore to a point of time.
With recovery mode on full.
Can one do a restore to a point of time before the last full backup
with a transaction log backup made after the full backup ?
Sequence.
(full recovery mode, SQL-server 7. I think.).
a. Somewere in the past a full backup is made.
b. An error is made.
c. A full backup is made.
d. A transaction log backup is made.
We want to restore to a point in time just before
the error (b.) is made. Is this possible ?
(I have got the BOL (from 7) and inside from Kalen but
can not find the anwsers there).
Ben Brugman.> We want to do a restore to a point of time.
> With recovery mode on full.
> Sequence.
> (full recovery mode, SQL-server 7. I think.).
There is no FULL recovery mode in SQL 7. In SQL 7 and earlier versions,
the 'trunc. log on chkpt.' database option turned off is similar.
> a. Somewere in the past a full backup is made.
> b. An error is made.
> c. A full backup is made.
> d. A transaction log backup is made.
> We want to restore to a point in time just before
> the error (b.) is made. Is this possible ?
You can perform point-in-time recovery as follows:
1) Restore full database backup from step 'a' WITH NORECOVERY
2) Restore transaction log backup from step 'd' WITH STOPAT (time
before step 'b' error) and RECOVERY
Note that if you have any other log backups between 'a' and 'b', these
will need to be applied (WITH NORECOVERY) before step '2' above.
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"ben brugman" <ben@.niethier.nl> wrote in message
news:bkhf32$mlv$1@.reader10.wxs.nl...
> Hello,
> We want to do a restore to a point of time.
> With recovery mode on full.
> Can one do a restore to a point of time before the last full backup
> with a transaction log backup made after the full backup ?
> Sequence.
> (full recovery mode, SQL-server 7. I think.).
> a. Somewere in the past a full backup is made.
> b. An error is made.
> c. A full backup is made.
> d. A transaction log backup is made.
> We want to restore to a point in time just before
> the error (b.) is made. Is this possible ?
> (I have got the BOL (from 7) and inside from Kalen but
> can not find the anwsers there).
> Ben Brugman.
>|||Greg,
I too have been having problems with the restore to a point in time
and your sample script was useful in trying to come to grips with
this. All this seems to do though , is to restore the datbase to the
state it was in when it was backed up to a_bak1.bak.
I have managed to write a script to add 4 records to the database ,
then do a full backup to a_bak1, then add a few more records then do
another full backup and a transaction log backup. I now want to
restore to a point where I have only entered the first two records,
but all that seems to happen is that I am restored to the point of the
first full backup.
I have attached my script (which is heavily based on the one you
originally posted).
What am I doing wrong ?...it's been driving me mad for days !!
All help gratefully received .
Kind Regards,
Nigel
"Greg Linwood" <g_linwood@.hotmail.com> wrote in message news:<#sdQMP4fDHA.2464@.TK2MSFTNGP09.phx.gbl>...
> Hi Ben.
> Are you sure you're on SQL 7.0? The term "full recovery" only came along
> with SQL 2000...
> Anyway, this should be simple - restore the last good full backup without
> recovering, then apply the transaction log & stopat the appropriate time.
> Below is a demo script that should work on both 7.0 & 2000, whichever you're
> using. Follow it carefully & you should be able to see that this is
> possible. Note that the table t1 is populated with a row, which is then
> deleted between the two full backups. By performing a normal full database
> restore without recovery, then a log restore with recovery, you can get the
> point in time you're after.
> set nocount on
> go
> use master
> go
> create database a
> on (name=a_dat, filename='c:\a_dat.mdf', size=1mb, filegrowth=1mb)
> log on (name=a_log, filename='c:\a_log.ldf', size=1mb, filegrowth=1mb )
> go
> use a
> go
> create table t1 (c1 int)
> create table t2 (restoretime varchar(26))
> go
> /* insert a row into t1. we'll expect to see this row again after restore,
> despite it being deleted before full backup 2 */
> insert into t1 values (1)
> go
> use master
> go
> /* your full backup from whenever */
> backup database a to disk='c:\a_bak1.bak'
> go
> use a
> go
> /* insert a time into t2 that can be read as a stopat time accross batches
> */
> insert into t2 values (convert(varchar(26), getdate(), 9))
> go
> /* delay one minute */
> waitfor delay '00:01:00'
> go
> /* delete the row from t1. This represents the mistake we want to recover
> before.. */
> delete from t1
> go
> use master
> go
> /* your secondary, post mistake full backup */
> backup database a to disk='c:\a_bak2.bak'
> go
> /* your log backup */
> backup log a to disk='c:\a_bak3.bak'
> go
> /* we restore to point in time captured in t2. I'm only using t2 so we could
> record that point in time accross batches for the purposes of this example
> script */
> use a
> declare @.restoretime varchar(26)
> select @.restoretime = min(restoretime) from t2
> use master
> restore database a from disk='c:\a_bak1.bak' with norecovery
> restore log a from disk='c:\a_bak3.bak' with recovery, stopat = @.restoretime
> go
> use a
> go
> /* prove that the deleted row from t1 is restored */
> select * from t1
> go
> /* clean up */
> use master
> go
> drop database a
> go
> HTH
> Regards,
> Greg Linwood
> SQL Server MVP
> "ben brugman" <ben@.niethier.nl> wrote in message
> news:bkhf32$mlv$1@.reader10.wxs.nl...
> > Hello,
> >
> > We want to do a restore to a point of time.
> >
> > With recovery mode on full.
> > Can one do a restore to a point of time before the last full backup
> > with a transaction log backup made after the full backup ?
> >
> > Sequence.
> >
> > (full recovery mode, SQL-server 7. I think.).
> > a. Somewere in the past a full backup is made.
> > b. An error is made.
> > c. A full backup is made.
> > d. A transaction log backup is made.
> >
> > We want to restore to a point in time just before
> > the error (b.) is made. Is this possible ?
> > (I have got the BOL (from 7) and inside from Kalen but
> > can not find the anwsers there).
> >
> > Ben Brugman.
> >
> >|||Hi Nigel.
There's no attachment to your post. I'm not sure, but I think these might be
getting dropped by the news-servers at the moment, so please re-post with
your script in the body of your post & I'll look at the script & try to work
it out for you..
Don't email it to me as I have a strong filter on my email & you're not in
my address book, so you won't get through..
Regards,
Greg Linwood
SQL Server MVP
"NIgel Stallard" <Nigel_Stallard@.hotmail.com> wrote in message
news:26210f56.0310080734.53626df5@.posting.google.com...
> Greg,
> I too have been having problems with the restore to a point in time
> and your sample script was useful in trying to come to grips with
> this. All this seems to do though , is to restore the datbase to the
> state it was in when it was backed up to a_bak1.bak.
> I have managed to write a script to add 4 records to the database ,
> then do a full backup to a_bak1, then add a few more records then do
> another full backup and a transaction log backup. I now want to
> restore to a point where I have only entered the first two records,
> but all that seems to happen is that I am restored to the point of the
> first full backup.
> I have attached my script (which is heavily based on the one you
> originally posted).
> What am I doing wrong ?...it's been driving me mad for days !!
> All help gratefully received .
>
> Kind Regards,
> Nigel
> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
news:<#sdQMP4fDHA.2464@.TK2MSFTNGP09.phx.gbl>...
> > Hi Ben.
> >
> > Are you sure you're on SQL 7.0? The term "full recovery" only came along
> > with SQL 2000...
> >
> > Anyway, this should be simple - restore the last good full backup
without
> > recovering, then apply the transaction log & stopat the appropriate
time.
> > Below is a demo script that should work on both 7.0 & 2000, whichever
you're
> > using. Follow it carefully & you should be able to see that this is
> > possible. Note that the table t1 is populated with a row, which is then
> > deleted between the two full backups. By performing a normal full
database
> > restore without recovery, then a log restore with recovery, you can get
the
> > point in time you're after.
> >
> > set nocount on
> > go
> > use master
> > go
> > create database a
> > on (name=a_dat, filename='c:\a_dat.mdf', size=1mb, filegrowth=1mb)
> > log on (name=a_log, filename='c:\a_log.ldf', size=1mb, filegrowth=1mb )
> > go
> > use a
> > go
> > create table t1 (c1 int)
> > create table t2 (restoretime varchar(26))
> > go
> > /* insert a row into t1. we'll expect to see this row again after
restore,
> > despite it being deleted before full backup 2 */
> > insert into t1 values (1)
> > go
> > use master
> > go
> > /* your full backup from whenever */
> > backup database a to disk='c:\a_bak1.bak'
> > go
> > use a
> > go
> > /* insert a time into t2 that can be read as a stopat time accross
batches
> > */
> > insert into t2 values (convert(varchar(26), getdate(), 9))
> > go
> > /* delay one minute */
> > waitfor delay '00:01:00'
> > go
> > /* delete the row from t1. This represents the mistake we want to
recover
> > before.. */
> > delete from t1
> > go
> > use master
> > go
> > /* your secondary, post mistake full backup */
> > backup database a to disk='c:\a_bak2.bak'
> > go
> > /* your log backup */
> > backup log a to disk='c:\a_bak3.bak'
> > go
> > /* we restore to point in time captured in t2. I'm only using t2 so we
could
> > record that point in time accross batches for the purposes of this
example
> > script */
> > use a
> > declare @.restoretime varchar(26)
> > select @.restoretime = min(restoretime) from t2
> > use master
> > restore database a from disk='c:\a_bak1.bak' with norecovery
> > restore log a from disk='c:\a_bak3.bak' with recovery, stopat =@.restoretime
> > go
> > use a
> > go
> > /* prove that the deleted row from t1 is restored */
> > select * from t1
> > go
> > /* clean up */
> > use master
> > go
> > drop database a
> > go
> >
> > HTH
> >
> > Regards,
> > Greg Linwood
> > SQL Server MVP
> >
> > "ben brugman" <ben@.niethier.nl> wrote in message
> > news:bkhf32$mlv$1@.reader10.wxs.nl...
> > > Hello,
> > >
> > > We want to do a restore to a point of time.
> > >
> > > With recovery mode on full.
> > > Can one do a restore to a point of time before the last full backup
> > > with a transaction log backup made after the full backup ?
> > >
> > > Sequence.
> > >
> > > (full recovery mode, SQL-server 7. I think.).
> > > a. Somewere in the past a full backup is made.
> > > b. An error is made.
> > > c. A full backup is made.
> > > d. A transaction log backup is made.
> > >
> > > We want to restore to a point in time just before
> > > the error (b.) is made. Is this possible ?
> > > (I have got the BOL (from 7) and inside from Kalen but
> > > can not find the anwsers there).
> > >
> > > Ben Brugman.
> > >
> > >|||Hi Greg,
The script is as follows..I know its a terrible script, I'm having to
learn as I go with this..
---
set nocount on
go
use master
create database a
on (name=a_dat, filename='c:\a_dat.mdf', size=1Mb, filegrowth=1mb)
log on (name=a_log, filename='c:\a_log.ldf', size=1mb, filegrowth=1mb)
go
use a
go
create table t1 (c1 int, restoretime varchar(26))
create table t2 (restoretime varchar (26))
go
backup database a to disk='c:\a_bak0.bak'
go
insert into t1 values(1 , convert(varchar(26), getdate() , 9))
insert into t2 values(convert(varchar(26), getdate() , 9))
waitfor delay '00:00:05'
go
insert into t1 values(2 , convert(varchar(26), getdate() , 9))
insert into t2 values(convert(varchar(26), getdate() , 9))
waitfor delay '00:00:05'
go
insert into t1 values(3 , convert(varchar(26), getdate() , 9))
insert into t2 values(convert(varchar(26), getdate() , 9))
waitfor delay '00:00:05'
go
insert into t1 values(4 , convert(varchar(26), getdate() , 9))
insert into t2 values(convert(varchar(26), getdate() , 9))
waitfor delay '00:00:05'
go
use master
go
backup database a to disk='c:\a_bak1.bak'
go
use a
go
insert into t1 values(5 , convert(varchar(26), getdate() , 9))
insert into t2 values(convert(varchar(26), getdate() , 9))
go
waitfor delay '00:00:05'
insert into t1 values(6 , convert(varchar(26), getdate() , 9))
insert into t2 values(convert(varchar(26), getdate() , 9))
go
waitfor delay '00:00:05'
go
use master
go
backup database a to disk='c:\a_bak2.bak'
go
backup log a to disk='c:\a_bak3.bak'
go
use a
go
----
Basically I'm trying to prove to myself that I can decide to restore
back to any particular transaction, which I assume is what restore to
point in time is all about.
I think I understood your original example script, but as far as i
could see there was no need to use the transaction log as the database
would be put back to the desired point in time simply by restore the
first full backup.
Basically I'm trying to prove to myself that I can decide to restore
back to any particular transaction, which I assume is what restore to
point in time is all about.
What I am attempting to do is try to restore to the point just after
the 2nd or 3rd transaction.
Thanks for your interest in my problem, most appreciated..and thanks
for the quick response.
Nigel
"Greg Linwood" <g_linwood@.hotmail.com> wrote in message news:<OvviP5ejDHA.2000@.TK2MSFTNGP12.phx.gbl>...
> Hi Nigel.
> There's no attachment to your post. I'm not sure, but I think these might be
> getting dropped by the news-servers at the moment, so please re-post with
> your script in the body of your post & I'll look at the script & try to work
> it out for you..
> Don't email it to me as I have a strong filter on my email & you're not in
> my address book, so you won't get through..
> Regards,
> Greg Linwood
> SQL Server MVP
> "NIgel Stallard" <Nigel_Stallard@.hotmail.com> wrote in message
> news:26210f56.0310080734.53626df5@.posting.google.com...
> > Greg,
> >
> > I too have been having problems with the restore to a point in time
> > and your sample script was useful in trying to come to grips with
> > this. All this seems to do though , is to restore the datbase to the
> > state it was in when it was backed up to a_bak1.bak.
> >
> > I have managed to write a script to add 4 records to the database ,
> > then do a full backup to a_bak1, then add a few more records then do
> > another full backup and a transaction log backup. I now want to
> > restore to a point where I have only entered the first two records,
> > but all that seems to happen is that I am restored to the point of the
> > first full backup.
> > I have attached my script (which is heavily based on the one you
> > originally posted).
> >
> > What am I doing wrong ?...it's been driving me mad for days !!
> >
> > All help gratefully received .
> >
> >
> > Kind Regards,
> >
> > Nigel
> >
> > "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> news:<#sdQMP4fDHA.2464@.TK2MSFTNGP09.phx.gbl>...
> > > Hi Ben.
> > >
> > > Are you sure you're on SQL 7.0? The term "full recovery" only came along
> > > with SQL 2000...
> > >
> > > Anyway, this should be simple - restore the last good full backup
> without
> > > recovering, then apply the transaction log & stopat the appropriate
> time.
> > > Below is a demo script that should work on both 7.0 & 2000, whichever
> you're
> > > using. Follow it carefully & you should be able to see that this is
> > > possible. Note that the table t1 is populated with a row, which is then
> > > deleted between the two full backups. By performing a normal full
> database
> > > restore without recovery, then a log restore with recovery, you can get
> the
> > > point in time you're after.
> > >
> > > set nocount on
> > > go
> > > use master
> > > go
> > > create database a
> > > on (name=a_dat, filename='c:\a_dat.mdf', size=1mb, filegrowth=1mb)
> > > log on (name=a_log, filename='c:\a_log.ldf', size=1mb, filegrowth=1mb )
> > > go
> > > use a
> > > go
> > > create table t1 (c1 int)
> > > create table t2 (restoretime varchar(26))
> > > go
> > > /* insert a row into t1. we'll expect to see this row again after
> restore,
> > > despite it being deleted before full backup 2 */
> > > insert into t1 values (1)
> > > go
> > > use master
> > > go
> > > /* your full backup from whenever */
> > > backup database a to disk='c:\a_bak1.bak'
> > > go
> > > use a
> > > go
> > > /* insert a time into t2 that can be read as a stopat time accross
> batches
> > > */
> > > insert into t2 values (convert(varchar(26), getdate(), 9))
> > > go
> > > /* delay one minute */
> > > waitfor delay '00:01:00'
> > > go
> > > /* delete the row from t1. This represents the mistake we want to
> recover
> > > before.. */
> > > delete from t1
> > > go
> > > use master
> > > go
> > > /* your secondary, post mistake full backup */
> > > backup database a to disk='c:\a_bak2.bak'
> > > go
> > > /* your log backup */
> > > backup log a to disk='c:\a_bak3.bak'
> > > go
> > > /* we restore to point in time captured in t2. I'm only using t2 so we
> could
> > > record that point in time accross batches for the purposes of this
> example
> > > script */
> > > use a
> > > declare @.restoretime varchar(26)
> > > select @.restoretime = min(restoretime) from t2
> > > use master
> > > restore database a from disk='c:\a_bak1.bak' with norecovery
> > > restore log a from disk='c:\a_bak3.bak' with recovery, stopat => @.restoretime
> > > go
> > > use a
> > > go
> > > /* prove that the deleted row from t1 is restored */
> > > select * from t1
> > > go
> > > /* clean up */
> > > use master
> > > go
> > > drop database a
> > > go
> > >
> > > HTH
> > >
> > > Regards,
> > > Greg Linwood
> > > SQL Server MVP
> > >
> > > "ben brugman" <ben@.niethier.nl> wrote in message
> > > news:bkhf32$mlv$1@.reader10.wxs.nl...
> > > > Hello,
> > > >
> > > > We want to do a restore to a point of time.
> > > >
> > > > With recovery mode on full.
> > > > Can one do a restore to a point of time before the last full backup
> > > > with a transaction log backup made after the full backup ?
> > > >
> > > > Sequence.
> > > >
> > > > (full recovery mode, SQL-server 7. I think.).
> > > > a. Somewere in the past a full backup is made.
> > > > b. An error is made.
> > > > c. A full backup is made.
> > > > d. A transaction log backup is made.
> > > >
> > > > We want to restore to a point in time just before
> > > > the error (b.) is made. Is this possible ?
> > > > (I have got the BOL (from 7) and inside from Kalen but
> > > > can not find the anwsers there).
> > > >
> > > > Ben Brugman.
> > > >
> > > >|||Hi Greg,
Please ignore my last post. I have sorted out the problems with the
restore to a point in time. I have noticed however that when I try to
restore to a time which is later than the last entry in the
transaction log, the database is left in a loading state. I am using
SQL Server 2000 with SP3A installed, and according to MS knowledgebase
article 319697 this particular issue was fixed with SP3. It also
states that the problem was when using Enterprise Manager to carry out
the restore. I am using a script. Have you come across this problem
even when SP3 has been installed ?
Kind Regards,
Nigel
Nigel_Stallard@.hotmail.com (NIgel Stallard) wrote in message news:<26210f56.0310090259.664b6871@.posting.google.com>...
> Hi Greg,
> The script is as follows..I know its a terrible script, I'm having to
> learn as I go with this..
> ---
> set nocount on
> go
> use master
> create database a
> on (name=a_dat, filename='c:\a_dat.mdf', size=1Mb, filegrowth=1mb)
> log on (name=a_log, filename='c:\a_log.ldf', size=1mb, filegrowth=1mb)
> go
> use a
> go
> create table t1 (c1 int, restoretime varchar(26))
> create table t2 (restoretime varchar (26))
> go
> backup database a to disk='c:\a_bak0.bak'
> go
> insert into t1 values(1 , convert(varchar(26), getdate() , 9))
> insert into t2 values(convert(varchar(26), getdate() , 9))
> waitfor delay '00:00:05'
> go
> insert into t1 values(2 , convert(varchar(26), getdate() , 9))
> insert into t2 values(convert(varchar(26), getdate() , 9))
> waitfor delay '00:00:05'
> go
> insert into t1 values(3 , convert(varchar(26), getdate() , 9))
> insert into t2 values(convert(varchar(26), getdate() , 9))
> waitfor delay '00:00:05'
> go
> insert into t1 values(4 , convert(varchar(26), getdate() , 9))
> insert into t2 values(convert(varchar(26), getdate() , 9))
> waitfor delay '00:00:05'
> go
> use master
> go
> backup database a to disk='c:\a_bak1.bak'
> go
> use a
> go
> insert into t1 values(5 , convert(varchar(26), getdate() , 9))
> insert into t2 values(convert(varchar(26), getdate() , 9))
> go
> waitfor delay '00:00:05'
> insert into t1 values(6 , convert(varchar(26), getdate() , 9))
> insert into t2 values(convert(varchar(26), getdate() , 9))
> go
> waitfor delay '00:00:05'
> go
> use master
> go
> backup database a to disk='c:\a_bak2.bak'
> go
> backup log a to disk='c:\a_bak3.bak'
> go
> use a
> go
> ----
> Basically I'm trying to prove to myself that I can decide to restore
> back to any particular transaction, which I assume is what restore to
> point in time is all about.
> I think I understood your original example script, but as far as i
> could see there was no need to use the transaction log as the database
> would be put back to the desired point in time simply by restore the
> first full backup.
> Basically I'm trying to prove to myself that I can decide to restore
> back to any particular transaction, which I assume is what restore to
> point in time is all about.
> What I am attempting to do is try to restore to the point just after
> the 2nd or 3rd transaction.
> Thanks for your interest in my problem, most appreciated..and thanks
> for the quick response.
> Nigel
>
> "Greg Linwood" <g_linwood@.hotmail.com> wrote in message news:<OvviP5ejDHA.2000@.TK2MSFTNGP12.phx.gbl>...
> > Hi Nigel.
> >
> > There's no attachment to your post. I'm not sure, but I think these might be
> > getting dropped by the news-servers at the moment, so please re-post with
> > your script in the body of your post & I'll look at the script & try to work
> > it out for you..
> >
> > Don't email it to me as I have a strong filter on my email & you're not in
> > my address book, so you won't get through..
> >
> > Regards,
> > Greg Linwood
> > SQL Server MVP
> >
> > "NIgel Stallard" <Nigel_Stallard@.hotmail.com> wrote in message
> > news:26210f56.0310080734.53626df5@.posting.google.com...
> > > Greg,
> > >
> > > I too have been having problems with the restore to a point in time
> > > and your sample script was useful in trying to come to grips with
> > > this. All this seems to do though , is to restore the datbase to the
> > > state it was in when it was backed up to a_bak1.bak.
> > >
> > > I have managed to write a script to add 4 records to the database ,
> > > then do a full backup to a_bak1, then add a few more records then do
> > > another full backup and a transaction log backup. I now want to
> > > restore to a point where I have only entered the first two records,
> > > but all that seems to happen is that I am restored to the point of the
> > > first full backup.
> > > I have attached my script (which is heavily based on the one you
> > > originally posted).
> > >
> > > What am I doing wrong ?...it's been driving me mad for days !!
> > >
> > > All help gratefully received .
> > >
> > >
> > > Kind Regards,
> > >
> > > Nigel
> > >
> > > "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> news:<#sdQMP4fDHA.2464@.TK2MSFTNGP09.phx.gbl>...
> > > > Hi Ben.
> > > >
> > > > Are you sure you're on SQL 7.0? The term "full recovery" only came along
> > > > with SQL 2000...
> > > >
> > > > Anyway, this should be simple - restore the last good full backup
> without
> > > > recovering, then apply the transaction log & stopat the appropriate
> time.
> > > > Below is a demo script that should work on both 7.0 & 2000, whichever
> you're
> > > > using. Follow it carefully & you should be able to see that this is
> > > > possible. Note that the table t1 is populated with a row, which is then
> > > > deleted between the two full backups. By performing a normal full
> database
> > > > restore without recovery, then a log restore with recovery, you can get
> the
> > > > point in time you're after.
> > > >
> > > > set nocount on
> > > > go
> > > > use master
> > > > go
> > > > create database a
> > > > on (name=a_dat, filename='c:\a_dat.mdf', size=1mb, filegrowth=1mb)
> > > > log on (name=a_log, filename='c:\a_log.ldf', size=1mb, filegrowth=1mb )
> > > > go
> > > > use a
> > > > go
> > > > create table t1 (c1 int)
> > > > create table t2 (restoretime varchar(26))
> > > > go
> > > > /* insert a row into t1. we'll expect to see this row again after
> restore,
> > > > despite it being deleted before full backup 2 */
> > > > insert into t1 values (1)
> > > > go
> > > > use master
> > > > go
> > > > /* your full backup from whenever */
> > > > backup database a to disk='c:\a_bak1.bak'
> > > > go
> > > > use a
> > > > go
> > > > /* insert a time into t2 that can be read as a stopat time accross
> batches
> > > > */
> > > > insert into t2 values (convert(varchar(26), getdate(), 9))
> > > > go
> > > > /* delay one minute */
> > > > waitfor delay '00:01:00'
> > > > go
> > > > /* delete the row from t1. This represents the mistake we want to
> recover
> > > > before.. */
> > > > delete from t1
> > > > go
> > > > use master
> > > > go
> > > > /* your secondary, post mistake full backup */
> > > > backup database a to disk='c:\a_bak2.bak'
> > > > go
> > > > /* your log backup */
> > > > backup log a to disk='c:\a_bak3.bak'
> > > > go
> > > > /* we restore to point in time captured in t2. I'm only using t2 so we
> could
> > > > record that point in time accross batches for the purposes of this
> example
> > > > script */
> > > > use a
> > > > declare @.restoretime varchar(26)
> > > > select @.restoretime = min(restoretime) from t2
> > > > use master
> > > > restore database a from disk='c:\a_bak1.bak' with norecovery
> > > > restore log a from disk='c:\a_bak3.bak' with recovery, stopat => @.restoretime
> > > > go
> > > > use a
> > > > go
> > > > /* prove that the deleted row from t1 is restored */
> > > > select * from t1
> > > > go
> > > > /* clean up */
> > > > use master
> > > > go
> > > > drop database a
> > > > go
> > > >
> > > > HTH
> > > >
> > > > Regards,
> > > > Greg Linwood
> > > > SQL Server MVP
> > > >
> > > > "ben brugman" <ben@.niethier.nl> wrote in message
> > > > news:bkhf32$mlv$1@.reader10.wxs.nl...
> > > > > Hello,
> > > > >
> > > > > We want to do a restore to a point of time.
> > > > >
> > > > > With recovery mode on full.
> > > > > Can one do a restore to a point of time before the last full backup
> > > > > with a transaction log backup made after the full backup ?
> > > > >
> > > > > Sequence.
> > > > >
> > > > > (full recovery mode, SQL-server 7. I think.).
> > > > > a. Somewere in the past a full backup is made.
> > > > > b. An error is made.
> > > > > c. A full backup is made.
> > > > > d. A transaction log backup is made.
> > > > >
> > > > > We want to restore to a point in time just before
> > > > > the error (b.) is made. Is this possible ?
> > > > > (I have got the BOL (from 7) and inside from Kalen but
> > > > > can not find the anwsers there).
> > > > >
> > > > > Ben Brugman.
> > > > >
> > > > >|||I tried some restores to a point in time. What I experienced was
that I could not restore to before the first transaction log backup.
Could be that I did not use the correct procedure, but I tried
several way to restore to some points in time all times after
the first transaction log backup were possible none before.
My solution is do a transaction backup immediatly after you have
created a database. Then there is no problem.
Could be that your problem is similar ?
Can you confirm the above ?
Thanks for sharing your knowledge,
ben brugman
"NIgel Stallard" <Nigel_Stallard@.hotmail.com> wrote in message
news:26210f56.0310090757.2a60601a@.posting.google.com...
> Hi Greg,
> Please ignore my last post. I have sorted out the problems with the
> restore to a point in time. I have noticed however that when I try to
> restore to a time which is later than the last entry in the
> transaction log, the database is left in a loading state. I am using
> SQL Server 2000 with SP3A installed, and according to MS knowledgebase
> article 319697 this particular issue was fixed with SP3. It also
> states that the problem was when using Enterprise Manager to carry out
> the restore. I am using a script. Have you come across this problem
> even when SP3 has been installed ?
> Kind Regards,
> Nigel
> Nigel_Stallard@.hotmail.com (NIgel Stallard) wrote in message
news:<26210f56.0310090259.664b6871@.posting.google.com>...
> > Hi Greg,
> >
> > The script is as follows..I know its a terrible script, I'm having to
> > learn as I go with this..
> > ---
> > set nocount on
> > go
> > use master
> > create database a
> > on (name=a_dat, filename='c:\a_dat.mdf', size=1Mb, filegrowth=1mb)
> > log on (name=a_log, filename='c:\a_log.ldf', size=1mb, filegrowth=1mb)
> > go
> > use a
> > go
> > create table t1 (c1 int, restoretime varchar(26))
> > create table t2 (restoretime varchar (26))
> > go
> > backup database a to disk='c:\a_bak0.bak'
> > go
> > insert into t1 values(1 , convert(varchar(26), getdate() , 9))
> > insert into t2 values(convert(varchar(26), getdate() , 9))
> > waitfor delay '00:00:05'
> > go
> > insert into t1 values(2 , convert(varchar(26), getdate() , 9))
> > insert into t2 values(convert(varchar(26), getdate() , 9))
> > waitfor delay '00:00:05'
> > go
> > insert into t1 values(3 , convert(varchar(26), getdate() , 9))
> > insert into t2 values(convert(varchar(26), getdate() , 9))
> > waitfor delay '00:00:05'
> > go
> > insert into t1 values(4 , convert(varchar(26), getdate() , 9))
> > insert into t2 values(convert(varchar(26), getdate() , 9))
> > waitfor delay '00:00:05'
> > go
> > use master
> > go
> > backup database a to disk='c:\a_bak1.bak'
> > go
> > use a
> > go
> > insert into t1 values(5 , convert(varchar(26), getdate() , 9))
> > insert into t2 values(convert(varchar(26), getdate() , 9))
> > go
> > waitfor delay '00:00:05'
> > insert into t1 values(6 , convert(varchar(26), getdate() , 9))
> > insert into t2 values(convert(varchar(26), getdate() , 9))
> > go
> > waitfor delay '00:00:05'
> > go
> > use master
> > go
> > backup database a to disk='c:\a_bak2.bak'
> > go
> > backup log a to disk='c:\a_bak3.bak'
> > go
> > use a
> > go
> ----
> >
> > Basically I'm trying to prove to myself that I can decide to restore
> > back to any particular transaction, which I assume is what restore to
> > point in time is all about.
> >
> > I think I understood your original example script, but as far as i
> > could see there was no need to use the transaction log as the database
> > would be put back to the desired point in time simply by restore the
> > first full backup.
> >
> > Basically I'm trying to prove to myself that I can decide to restore
> > back to any particular transaction, which I assume is what restore to
> > point in time is all about.
> > What I am attempting to do is try to restore to the point just after
> > the 2nd or 3rd transaction.
> >
> > Thanks for your interest in my problem, most appreciated..and thanks
> > for the quick response.
> >
> > Nigel
> >
> >
> > "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
news:<OvviP5ejDHA.2000@.TK2MSFTNGP12.phx.gbl>...
> > > Hi Nigel.
> > >
> > > There's no attachment to your post. I'm not sure, but I think these
might be
> > > getting dropped by the news-servers at the moment, so please re-post
with
> > > your script in the body of your post & I'll look at the script & try
to work
> > > it out for you..
> > >
> > > Don't email it to me as I have a strong filter on my email & you're
not in
> > > my address book, so you won't get through..
> > >
> > > Regards,
> > > Greg Linwood
> > > SQL Server MVP
> > >
> > > "NIgel Stallard" <Nigel_Stallard@.hotmail.com> wrote in message
> > > news:26210f56.0310080734.53626df5@.posting.google.com...
> > > > Greg,
> > > >
> > > > I too have been having problems with the restore to a point in time
> > > > and your sample script was useful in trying to come to grips with
> > > > this. All this seems to do though , is to restore the datbase to the
> > > > state it was in when it was backed up to a_bak1.bak.
> > > >
> > > > I have managed to write a script to add 4 records to the database ,
> > > > then do a full backup to a_bak1, then add a few more records then do
> > > > another full backup and a transaction log backup. I now want to
> > > > restore to a point where I have only entered the first two records,
> > > > but all that seems to happen is that I am restored to the point of
the
> > > > first full backup.
> > > > I have attached my script (which is heavily based on the one you
> > > > originally posted).
> > > >
> > > > What am I doing wrong ?...it's been driving me mad for days !!
> > > >
> > > > All help gratefully received .
> > > >
> > > >
> > > > Kind Regards,
> > > >
> > > > Nigel
> > > >
> > > > "Greg Linwood" <g_linwood@.hotmail.com> wrote in message
> > news:<#sdQMP4fDHA.2464@.TK2MSFTNGP09.phx.gbl>...
> > > > > Hi Ben.
> > > > >
> > > > > Are you sure you're on SQL 7.0? The term "full recovery" only came
along
> > > > > with SQL 2000...
> > > > >
> > > > > Anyway, this should be simple - restore the last good full backup
> > without
> > > > > recovering, then apply the transaction log & stopat the
appropriate
> > time.
> > > > > Below is a demo script that should work on both 7.0 & 2000,
whichever
> > you're
> > > > > using. Follow it carefully & you should be able to see that this
is
> > > > > possible. Note that the table t1 is populated with a row, which is
then
> > > > > deleted between the two full backups. By performing a normal full
> > database
> > > > > restore without recovery, then a log restore with recovery, you
can get
> > the
> > > > > point in time you're after.
> > > > >
> > > > > set nocount on
> > > > > go
> > > > > use master
> > > > > go
> > > > > create database a
> > > > > on (name=a_dat, filename='c:\a_dat.mdf', size=1mb, filegrowth=1mb)
> > > > > log on (name=a_log, filename='c:\a_log.ldf', size=1mb,
filegrowth=1mb )
> > > > > go
> > > > > use a
> > > > > go
> > > > > create table t1 (c1 int)
> > > > > create table t2 (restoretime varchar(26))
> > > > > go
> > > > > /* insert a row into t1. we'll expect to see this row again after
> > restore,
> > > > > despite it being deleted before full backup 2 */
> > > > > insert into t1 values (1)
> > > > > go
> > > > > use master
> > > > > go
> > > > > /* your full backup from whenever */
> > > > > backup database a to disk='c:\a_bak1.bak'
> > > > > go
> > > > > use a
> > > > > go
> > > > > /* insert a time into t2 that can be read as a stopat time accross
> > batches
> > > > > */
> > > > > insert into t2 values (convert(varchar(26), getdate(), 9))
> > > > > go
> > > > > /* delay one minute */
> > > > > waitfor delay '00:01:00'
> > > > > go
> > > > > /* delete the row from t1. This represents the mistake we want to
> > recover
> > > > > before.. */
> > > > > delete from t1
> > > > > go
> > > > > use master
> > > > > go
> > > > > /* your secondary, post mistake full backup */
> > > > > backup database a to disk='c:\a_bak2.bak'
> > > > > go
> > > > > /* your log backup */
> > > > > backup log a to disk='c:\a_bak3.bak'
> > > > > go
> > > > > /* we restore to point in time captured in t2. I'm only using t2
so we
> > could
> > > > > record that point in time accross batches for the purposes of this
> > example
> > > > > script */
> > > > > use a
> > > > > declare @.restoretime varchar(26)
> > > > > select @.restoretime = min(restoretime) from t2
> > > > > use master
> > > > > restore database a from disk='c:\a_bak1.bak' with norecovery
> > > > > restore log a from disk='c:\a_bak3.bak' with recovery, stopat => > @.restoretime
> > > > > go
> > > > > use a
> > > > > go
> > > > > /* prove that the deleted row from t1 is restored */
> > > > > select * from t1
> > > > > go
> > > > > /* clean up */
> > > > > use master
> > > > > go
> > > > > drop database a
> > > > > go
> > > > >
> > > > > HTH
> > > > >
> > > > > Regards,
> > > > > Greg Linwood
> > > > > SQL Server MVP
> > > > >
> > > > > "ben brugman" <ben@.niethier.nl> wrote in message
> > > > > news:bkhf32$mlv$1@.reader10.wxs.nl...
> > > > > > Hello,
> > > > > >
> > > > > > We want to do a restore to a point of time.
> > > > > >
> > > > > > With recovery mode on full.
> > > > > > Can one do a restore to a point of time before the last full
backup
> > > > > > with a transaction log backup made after the full backup ?
> > > > > >
> > > > > > Sequence.
> > > > > >
> > > > > > (full recovery mode, SQL-server 7. I think.).
> > > > > > a. Somewere in the past a full backup is made.
> > > > > > b. An error is made.
> > > > > > c. A full backup is made.
> > > > > > d. A transaction log backup is made.
> > > > > >
> > > > > > We want to restore to a point in time just before
> > > > > > the error (b.) is made. Is this possible ?
> > > > > > (I have got the BOL (from 7) and inside from Kalen but
> > > > > > can not find the anwsers there).
> > > > > >
> > > > > > Ben Brugman.
> > > > > >
> > > > > >

Thursday, February 16, 2012

Backup

Hi

I had problem with my backup file. I'm taking backup on remote machine a full backup in append mode just because my database size is small.Due to some reason the backup was incompleted that was shown when i'm looking the file. Now when i' try to backup on same file it gives an error messages. Is it possible to remove the incomplete mark on file.Even if i try overite the file its not allowed. Tell me why its so and how to use the same file without moving it.Howdy

No - rename the old file & use a new file . If the old file is corrupted, you run the risk of continually using a corrupted backup - not a good thing.

Cheers,

SG.

backup

Can I do a diffenential Backup on a simple recovery mode Database?Sure as long as you have a valid FULL backup first.
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Ron A" <omranu@.Gmail.com> wrote in message
news:eTamVBQHIHA.4684@.TK2MSFTNGP06.phx.gbl...
> Can I do a diffenential Backup on a simple recovery mode Database?
>

Sunday, February 12, 2012

BackLinkLogBlockReadAheadAsync

Does anyone know what this error message means? Our
database keeps kicking into Suspect mode with severity
21. We use SQL Server 2000, running on Windows 2000. The
error message that appears is 'Operating system error 997
(Overlapped I/O operation is in progress.) on
device 'e:\logfiles\lwidwh01_log.ldf' during
BackLinkLogBlockReadAheadAsync.' Does anyone know what
this means, or has anyone dealt with this kind of
problem?
Thanks
.Sounds like a hardware issue. I would run a diagnostic tool to check if the
drives and RAID controller(s) are fine.
"Tracy" wrote:
> Does anyone know what this error message means? Our
> database keeps kicking into Suspect mode with severity
> 21. We use SQL Server 2000, running on Windows 2000. The
> error message that appears is 'Operating system error 997
> (Overlapped I/O operation is in progress.) on
> device 'e:\logfiles\lwidwh01_log.ldf' during
> BackLinkLogBlockReadAheadAsync.' Does anyone know what
> this means, or has anyone dealt with this kind of
> problem?
> Thanks
> ..
>
>

BackLinkLogBlockReadAheadAsync

Does anyone know what this error message means? Our
database keeps kicking into Suspect mode with severity
21. We use SQL Server 2000, running on Windows 2000. The
error message that appears is 'Operating system error 997
(Overlapped I/O operation is in progress.) on
device 'e:\logfiles\lwidwh01_log.ldf' during
BackLinkLogBlockReadAheadAsync.' Does anyone know what
this means, or has anyone dealt with this kind of
problem?
Thanks
..
Sounds like a hardware issue. I would run a diagnostic tool to check if the
drives and RAID controller(s) are fine.
"Tracy" wrote:

> Does anyone know what this error message means? Our
> database keeps kicking into Suspect mode with severity
> 21. We use SQL Server 2000, running on Windows 2000. The
> error message that appears is 'Operating system error 997
> (Overlapped I/O operation is in progress.) on
> device 'e:\logfiles\lwidwh01_log.ldf' during
> BackLinkLogBlockReadAheadAsync.' Does anyone know what
> this means, or has anyone dealt with this kind of
> problem?
> Thanks
> ..
>
>