Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 attach database help

Author  Topic 

thanksfor help
Posting Yak Master

106 Posts

Posted - 2009-06-25 : 19:32:37
hi,

we have 2 DB in same server one is copy of the other like A1 and A2.

A1 is the original and A2 is copy. A2 is restored weekly from A1 backup file. Last restored failed and A2 is not there any more. I tried to attach the file from A2.mdf but in the list of original data and log file names are A1. Is is correct? I am not sure and stopped the database attach task.

Any suggestion will be helpful.

thanks in advance.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-06-26 : 01:05:41
Why don't you just use backup/restore so that the A1 database does not need to be detached and thefore no downtime will be incurred? Detach/attach can be risky.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

thanksfor help
Posting Yak Master

106 Posts

Posted - 2009-06-26 : 13:05:13
A1 database is fine and it is connected to production application. A2 DB got lost when restored failed from A1 backup. Now, I need A2 back again for data testing issues.

AS A2.mdf was available, I thought I can attach the DB from the file but original file names were still A1.mdb and A1.ldb.

Any other suggestions is also okay.

thanks
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-06-26 : 14:25:00
I don't think you understood my reply. Backup the A1 database, copy it to the A2 server, restore the backup as A2.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

thanksfor help
Posting Yak Master

106 Posts

Posted - 2009-06-26 : 14:27:46
Sorry, if I am not clear. both the DBs are in same server.

after restore failure A2 is not in DB list.

thanks for your time.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-06-26 : 20:47:57
It doesn't need to be in the list. Just run the RESTORE DATABASE command and include the WITH MOVE option.

This is just an example, you'll need to make the appropriate changes:
RESTORE DATABASE A2
FROM DISK = 'E:\Backup\A1.bak'
WITH REPLACE, MOVE 'A1_Data.mdf' TO 'F:\Data\A2_Data.mdf', MOVE 'A1_Log.ldf' TO 'F:\Data\A2_Log.ldf'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

imranwahabit
Starting Member

3 Posts

Posted - 2009-07-01 : 11:55:33
hello i am mohammed imran working as a software engineer and i am haivng a sever issue,can any one of u help me out,our company database is crashed and its showing me the 5123 error,how can i recover the database plz help me out from the problem waiting for the solution from any of our brothers
my id:imranwahabit@gmail.com

mohammed imran
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-07-01 : 14:08:17
Mohammed, do not hijack this thread, start a new one with your issue so that it gets more visibility.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -