Showing posts with label sp_attach_db. Show all posts
Showing posts with label sp_attach_db. Show all posts

Thursday, March 29, 2012

Attach db without transaction log file

Hi!
Is it possible attach db without transaction log file?
With store procedure like sp_attach_db and sp_attach_single_file_db it isn't go. Server still looking for transaction log file.
Thanks your helpHi,
You can use sp_attach_single_file_db only on databases that have a single
log file.
Instead try to update the database status to emergency mode and create a new
database and use DTS to transafer all objects to new database.
Steps:
1. Update the database to Emergency mode
update sysdatabases set status=32768 where name=<name of the database>
2. Craete a new database
3. Use DTS to transfer all objects
Thanks
Hari
MCDBA
"Ondrik" <anonymous@.discussions.microsoft.com> wrote in message
news:B3D1753B-C678-4A7E-AEFF-5FD7725FCC2C@.microsoft.com...
> Hi!
> Is it possible attach db without transaction log file?
> With store procedure like sp_attach_db and sp_attach_single_file_db it
isn't go. Server still looking for transaction log file.
> Thanks your help|||Try this:
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=599
--
Andrew J. Kelly
SQL Server MVP
"Ondrik" <anonymous@.discussions.microsoft.com> wrote in message
news:B3D1753B-C678-4A7E-AEFF-5FD7725FCC2C@.microsoft.com...
> Hi!
> Is it possible attach db without transaction log file?
> With store procedure like sp_attach_db and sp_attach_single_file_db it
isn't go. Server still looking for transaction log file.
> Thanks your help|||You must first: sp_detach_db
then: delete the ..._log.sfd
then: sp_attach_single_file_db
Bye
Uwe

Sunday, March 25, 2012

attach a database

I am trying to attach a database , using sp_attach_db command, that has one
MDF file and one LDF file. The LDF file was corrupt so that did not work.
I then I tried the sp_attach_single_file_db command, I got an error could no
t open the MDF file.
Any ideas on what the problem is and how to proceed?
Thanks a lot in advanceIn order to attach a database, you need to have detached it first. It is
possible that your mdf and ldf files were just copied over after the SQL
Server service was stopped. If that was the case, you could try the steps
provided by Jasper Smith at http://tinyurl.com/2o9w8
Peter Yeoh
http://www.yohz.com
Need smaller backups? Try MiniSQLBackup
"Daneil Hope" <anonymous@.discussions.microsoft.com> wrote in message
news:CA65F4FA-FF0E-4DC2-88C6-E7A7D1599646@.microsoft.com...
> I am trying to attach a database , using sp_attach_db command, that has
one MDF file and one LDF file. The LDF file was corrupt so that did not
work. I then I tried the sp_attach_single_file_db command, I got an error
could not open the MDF file.
> Any ideas on what the problem is and how to proceed?
> Thanks a lot in advance|||Thanks a lot Peter. I will try that.

attach a database

I am trying to attach a database , using sp_attach_db command, that has one MDF file and one LDF file. The LDF file was corrupt so that did not work. I then I tried the sp_attach_single_file_db command, I got an error could not open the MDF file.
Any ideas on what the problem is and how to proceed?
Thanks a lot in advance
In order to attach a database, you need to have detached it first. It is
possible that your mdf and ldf files were just copied over after the SQL
Server service was stopped. If that was the case, you could try the steps
provided by Jasper Smith at http://tinyurl.com/2o9w8
Peter Yeoh
http://www.yohz.com
Need smaller backups? Try MiniSQLBackup
"Daneil Hope" <anonymous@.discussions.microsoft.com> wrote in message
news:CA65F4FA-FF0E-4DC2-88C6-E7A7D1599646@.microsoft.com...
> I am trying to attach a database , using sp_attach_db command, that has
one MDF file and one LDF file. The LDF file was corrupt so that did not
work. I then I tried the sp_attach_single_file_db command, I got an error
could not open the MDF file.
> Any ideas on what the problem is and how to proceed?
> Thanks a lot in advance
|||Thanks a lot Peter. I will try that.