Sunday, February 19, 2012

Damaged backup file?

Hello
When I try to restore database from a specific backup file
using Enterprise Manager I get this error message:
+---+
| Microsoft SQL-DMO (ODBC SQLState: HY000) |
+---+
| Location: recbase.cpp:1378 |
| Expression: m_offBeginVar < m_SizeRec |
| SPID: 51 |
| Process ID: 1544 |
| |
| [ OK ] |
| |
+---+
The backup file contains 2 files: data file and a log file.
Restoring only data file is successful, but leaves the DB
in "Loading" state. Restoring only a log file to this partialy
restored DB is unsuccessful - generates the same error as in
full restore, and leaves DB in "Loading/Suspect" state.
Backup verification (used in SQL Query Analyzer):
RESTORE VERIFYONLY
FROM DISK = '...'
returns "The backup set is valid."
Restoring with SQL Suery Analyzer using statement:
RESTORE DATABASE [db_name]
FROM DISK = '...'
gives:
Processed 2088 pages for database 'db_name', file 'xxx_Data' on file 1.
Processed 1 pages for database 'mf_test', file 'xxx_Log' on file 1.
Server: Msg 3624, Level 20, State 1, Line 1
Location: R:\sql\ntdbms\storeng\drs\include\record.inl:1447
Expression: m_SizeRec > 0 && m_SizeRec <= MAXDATAROW
SPID: 52
Process ID: 1544
Connection Broken
Is there any way to recover any data from this apparently damaged backup
file? Maybe there's a way to ignore the log file and have the DB in
usable state...
Hilarion
> Backup verification (used in SQL Query Analyzer):
> RESTORE VERIFYONLY
> FROM DISK = '...'
> returns "The backup set is valid."
VERIFYONLY doesn't verify internal consistency of the backup. Essentially only that the file is
readable and that it is a SQL Server backup.

> Is there any way to recover any data from this apparently damaged backup
> file? Maybe there's a way to ignore the log file and have the DB in
> usable state...
Yes, do only one restore, from the database backup and specify WITH RECOVERY.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hilarion" <hilarion@.noemail.nospam> wrote in message news:OkWDob9nEHA.2764@.TK2MSFTNGP11.phx.gbl...
> Hello
> When I try to restore database from a specific backup file
> using Enterprise Manager I get this error message:
> +---+
> | Microsoft SQL-DMO (ODBC SQLState: HY000) |
> +---+
> | Location: recbase.cpp:1378 |
> | Expression: m_offBeginVar < m_SizeRec |
> | SPID: 51 |
> | Process ID: 1544 |
> | |
> | [ OK ] |
> | |
> +---+
> The backup file contains 2 files: data file and a log file.
> Restoring only data file is successful, but leaves the DB
> in "Loading" state. Restoring only a log file to this partialy
> restored DB is unsuccessful - generates the same error as in
> full restore, and leaves DB in "Loading/Suspect" state.
> Backup verification (used in SQL Query Analyzer):
> RESTORE VERIFYONLY
> FROM DISK = '...'
> returns "The backup set is valid."
> Restoring with SQL Suery Analyzer using statement:
> RESTORE DATABASE [db_name]
> FROM DISK = '...'
> gives:
> Processed 2088 pages for database 'db_name', file 'xxx_Data' on file 1.
> Processed 1 pages for database 'mf_test', file 'xxx_Log' on file 1.
> Server: Msg 3624, Level 20, State 1, Line 1
> Location: R:\sql\ntdbms\storeng\drs\include\record.inl:1447
> Expression: m_SizeRec > 0 && m_SizeRec <= MAXDATAROW
> SPID: 52
> Process ID: 1544
> Connection Broken
>
> Is there any way to recover any data from this apparently damaged backup
> file? Maybe there's a way to ignore the log file and have the DB in
> usable state...
> Hilarion
>
|||> > Is there any way to recover any data from this apparently damaged backup[vbcol=seagreen]

> Yes, do only one restore, from the database backup and specify WITH RECOVERY.
Could you supply correct RESTORE statement? Cause:
RESTORE DATABASE [db_name]
FROM DISK = '...'
WITH RECOVERY
gives:
Processed 2088 pages for database 'db_name', file 'xxx_Data' on file 1.
Processed 1 pages for database 'db_name', file 'xxx_Log' on file 1.
Server: Msg 3624, Level 20, State 1, Line 1
Location: recbase.cpp:1378
Expression: m_offBeginVar < m_SizeRec
SPID: 52
Process ID: 3652
Connection Broken
RESTORE DATABASE [db_name]
FILEGROUP = 'PRIMARY'
FROM DISK = '...'
WITH RECOVERY
gives:
Server: Msg 3032, Level 16, State 2, Line 1
One or more of the options (recovery) are not supported for this statement.
Review the documentation for supported options.
RESTORE DATABASE [db_name]
FILEGROUP = 'PRIMARY'
FROM DISK = '...'
WITH PARTIAL, RECOVERY
gives:
Processed 2088 pages for database 'db_name', file 'xxx_Data' on file 1.
Processed 1 pages for database 'db_name', file 'xxx_Log' on file 1.
Server: Msg 3624, Level 20, State 1, Line 1
Location: recbase.cpp:1378
Expression: m_offBeginVar < m_SizeRec
SPID: 52
Process ID: 3652
Connection Broken
Tried also some other statements. Seems like "RECOVERY" forces restore
of all files (also log file, which is damaged).
I do not know how to specify WITH RECOVERY in Enterprise Manager, and
how to specify single file ('xxx_Data' data file) to be restored in
RESTORE WITH RECOVERY statement. "SQL Server Books Online" aren't very
helpful in this case.
Hilarion
|||Seems you indeed have some corruption in your database backup (the log records therein). And SQL
server need those log records to give you a consistent state of the database. I suggest you open a
case with MS Support for this, they *might* have ways to get the database back...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hilarion" <hilarion@.noemail.nospam> wrote in message
news:%23PcYxrKoEHA.3424@.TK2MSFTNGP12.phx.gbl...
>
> Could you supply correct RESTORE statement? Cause:
> RESTORE DATABASE [db_name]
> FROM DISK = '...'
> WITH RECOVERY
> gives:
> Processed 2088 pages for database 'db_name', file 'xxx_Data' on file 1.
> Processed 1 pages for database 'db_name', file 'xxx_Log' on file 1.
> Server: Msg 3624, Level 20, State 1, Line 1
> Location: recbase.cpp:1378
> Expression: m_offBeginVar < m_SizeRec
> SPID: 52
> Process ID: 3652
> Connection Broken
> RESTORE DATABASE [db_name]
> FILEGROUP = 'PRIMARY'
> FROM DISK = '...'
> WITH RECOVERY
> gives:
> Server: Msg 3032, Level 16, State 2, Line 1
> One or more of the options (recovery) are not supported for this statement.
> Review the documentation for supported options.
>
> RESTORE DATABASE [db_name]
> FILEGROUP = 'PRIMARY'
> FROM DISK = '...'
> WITH PARTIAL, RECOVERY
> gives:
> Processed 2088 pages for database 'db_name', file 'xxx_Data' on file 1.
> Processed 1 pages for database 'db_name', file 'xxx_Log' on file 1.
> Server: Msg 3624, Level 20, State 1, Line 1
> Location: recbase.cpp:1378
> Expression: m_offBeginVar < m_SizeRec
> SPID: 52
> Process ID: 3652
> Connection Broken
>
> Tried also some other statements. Seems like "RECOVERY" forces restore
> of all files (also log file, which is damaged).
>
> I do not know how to specify WITH RECOVERY in Enterprise Manager, and
> how to specify single file ('xxx_Data' data file) to be restored in
> RESTORE WITH RECOVERY statement. "SQL Server Books Online" aren't very
> helpful in this case.
> Hilarion
>
|||> Seems you indeed have some corruption in your database
> backup (the log records therein). And SQL server need
> those log records to give you a consistent state of the
> database. I suggest you open a case with MS Support for
> this, they *might* have ways to get the database back...
I hoped some Microsoft specialist will answer my posts
here, but thanx anyway.
Hilarion
|||> I hoped some Microsoft specialist will answer my posts
> here
What happened to:
MSDN managed newsgroups provide:
- Unlimited on-line technical support - keep your PSS incidents
- A commitment to respond to your post within >>two business days<<
- Over 200 newsgroups to choose from
- Spam protection for your e-mail address when posting items
|||Well, this is an MSDN managed newsgroup so if you are an MSDN subscriber and
had posted from a registered anti-spam posting alias, you would have gotten
a response from someone on the MSDN managed newsgroups team. However,
hilarion@.noemail.nospam doesn't appear to be registered. If you are an MSDN
subscriber, please start at
http://support.microsoft.com/default...am.asp&SD=msdn
and follow the directions to register your anti-spam alias. It may take a
little while to get into the system, but once it is you'll start getting
those responses.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"Hilarion" <hilarion@.noemail.nospam> wrote in message
news:uO21hyVoEHA.2068@.TK2MSFTNGP09.phx.gbl...
> What happened to:
>
> MSDN managed newsgroups provide:
> - Unlimited on-line technical support - keep your PSS incidents
> - A commitment to respond to your post within >>two business days<<
> - Over 200 newsgroups to choose from
> - Spam protection for your e-mail address when posting items
>
|||Oh, and I'm not a file recovery specialist so I didn't address your original
question in my response, but that type of recovery isn't something that they
handle via the newsgroups anyway. If they can do anything, it really does
require that you open a case.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stephen Dybing [MSFT]" <stephd@.online.microsoft.com> wrote in message
news:e%231S%23cZoEHA.3792@.TK2MSFTNGP11.phx.gbl...
> Well, this is an MSDN managed newsgroup so if you are an MSDN subscriber
> and had posted from a registered anti-spam posting alias, you would have
> gotten a response from someone on the MSDN managed newsgroups team.
> However, hilarion@.noemail.nospam doesn't appear to be registered. If you
> are an MSDN subscriber, please start at
> http://support.microsoft.com/default...am.asp&SD=msdn
> and follow the directions to register your anti-spam alias. It may take a
> little while to get into the system, but once it is you'll start getting
> those responses.
> --
> Sincerely,
> Stephen Dybing
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Hilarion" <hilarion@.noemail.nospam> wrote in message
> news:uO21hyVoEHA.2068@.TK2MSFTNGP09.phx.gbl...
>
|||Hello
I did that (a day or something about) before posting the original post (and
re-registered few minutes ago getting "Please chose a more unique Nickname and
submit again" which means that this alias _is_ registered), so I do not know what
else should I do.
The link you gave is not entirely valid. Under this address:
http://support.microsoft.com/default...am.asp&SD=msdn
one can only find this information:
<info>
For security purposes, we have moved the registration page to the MSDN Subscriber
Downloads site located at:
http://msdn.microsoft.com/subscriptions/downloads/
After you have access to Subscriber Downloads.
1. Select the What's Hot Link.
2. Select the Managed Newsgroup link.
3. Create your no-spam alias.
</info>
Using given address (http://msdn.microsoft.com/subscriptions/downloads/), and
the link "MSDN Managed Newsgroups" leading to http://msdn.microsoft.com/newsgroups/managed/
one gets to a page with "Register" link, which is:
http://support.microsoft.com/default...am.asp&SD=msdn
so we end up circling around.
Only way to register is _not_ to follow the first instruction, and use "here"
link (https://msdn.one.microsoft.com/Subsc...NewsGroups.asp)
on "What's Hot" (in Managed Newsgroups section). Sometimes one has to use this
link twice before getting to the proper webpage.
Hilarion

> Well, this is an MSDN managed newsgroup so if you are an MSDN subscriber and had posted from a registered anti-spam posting alias,
> you would have gotten a response from someone on the MSDN managed newsgroups team. However, hilarion@.noemail.nospam doesn't appear
> to be registered. If you are an MSDN subscriber, please start at
> http://support.microsoft.com/default...am.asp&SD=msdn and follow the directions to register your
> anti-spam alias. It may take a little while to get into the system, but once it is you'll start getting those responses.
|||> Oh, and I'm not a file recovery specialist so I didn't address your original question in my response, but that type of recovery
> isn't something that they handle via the newsgroups anyway. If they can do anything, it really does require that you open a case.
OK. That is the answer I was waiting for. Maybe not very helpful, but concrete
and at least a bit official.
Hilarion

No comments:

Post a Comment