I'm learning how to restore a database to a point-in-time. I set up a
database called DR_TEST and a table called tblTest with a single
varchar column. I back up the database using the following command:
use master
go
BACKUP DATABASE DR_TEST
TO DISK = 'c:\backup\dr_test\dr.bak'
go
Then I run a TSQL script to continuously insert records into the
tblTest table. Using Enterprise Manager I have a scheduled transaction
log backup running every three minutes to c:\backup\dr_test\drLog.bak.
I drop the tblTest table and backup the transaction log using the
following command:
BACKUP LOG DR_TEST
TO DISK = 'c:\backup\dr_test\drLog.bak'
I then run the following commands to restore the database to it's state
at 2:25 PM:
use master
go
RESTORE DATABASE DR_TEST
FROM DISK = 'C:\BACKUP\DR_TEST\dr.bak'
WITH NORECOVERY
go
RESTORE LOG DR_TEST
FROM DISK = 'C:\BACKUP\DR_TEST\drLog.bak'
WITH RECOVERY,
STOPAT = N'11/16/2006 2:25 PM'
go
When I run the log restore I get the following message:
This log file contains records logged before the designated
point-in-time. The database is being left in load state so you can
apply another log file.
I started inserting the data at 2:22 PM and I dropped the table at 2:27
PM. Why would I get this message?
JerrySeems you did several log backups but only restored the very first one...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jerry" <jerryalan@.gmail.com> wrote in message
news:1163710146.977620.47300@.e3g2000cwe.googlegroups.com...
> I'm learning how to restore a database to a point-in-time. I set up a
> database called DR_TEST and a table called tblTest with a single
> varchar column. I back up the database using the following command:
> use master
> go
> BACKUP DATABASE DR_TEST
> TO DISK = 'c:\backup\dr_test\dr.bak'
> go
> Then I run a TSQL script to continuously insert records into the
> tblTest table. Using Enterprise Manager I have a scheduled transaction
> log backup running every three minutes to c:\backup\dr_test\drLog.bak.
> I drop the tblTest table and backup the transaction log using the
> following command:
> BACKUP LOG DR_TEST
> TO DISK = 'c:\backup\dr_test\drLog.bak'
> I then run the following commands to restore the database to it's state
> at 2:25 PM:
> use master
> go
> RESTORE DATABASE DR_TEST
> FROM DISK = 'C:\BACKUP\DR_TEST\dr.bak'
> WITH NORECOVERY
> go
> RESTORE LOG DR_TEST
> FROM DISK = 'C:\BACKUP\DR_TEST\drLog.bak'
> WITH RECOVERY,
> STOPAT = N'11/16/2006 2:25 PM'
> go
> When I run the log restore I get the following message:
> This log file contains records logged before the designated
> point-in-time. The database is being left in load state so you can
> apply another log file.
> I started inserting the data at 2:22 PM and I dropped the table at 2:27
> PM. Why would I get this message?
>
> --
> Jerry
>
Showing posts with label restoration. Show all posts
Showing posts with label restoration. Show all posts
Friday, March 23, 2012
Point-In-Time Restoration Problem
I'm learning how to restore a database to a point-in-time. I set up a
database called DR_TEST and a table called tblTest with a single
varchar column. I back up the database using the following command:
use master
go
BACKUP DATABASE DR_TEST
TO DISK = 'c:\backup\dr_test\dr.bak'
go
Then I run a TSQL script to continuously insert records into the
tblTest table. Using Enterprise Manager I have a scheduled transaction
log backup running every three minutes to c:\backup\dr_test\drLog.bak.
I drop the tblTest table and backup the transaction log using the
following command:
BACKUP LOG DR_TEST
TO DISK = 'c:\backup\dr_test\drLog.bak'
I then run the following commands to restore the database to it's state
at 2:25 PM:
use master
go
RESTORE DATABASE DR_TEST
FROM DISK = 'C:\BACKUP\DR_TEST\dr.bak'
WITH NORECOVERY
go
RESTORE LOG DR_TEST
FROM DISK = 'C:\BACKUP\DR_TEST\drLog.bak'
WITH RECOVERY,
STOPAT = N'11/16/2006 2:25 PM'
go
When I run the log restore I get the following message:
This log file contains records logged before the designated
point-in-time. The database is being left in load state so you can
apply another log file.
I started inserting the data at 2:22 PM and I dropped the table at 2:27
PM. Why would I get this message?
--
JerrySeems you did several log backups but only restored the very first one...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jerry" <jerryalan@.gmail.com> wrote in message
news:1163710146.977620.47300@.e3g2000cwe.googlegroups.com...
> I'm learning how to restore a database to a point-in-time. I set up a
> database called DR_TEST and a table called tblTest with a single
> varchar column. I back up the database using the following command:
> use master
> go
> BACKUP DATABASE DR_TEST
> TO DISK = 'c:\backup\dr_test\dr.bak'
> go
> Then I run a TSQL script to continuously insert records into the
> tblTest table. Using Enterprise Manager I have a scheduled transaction
> log backup running every three minutes to c:\backup\dr_test\drLog.bak.
> I drop the tblTest table and backup the transaction log using the
> following command:
> BACKUP LOG DR_TEST
> TO DISK = 'c:\backup\dr_test\drLog.bak'
> I then run the following commands to restore the database to it's state
> at 2:25 PM:
> use master
> go
> RESTORE DATABASE DR_TEST
> FROM DISK = 'C:\BACKUP\DR_TEST\dr.bak'
> WITH NORECOVERY
> go
> RESTORE LOG DR_TEST
> FROM DISK = 'C:\BACKUP\DR_TEST\drLog.bak'
> WITH RECOVERY,
> STOPAT = N'11/16/2006 2:25 PM'
> go
> When I run the log restore I get the following message:
> This log file contains records logged before the designated
> point-in-time. The database is being left in load state so you can
> apply another log file.
> I started inserting the data at 2:22 PM and I dropped the table at 2:27
> PM. Why would I get this message?
>
> --
> Jerry
>
database called DR_TEST and a table called tblTest with a single
varchar column. I back up the database using the following command:
use master
go
BACKUP DATABASE DR_TEST
TO DISK = 'c:\backup\dr_test\dr.bak'
go
Then I run a TSQL script to continuously insert records into the
tblTest table. Using Enterprise Manager I have a scheduled transaction
log backup running every three minutes to c:\backup\dr_test\drLog.bak.
I drop the tblTest table and backup the transaction log using the
following command:
BACKUP LOG DR_TEST
TO DISK = 'c:\backup\dr_test\drLog.bak'
I then run the following commands to restore the database to it's state
at 2:25 PM:
use master
go
RESTORE DATABASE DR_TEST
FROM DISK = 'C:\BACKUP\DR_TEST\dr.bak'
WITH NORECOVERY
go
RESTORE LOG DR_TEST
FROM DISK = 'C:\BACKUP\DR_TEST\drLog.bak'
WITH RECOVERY,
STOPAT = N'11/16/2006 2:25 PM'
go
When I run the log restore I get the following message:
This log file contains records logged before the designated
point-in-time. The database is being left in load state so you can
apply another log file.
I started inserting the data at 2:22 PM and I dropped the table at 2:27
PM. Why would I get this message?
--
JerrySeems you did several log backups but only restored the very first one...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jerry" <jerryalan@.gmail.com> wrote in message
news:1163710146.977620.47300@.e3g2000cwe.googlegroups.com...
> I'm learning how to restore a database to a point-in-time. I set up a
> database called DR_TEST and a table called tblTest with a single
> varchar column. I back up the database using the following command:
> use master
> go
> BACKUP DATABASE DR_TEST
> TO DISK = 'c:\backup\dr_test\dr.bak'
> go
> Then I run a TSQL script to continuously insert records into the
> tblTest table. Using Enterprise Manager I have a scheduled transaction
> log backup running every three minutes to c:\backup\dr_test\drLog.bak.
> I drop the tblTest table and backup the transaction log using the
> following command:
> BACKUP LOG DR_TEST
> TO DISK = 'c:\backup\dr_test\drLog.bak'
> I then run the following commands to restore the database to it's state
> at 2:25 PM:
> use master
> go
> RESTORE DATABASE DR_TEST
> FROM DISK = 'C:\BACKUP\DR_TEST\dr.bak'
> WITH NORECOVERY
> go
> RESTORE LOG DR_TEST
> FROM DISK = 'C:\BACKUP\DR_TEST\drLog.bak'
> WITH RECOVERY,
> STOPAT = N'11/16/2006 2:25 PM'
> go
> When I run the log restore I get the following message:
> This log file contains records logged before the designated
> point-in-time. The database is being left in load state so you can
> apply another log file.
> I started inserting the data at 2:22 PM and I dropped the table at 2:27
> PM. Why would I get this message?
>
> --
> Jerry
>
Point-In-Time Restoration Issue
Hello,
I'm testing "Point In Time" restoration for my system using both Database & Log backup files. (Database backup once a day; Log backup every 4 hours)
When I use T-SQL to perfrom the restoration, I can specify one .BAK file with numerous .TRN files and restore to any 'point of time' with no issue.
However, if I use EM to perform the same restoration, I can only specify one .BAK file with a maximum of two .TRN files (although I can see all the .TRN files) in order to restore the database properly. If I specify more .TRN files, after restoration, my DB will be in 'LOADING' status and can't be used.
Does anyone encounter the same problem before and know what is going on?
Thank You.When restoring a database with Enterprise Manager, make sure the 'Leave Database Operational' is checked.|||you can also always switch the database from "Loading" to "operational" modes with simple tsql command
restore database <Dbname> with recovery
simas|||hi guys,
thanks for the replies. I'll look into it.
btw, I did found out some documentation that closely describe my problem, it's "Microsoft Knowledge Base Article - 319697, FIX: SQL Enterprise Manager Restore to Point in Time Does Not Stop at Requested Time and the Database is Left in a Loading State"
Seems like it's not something new...
Thank You.
I'm testing "Point In Time" restoration for my system using both Database & Log backup files. (Database backup once a day; Log backup every 4 hours)
When I use T-SQL to perfrom the restoration, I can specify one .BAK file with numerous .TRN files and restore to any 'point of time' with no issue.
However, if I use EM to perform the same restoration, I can only specify one .BAK file with a maximum of two .TRN files (although I can see all the .TRN files) in order to restore the database properly. If I specify more .TRN files, after restoration, my DB will be in 'LOADING' status and can't be used.
Does anyone encounter the same problem before and know what is going on?
Thank You.When restoring a database with Enterprise Manager, make sure the 'Leave Database Operational' is checked.|||you can also always switch the database from "Loading" to "operational" modes with simple tsql command
restore database <Dbname> with recovery
simas|||hi guys,
thanks for the replies. I'll look into it.
btw, I did found out some documentation that closely describe my problem, it's "Microsoft Knowledge Base Article - 319697, FIX: SQL Enterprise Manager Restore to Point in Time Does Not Stop at Requested Time and the Database is Left in a Loading State"
Seems like it's not something new...
Thank You.
point in time restore error
When i use point in time restoration, it show error STOPAT , restore og
terminates why? and i can restore it without use point in time restoration!
Please post the full text of the error.
Nik Marshall-Blank MCSD/MCDBA
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!
|||Hi,
STOPAT can be used in transaction log backup and only if your source
database is in FULL RECOVERY MODEL.
See the recovery model of your source database first.
The actual syntax is:-
-- Restore the database backup.
RESTORE DATABASE MyNwind
FROM MyNwind_1, MyNwind_2
WITH NORECOVERY
GO
-- Restore the log backup with stopat option
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
GO
Thanks
Hari
SQL Server MVP
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!
terminates why? and i can restore it without use point in time restoration!
Please post the full text of the error.
Nik Marshall-Blank MCSD/MCDBA
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!
|||Hi,
STOPAT can be used in transaction log backup and only if your source
database is in FULL RECOVERY MODEL.
See the recovery model of your source database first.
The actual syntax is:-
-- Restore the database backup.
RESTORE DATABASE MyNwind
FROM MyNwind_1, MyNwind_2
WITH NORECOVERY
GO
-- Restore the log backup with stopat option
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
GO
Thanks
Hari
SQL Server MVP
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!
point in time restore error
When i use point in time restoration, it show error STOPAT , restore og
terminates why? and i can restore it without use point in time restoration!Please post the full text of the error.
--
Nik Marshall-Blank MCSD/MCDBA
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!|||Hi,
STOPAT can be used in transaction log backup and only if your source
database is in FULL RECOVERY MODEL.
See the recovery model of your source database first.
The actual syntax is:-
-- Restore the database backup.
RESTORE DATABASE MyNwind
FROM MyNwind_1, MyNwind_2
WITH NORECOVERY
GO
-- Restore the log backup with stopat option
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
GO
Thanks
Hari
SQL Server MVP
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!sql
terminates why? and i can restore it without use point in time restoration!Please post the full text of the error.
--
Nik Marshall-Blank MCSD/MCDBA
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!|||Hi,
STOPAT can be used in transaction log backup and only if your source
database is in FULL RECOVERY MODEL.
See the recovery model of your source database first.
The actual syntax is:-
-- Restore the database backup.
RESTORE DATABASE MyNwind
FROM MyNwind_1, MyNwind_2
WITH NORECOVERY
GO
-- Restore the log backup with stopat option
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
GO
Thanks
Hari
SQL Server MVP
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!sql
point in time restore error
When i use point in time restoration, it show error STOPAT , restore og
terminates why? and i can restore it without use point in time restoration!Please post the full text of the error.
Nik Marshall-Blank MCSD/MCDBA
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!|||Hi,
STOPAT can be used in transaction log backup and only if your source
database is in FULL RECOVERY MODEL.
See the recovery model of your source database first.
The actual syntax is:-
-- Restore the database backup.
RESTORE DATABASE MyNwind
FROM MyNwind_1, MyNwind_2
WITH NORECOVERY
GO
-- Restore the log backup with stopat option
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
GO
Thanks
Hari
SQL Server MVP
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!
terminates why? and i can restore it without use point in time restoration!Please post the full text of the error.
Nik Marshall-Blank MCSD/MCDBA
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!|||Hi,
STOPAT can be used in transaction log backup and only if your source
database is in FULL RECOVERY MODEL.
See the recovery model of your source database first.
The actual syntax is:-
-- Restore the database backup.
RESTORE DATABASE MyNwind
FROM MyNwind_1, MyNwind_2
WITH NORECOVERY
GO
-- Restore the log backup with stopat option
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
GO
Thanks
Hari
SQL Server MVP
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:9683A6B5-4609-450F-BC21-AD123E4DE8F3@.microsoft.com...
> When i use point in time restoration, it show error STOPAT , restore og
> terminates why? and i can restore it without use point in time
> restoration!
Subscribe to:
Posts (Atom)