I was wondering how the automatic creation of a LDF (log)
file worked in MSSQL Server 2000. Is there a special
utility to use? I only have an MDF file and I try
to "Attach" it as a database. I get the following error
message:
--
Microsoft SQL-DMO (ODBC SQLState: 42000)
--
Error 1813: Could not open new database 'DBName'. CREATE
DATABASE is aborted.
Device activation error. The physical file name 'C:\SQL
Data\DBName_log.ldf' may be incorrect.
--
OK
--
It's looking for the ldf file and it won't create it. How
do I get it to create a new log file? I tried creating a
new blank database with the same name and using it's ldf,
but somehow it knows they're not from the same database.
ThanksDanny,
May be there were some open transactions and its searching the ldf file for
matching.Was this database properly detached before?A prerequisite for
sp_attach* is that the database should be properly detached using
sp_detach_db.Either you can RESTORE from a valid and latest database backup
or try the workaround mentioned in :
Restoring databases when only data file available
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
The archived newsgroup thread
http://tinyurl.com/m071
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"Danny Forbes" <dforbes@.salessimplicity.net> wrote in message
news:105901c3724a$14f89e50$a601280a@.phx.gbl...
> I was wondering how the automatic creation of a LDF (log)
> file worked in MSSQL Server 2000. Is there a special
> utility to use? I only have an MDF file and I try
> to "Attach" it as a database. I get the following error
> message:
> --
> Microsoft SQL-DMO (ODBC SQLState: 42000)
> --
> Error 1813: Could not open new database 'DBName'. CREATE
> DATABASE is aborted.
> Device activation error. The physical file name 'C:\SQL
> Data\DBName_log.ldf' may be incorrect.
> --
> OK
> --
> It's looking for the ldf file and it won't create it. How
> do I get it to create a new log file? I tried creating a
> new blank database with the same name and using it's ldf,
> but somehow it knows they're not from the same database.
> Thanks|||Hi,
- Change your DB Status to Emergency Mode (32768).
- Stop SQL Server / Start SQL
- In query analyser, execute dbcc rebuild_log. REMEMBER: Rename old File Log
before.
- Change Your DB Status to Normal (0)
- Stop SQL Server / Start SQL
This error is because your GUID of file Log not match with definition of
your DB.
Regards,
Fabiano Maciel
"Danny Forbes" <dforbes@.salessimplicity.net> wrote in message
news:105901c3724a$14f89e50$a601280a@.phx.gbl...
> I was wondering how the automatic creation of a LDF (log)
> file worked in MSSQL Server 2000. Is there a special
> utility to use? I only have an MDF file and I try
> to "Attach" it as a database. I get the following error
> message:
> --
> Microsoft SQL-DMO (ODBC SQLState: 42000)
> --
> Error 1813: Could not open new database 'DBName'. CREATE
> DATABASE is aborted.
> Device activation error. The physical file name 'C:\SQL
> Data\DBName_log.ldf' may be incorrect.
> --
> OK
> --
> It's looking for the ldf file and it won't create it. How
> do I get it to create a new log file? I tried creating a
> new blank database with the same name and using it's ldf,
> but somehow it knows they're not from the same database.
> Thanks
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment