Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sharepoint sp_attach_db

Status
Not open for further replies.

Beowulf005

Technical User
Apr 5, 2005
640
My Windows Server 2003 Small Business Server hard drive crashed (MBR corupted) Using Ontrack I was able to do a file recovery of all the files in the C:\Program files\microsoft sql server\MSSQL$Sharepoint\data

Reading the help files I can use sp_attach_db to attach to my new SQL server but I don't have any idea where to run the cmd to make it happen on top of that I am unsure who to read the contect once it is reattach.

Any help will be usefull

Thankx

When frustrated remember, in the computer world there is almost always a backdoor.
 
If you have the .mdf file, you can place it in a directory of your choice. Then naviage to Databases under the server you want and choose All Tasks --> Attach Database. Navigate to the file and select it.

Jim
 
I cannot locate "databases" where would I locate this?

When frustrated remember, in the computer world there is almost always a backdoor.
 
I don't have enterprise manager or the snap in is not configured. This is a sharepoint database from a win 2003 small business server. Where would I locate the exe?

When frustrated remember, in the computer world there is almost always a backdoor.
 
Or is it part of a program? I have an MSDN subscription

When frustrated remember, in the computer world there is almost always a backdoor.
 
Click Start -> Run
Type: CMD

at the command prompt type...

osql -E

Note: captilization is important.

If all goes well, you will have a prompt the looks like...

Code:
>1

At this prompt, you can run the sp_attach_db command. after entering the command, you hit enter. You'll get another prompt like this... 2> at this prompt, type go and hit enter to actually run the command.

Hope this helps.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Sorry. I see now that Share Point is set up as a named instance, so you'll need to modify the osql line, like so.

osql -S (local)\SharePoint -E

osql is a command line utility for SQL Server

(local) tells SQL Server that the machine you are connecting to is the machine you're sitting in front of.

\Sharepoint tells SQL Server that you want to connect to a named instance

-E tells SQL Server that you want to login with Windows NT authentication (as a trusted connection).

Hope this helps.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Ok the command worked and I was able to attach the database. Would anyone know how to get sharepoint to open the infomation within that database or any other way I can reterive the data?

Also is there a command to will display all connected content databases?

Thank you

When frustrated remember, in the computer world there is almost always a backdoor.
 
I know nothing about Share Point, but I do know how to get a list of databases that are attached to a SQL Server.

At an osql prompt, type:

Select CATALOG_NAME From INFORMATION_SCHEMA.SCHEMATA

then, of course, hit enter, they GO and hit enter again.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Inside the database are documents, pictures, and lists would the osql prompt have a command to pull the files to save somewhre else?

When frustrated remember, in the computer world there is almost always a backdoor.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top