How do I 'mount' a SQL DB

Hi, I've just completed a SQL 2005 installation, and I need to remove any databases that are not going to get used (like model?), and additionally 'mount' a databases that is stored on another drive..

How can I achieve this ?
LVL 1
j4jackAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

grayeCommented:
Oooh, kinky :)
Sorry...
The model is considered a "system database" and should not be removed.   You might have some demo databases (Pubs, Northwind, etc) that you can safely remove.
The method to move database files (the *.mdf and *.ldf files) is by doing an Attach operation.  This can be easily done via the SQL Management Studio... just right click on databases, actions, attach.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tigin44Commented:
master, model, msdb and tempdb are system databases and you shouldnt remove them...
by the way you can add an existing database by using sp_attach_db procedure or by using aterprise manager...
right click on the databases entry and choose attach ...
in the window opened choose the db files form file system and press OK...
thats all
0
j4jackAuthor Commented:
OOPS ! Bit of a problem... I originally on Machine 'A' went into SQL, right clicked on the database, then choose Tasks, Backup, Full and picked a location on the C drive.

Copied this file over to machine 'B', and have tried to go attach and it give me an error saying the the database is not the primary database file , error 5171.....did I do the backup incorrectly ??

HELLLLLP!!
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

tigin44Commented:
did you restore the bakuped file..
sql databases basicly consist of two files with the extensions .mdf and .ldf .
You can attach these files as database files... check that...
0
grayeCommented:
You basically have two options... (er, well maybe 3)
  • Perform a backup and restore operation to move the database
  • Perform a detatch/attach operation
  • Use the copy database wizard
So, it looks like you did a backup, and file is probably a *.bak file.   You'd use the SQL Management Studio to create a new database and perform the restore operation
 
0
Mark WillsTopic AdvisorCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Split: graye {http:#22905283} & tigin44 {http:#22905352} & graye {http:#22908024}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

mark_wills
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.