Showing posts with label attach. Show all posts
Showing posts with label attach. Show all posts

Wednesday, March 28, 2012

Problems in attaching db

Does anyone know why trying to attach a db (.mdf and .ldf files) to a new db, the "Attach database" item in the menu is disabled, please? do I have to reinstall SQL Server?Originally posted by atorlone
Does anyone know why trying to attach a db (.mdf and .ldf files) to a new db, the "Attach database" item in the menu is disabled, please? do I have to reinstall SQL Server?

You could try to attach your db with a t-sql statement.

sp_attach_db @.dbname = 'db name',
@.filename1 = 'path_to/file.mdf' ,
@.filename2 = 'path_to/file.ldf'|||I entered the following in the Query Analyzer and got the result shown:

EXEC sp_attach_db @.dbname = N'AARETAIL',
@.filename1 = N'C:\MSSQL7\Data\AARETAIL_Data.MDF',
@.filename2 = N'C:\MSSQL7\Data\AARETAIL_Log.LDF'

Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'C:\MSSQL7\Data\AARETAIL_Log.LDF' is not a valid database file header. The PageAudit property is incorrect.

I can find nothing about PageAudit property.

What is it and how do I need to modify the command?

Many thanks!|||Originally posted by atorlone
I entered the following in the Query Analyzer and got the result shown:

EXEC sp_attach_db @.dbname = N'AARETAIL',
@.filename1 = N'C:\MSSQL7\Data\AARETAIL_Data.MDF',
@.filename2 = N'C:\MSSQL7\Data\AARETAIL_Log.LDF'

Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'C:\MSSQL7\Data\AARETAIL_Log.LDF' is not a valid database file header. The PageAudit property is incorrect.

I can find nothing about PageAudit property.

What is it and how do I need to modify the command?

Many thanks!

Do you run MsSql 7 or 2000 ?|||Originally posted by atorlone
I entered the following in the Query Analyzer and got the result shown:

EXEC sp_attach_db @.dbname = N'AARETAIL',
@.filename1 = N'C:\MSSQL7\Data\AARETAIL_Data.MDF',
@.filename2 = N'C:\MSSQL7\Data\AARETAIL_Log.LDF'

Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'C:\MSSQL7\Data\AARETAIL_Log.LDF' is not a valid database file header. The PageAudit property is incorrect.

I can find nothing about PageAudit property.

What is it and how do I need to modify the command?

Many thanks!

try attaching the database without the logfile:
EXEC sp_attach_db @.dbname = N'AARETAIL',
@.filename1 = N'C:\MSSQL7\Data\AARETAIL_Data.MDF'

Tuesday, March 20, 2012

Problems attaching a SQL 2000 database

I have a customer that is trying to attach a SQL 2000
database into SQL Server 2000. I have tried Enterprise
Manager (Attach Db), T-SQL "sp_attach_db "
and "sp_attach_single_file_db" without success. I keep
on getting a errors like the ones shown in this snippet
from the SQLERRORLOG:
2003-12-10 10:00:58.79 spid51 SQL Server Assertion:
File: <p:\sql\ntdbms\storeng\drs\include\record.inl>,
line=1447
Failed Assertion = 'm_SizeRec > 0 && m_SizeRec <= MAXDATAROW'.
2003-12-10 10:00:58.79 spid51 Error: 3624, Severity:
20, State: 1.
2003-12-10 10:00:58.79 spid51 Error: 3313, Severity:
21, State: 2
2003-12-10 10:00:58.79 spid51 Error while redoing
logged operation in database 'MYDATABASE'. Error at log
record ID (84983:2649:335)..
2003-12-10 10:00:59.27 spid51 Error: 9004, Severity:
23, State: 7
The client does not have a backup :o(. Does anyone know
how I can recover from this situation? A repair option
would be much appreciated.
Thanks,
BobIt is time to call MS PSS... Sorry
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Bob" <bob.albert@.quest.com> wrote in message
news:088401c3bffe$1ebd59b0$a001280a@.phx.gbl...
> I have a customer that is trying to attach a SQL 2000
> database into SQL Server 2000. I have tried Enterprise
> Manager (Attach Db), T-SQL "sp_attach_db "
> and "sp_attach_single_file_db" without success. I keep
> on getting a errors like the ones shown in this snippet
> from the SQLERRORLOG:
> 2003-12-10 10:00:58.79 spid51 SQL Server Assertion:
> File: <p:\sql\ntdbms\storeng\drs\include\record.inl>,
> line=1447
> Failed Assertion = 'm_SizeRec > 0 && m_SizeRec <=> MAXDATAROW'.
> 2003-12-10 10:00:58.79 spid51 Error: 3624, Severity:
> 20, State: 1.
> 2003-12-10 10:00:58.79 spid51 Error: 3313, Severity:
> 21, State: 2
> 2003-12-10 10:00:58.79 spid51 Error while redoing
> logged operation in database 'MYDATABASE'. Error at log
> record ID (84983:2649:335)..
> 2003-12-10 10:00:59.27 spid51 Error: 9004, Severity:
> 23, State: 7
> The client does not have a backup :o(. Does anyone know
> how I can recover from this situation? A repair option
> would be much appreciated.
> Thanks,
> Bob|||Thanks Wayne,
I guess I'll have to do just that!
Bob
>--Original Message--
>It is time to call MS PSS... Sorry
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Computer Education Services Corporation (CESC),
Charlotte, NC
>www.computeredservices.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
>community of SQL Server professionals.
>www.sqlpass.org
>"Bob" <bob.albert@.quest.com> wrote in message
>news:088401c3bffe$1ebd59b0$a001280a@.phx.gbl...
>> I have a customer that is trying to attach a SQL 2000
>> database into SQL Server 2000. I have tried Enterprise
>> Manager (Attach Db), T-SQL "sp_attach_db "
>> and "sp_attach_single_file_db" without success. I keep
>> on getting a errors like the ones shown in this snippet
>> from the SQLERRORLOG:
>> 2003-12-10 10:00:58.79 spid51 SQL Server Assertion:
>> File: <p:\sql\ntdbms\storeng\drs\include\record.inl>,
>> line=1447
>> Failed Assertion = 'm_SizeRec > 0 && m_SizeRec <=>> MAXDATAROW'.
>> 2003-12-10 10:00:58.79 spid51 Error: 3624, Severity:
>> 20, State: 1.
>> 2003-12-10 10:00:58.79 spid51 Error: 3313, Severity:
>> 21, State: 2
>> 2003-12-10 10:00:58.79 spid51 Error while redoing
>> logged operation in database 'MYDATABASE'. Error at log
>> record ID (84983:2649:335)..
>> 2003-12-10 10:00:59.27 spid51 Error: 9004, Severity:
>> 23, State: 7
>> The client does not have a backup :o(. Does anyone
know
>> how I can recover from this situation? A repair option
>> would be much appreciated.
>> Thanks,
>> Bob
>
>.
>