Sp_attach_single_file_db Question
Jun 12, 2001
SQL Server 2000 has the ability to attach a database with only the .mdf file. SQL Server 2000 will automatically create a new new log file when it is attached.
Has anyone been able to specify the directory where that log file (.ldf) will be placed? The only place I can get the .ldf to be created is in the directory as the .mdf by default. I would like to create the .ldf on a seperate drive for performance and recovery reasons.
Thanks
Bart
View 1 Replies
Jun 25, 2001
Ok, we have a db with 2 log files on 2 seprate logical drives.
We did an sp_detach_db to detach the db.
When we attepted to do an sp_attach_single_file_db, it looks for the 2nd log file on the other logical drive and will not allow us to proceed.
Any advice?
Of course, we deleted the log files....
Arrgghhh!!!
john.mclaughlin@alkermes.com
View 2 Replies
View Related
Mar 15, 2007
Hello,
I've rescued a MDF and LDF files off a client's old server, and I wanted to attach it to our own, but I can't seem to get the command to work, basically I have these two files, which I've dropped on our server:
C:Program FilesMicrosoft SQL ServerMSSQLDataMYCLIENTNAME_Data.MDF
C:Program FilesMicrosoft SQL ServerMSSQLDataMYCLIENTNAME_Data.LDF
So when I do a
SP_ATTACH_SINGLE_FILE_DB 'somedb','C:Program FilesMicrosoft SQL ServerMSSQLDataMYCLIENTNAME_Data.MDF'
It says the LDF path my be incorrect, and that there's two other files that are missing:
MYCLIENTNAME_LOG (no extension)
extra_log (no extension)
I thought the whole point of the command is that you only need a single file?
Its very hard to go back to the client's old server and try to find these two files, and it doesn't really matter if we loose a bit of data, so long as the bulk of it is available.
Update: I think I've found the answer...its not possible to do this, it really needs all the log files.
Any workarounds?
View 1 Replies
View Related
Jun 7, 2007
hello i have this problem if anyone can help
EXEC sp_attach_single_file_db @dbname = 'world',
@physname = 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataworld.mdf'
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'world'. CREATE DATABASE is aborted.
Msg 3456, Level 21, State 1, Line 1
Could not redo log record (9767813:109:10), for transaction ID (1:1182802845), on page (1:27846), database 'world' (database ID 5). Page: LSN = (9767810:70:66), type = 2. Log: OpCode = 3, context 19, PrevPageLSN: (9767812:47:11). Restore from a backup of the database, or repair the database.
Msg 3313, Level 21, State 2, Line 1
During redoing of a logged operation in database 'world', an error occurred at log record ID (9767813:109:10). Typically, the specific failure is previously logged as an error in the Windows Event Log service. Restore the database from a full backup, or repair the database.
thanks
View 10 Replies
View Related