Microsoft SQL Server
--
Questions
--
Followers
Top Experts
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
The database is restored.
2010-09-07 08:27:36.87 spid5s    Warning ******************
2010-09-07 08:27:36.87 spid5s    SQL Server started in single-user mode. This
an informational message only. No user action is required.
2010-09-07 08:27:36.87 spid5s    Starting up database 'master'.
2010-09-07 08:27:36.88 spid5s    Error: 17207, Severity: 16, State: 1.
2010-09-07 08:27:36.88 spid5s    FCB::Open: Operating system error 2(error not
 found) occurred while creating or opening file 'E:\MSSQL.1\MSSQL\DATA\mas
df'. Diagnose and correct the operating system error, and retry the operation.
2010-09-07 08:27:36.88 spid5s    Error: 17204, Severity: 16, State: 1.
2010-09-07 08:27:36.88 spid5s    FCB::Open failed: Could not open file E:\MSSQ
L.1\MSSQL\DATA\mastlog.ldf
2010-09-07 08:27:36.88 spid5s    Error: 5120, Severity: 16, State: 101.
2010-09-07 08:27:36.88 spid5s    Unable to open the physical file "E:\MSSQL.1\
MSSQL\DATA\mastlog.ldf". Operating system error 2: "2(error not found)".






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Step two: Restore the datbase from a good backup: http://technet.microsoft.com/en-us/library/ms175535.aspx
//Marten
Looking there are no .BAK files for the user databases but I do have the MDF's any idea's?
BTW I didnt set this up or break it - just trying to recover it 8)
If it didn't then you had an old backup (better fix this for future needs). Then you can attach databases using sp_attach_db http://technet.microsoft.com/en-us/library/ms179877.aspx look at example on the bottom of this page
check if logins exist in master database, otherwise you'll need to recreate these, and remap them agains databases. One database at a time using exec sp_change_users_login see http://msdn.microsoft.com/en-us/library/aa259633(SQL.80).aspx example on middle of the page.
Check if you have jobs and maintenanceplans. You may not have these, it depends. You should definately build maintenance plans for taking backup and handling index rebuild/reorganise and soforth. For both user and system databases. If you dont like maintenance plans (a good start if you're an accidental DBA), there is a solution by Ola Hallengren that I can highly recommend, see http://ola.hallengren.com/
Regards Marten

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Ok, just follow the steps below:
1. Copy all *.mdf files to a new location.
2. Detach all user databases from SQL Server
3. Create new databases with user name as required
4. Stop SQL Server services.
5. Replace user database.mdf with the copied *.mdf files
6. Start SQL Server services.
This should help you get all user databases working..
So, first, if you can, make a backup copy of the existing physical .mdf files.
Before trying to "tri ck" SQL, try to work within its established methods.
If the dbs have only a single data file, attempt to attach them using:
EXEC sp_attach_single_file_db
That should recreate a log file to use.
If the dbs have multiple data files, you will have to use another method, but most dbs use only a single data file.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Netstore,
In case sp_attach_single_file_db didn't worked, then try out the alternative method posted in my comment.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Microsoft SQL Server
--
Questions
--
Followers
Top Experts
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.