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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database, attach or not to attach.

Status
Not open for further replies.

skfm

Technical User
May 2, 2003
54
MY
Hi to all, i have two very simple question here.
1)When I do a copy and paste of my database from one server to another manually, across the network, should i use sp_attach again to attach the database back.
2)What about if I restore back the database from a tape via veritas, should i use sp_attach.

Thanks before hand for your reply.

LG
 
Depends. In the case of your tape backup, I believe Veritas has a tool to restore the DB without doing the re-attach dance, but you have to have an agent installed on the target server.

Otherwise, a manual reattach should be the solution, given that you detached the DB from the original location.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
Thanks Philhege, How about in the event when I copy and paste the file manually over to the other server where SQL is already installed.This is when I am not using veritas at all.

Thanks.
 
First thing..........how did you copy the database? That will determine how you restore it.

If you detached the database and copied the .mdf/.ldf files, then you attach the database.

If you used the SQL Server BACKUP commands, then use the SQL Server RESTORE commands.

If you used a third-party SQL Agent, then use that to restore it.

If you just copied the .mdf/.ldf files while the database was still online, then those files cannot be restored.

-SQLBill

Posting advice: FAQ481-4875
 
Hi SQLBILL,
Thanks for the tip, no the database was offline when i did the copy and paste. Actually the maintenance of the database was done by another person but he have left the company and I remember him saying something about tranferring the database across the network manually, we do not need to attach it back. So I just want to confirm, as i could not conatct him any longer.

Thanks.
 
Yes, you have to attach it on the new server.

-SQLBill

Posting advice: FAQ481-4875
 
thanks SQLBill, i will take note of that.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top