Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
dexter.knudson
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-02-13 : 16:43:31
|
I run the scripts below & everything seems to run ok. But when I query the DB for data entered since the DB backup which should be on the log, I don't see any. What am I missing?Thanks.RESTORE DATABASE yyyyy_Prod_StagingFROM DISK = '\\xxxxxxxxx\Backup\yyyyy_Full.bak'WITH NORECOVERY, REPLACE, MOVE 'yyyyyData' TO 'E:\Program Files\Microsoft SQL Server\MSSQL10.DEV\MSSQL\DATA\yyyyy_Prod_Staging.mdf' ,MOVE 'yyyyyLog' TO 'D:\Program Files\Microsoft SQL Server\MSSQL10.DEV\MSSQL\DATA\yyyyy_Prod_Staging.ldf'---- Restore TRAN LOGRESTORE LOG yyyyy_Prod_StagingFROM DISK = '\\xxxxxxx\Backup\yyyyy_Transaction.trn' WITH RECOVERY |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dexter.knudson
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-02-13 : 20:40:42
|
Hi Tara,Thanks. Do I need to specify this in the script somehow? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dexter.knudson
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-02-13 : 22:25:06
|
I am restoring all tlogs which are there for today (A few in the one file) & I am searching for rows created in a table with today's date on it. So I would expect it should be there.I am getting a message which may explain the problem:Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.Not sure where/why this is appearingthanks.----------------------------------------------------------------------------------RESTORE DATABASE YYYY_Prod_StagingFROM DISK = '\\xxxxx\Backup\YYYY_Full.bak'WITH NORECOVERY, REPLACE, MOVE 'YYYYData' TO 'E:\Program Files\Microsoft SQL Server\MSSQL10.DEV\MSSQL\DATA\YYYY_Prod_Staging.mdf' ,MOVE 'YYYYLog' TO 'D:\Program Files\Microsoft SQL Server\MSSQL10.DEV\MSSQL\DATA\YYYY_Prod_Staging.ldf'GORESTORE LOG YYYY_Prod_StagingFROM DISK = '\\xxxxxx\Backup\YYYY_Transaction.trn' WITH NORECOVERYGORESTORE DATABASE YYYY_Prod_Staging WITH RECOVERYGO-----------------------------------------------------------------------OUTPUT-----------------------------------------------------------------------Processed 2707824 pages for database 'YYYY_Prod_Staging', file 'YYYYData' on file 1.Processed 9 pages for database 'YYYY_Prod_Staging', file 'YYYYLog' on file 1.RESTORE DATABASE successfully processed 2707833 pages in 151.548 seconds (139.592 MB/sec).Processed 0 pages for database 'YYYY_Prod_Staging', file 'YYYYData' on file 1.Processed 432 pages for database 'YYYY_Prod_Staging', file 'YYYYLog' on file 1.RESTORE LOG successfully processed 432 pages in 0.055 seconds (61.301 MB/sec).Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.RESTORE DATABASE successfully processed 0 pages in 15.803 seconds (0.000 MB/sec). |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dexter.knudson
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-02-13 : 23:06:10
|
OK. Thanks. So you see no problem with the script or this message:Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dexter.knudson
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-02-14 : 14:46:53
|
That is the full script. It is being restored to a different server, could that be a factor? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dexter.knudson
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-02-14 : 16:03:19
|
It's the last statement which causes it:RESTORE DATABASE yyyy_Prod_Staging WITH RECOVERYGO |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dexter.knudson
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-02-14 : 16:40:40
|
Here's a Transact SQL extract from profiler output:RESTORE DATABASE YYYY_Prod_StagingFROM DISK = '\\xxxxxx\Backup\YYYY_Full.bak'WITH NORECOVERY, REPLACE, MOVE 'YYYYData' TO 'E:\Program Files\Microsoft SQL Server\MSSQL10.DEV\MSSQL\DATA\YYYY_Prod_Staging.mdf' ,MOVE 'YYYYLog' TO 'D:\Program Files\Microsoft SQL Server\MSSQL10.DEV\MSSQL\DATA\YYYY_Prod_Staging.ldf'go---- Restore TRAN LOGRESTORE LOG YYYY_Prod_StagingFROM DISK = '\\xxxxxx\Backup\YYYY_Transaction.trn' WITH NORECOVERYgoRESTORE DATABASE YYYY_Prod_Staging WITH RECOVERYgoSELECT SYSTEM_USERgoSET ROWCOUNT 0 SET TEXTSIZE 2147483647 SET NOCOUNT OFF SET CONCAT_NULL_YIELDS_NULL ON SET ARITHABORT ON SET LOCK_TIMEOUT -1 SET QUERY_GOVERNOR_COST_LIMIT 0 SET DEADLOCK_PRIORITY NORMAL SET TRANSACTION ISOLATION LEVEL READ COMMITTED SET ANSI_NULLS ON SET ANSI_NULL_DFLT_ON ON SET ANSI_PADDING ON SET ANSI_WARNINGS ON SET CURSOR_CLOSE_ON_COMMIT OFF SET IMPLICIT_TRANSACTIONS OFF SET QUOTED_IDENTIFIER ONgoselect @@spid;select SERVERPROPERTY('ProductLevel'); |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dexter.knudson
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-02-14 : 17:03:30
|
Thanks anyway. Appreciate your help. |
 |
|
|
|
|
|
|