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 2005 Forums
 SQL Server Administration (2005)
 Attach/Detach Live database

Author  Topic 

MaKKrO
Starting Member

8 Posts

Posted - 2008-11-13 : 03:37:12
Hi,

I am planning to move all the databases sitting on a SQL2005 to another SQL2005.

I was just wondering the impact of detaching a DB when live.
Do you have any idea what the consequences are ?
Is it safe ?

THank you.

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2008-11-13 : 04:41:33
You can't detach a database until you close all of active connections. When you will click on detach database option it will show you number of active connections and you have to kill these process first. So no need to worry.
Go to Top of Page

MaKKrO
Starting Member

8 Posts

Posted - 2008-11-13 : 04:57:47
Which means that I can't do a detach/attach on a 24/7 live DB.
Any other idea ?

I have tried the Backup & Restore but it won't work. The .bak file has the old backup as well, I've tried to tick restore them one by one - no chance !

Thanks
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-11-13 : 06:00:59
you're problem with backup is what? create a backup into a new file. don't append it to the old one.
backup is ideal for this scenario.


_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page

MaKKrO
Starting Member

8 Posts

Posted - 2008-11-13 : 06:14:18
Yeah, I thought it was but...
If I try to append the backup to new file, it goes til 80% then fails.
Here is the error in the event viewer : ckupDiskFile::CreateMedia: Backup device 'C:\Argo.bak' failed to create. Operating system error 5(error not found).
I am logged in with the local admin.
If I append the backup to an file already there, it works fine.
Go to Top of Page

MaKKrO
Starting Member

8 Posts

Posted - 2008-11-13 : 06:24:53
Here is what I've tried with SQLCMD.

1> use master
2> go
Changed database context to 'master'.
1> :connect 127.0.0.1
Sqlcmd: Successfully connected to server '127.0.0.1'.
1> BACKUP DATABASE [Argo_FHWW] TO DISK = "c:\Argo.bak"
2> go
Msg 3201, Level 16, State 1, Server 133467-APP1, Line 1
Cannot open backup device 'c:\Argo.bak'. Operating system error 5(error not found).
Msg 3013, Level 16, State 1, Server 133467-APP1, Line 1
BACKUP DATABASE is terminating abnormally.
1>
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-11-13 : 06:27:51
it means that the accoutn under which the sql server service runs under doesn't have permissions to write to the folder you're trying to write to.
choose a folder that you have permissions too.

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page

MaKKrO
Starting Member

8 Posts

Posted - 2008-11-13 : 06:36:01
I am using the local admin account.
This account does have permission to write anywhere on the C drive.
When i open M$ SQL Server Managment Studio, I am using the Windows Auth mode and the same account to login.
Go to Top of Page

MaKKrO
Starting Member

8 Posts

Posted - 2008-11-13 : 06:40:41
Ok, I think i got it.
Not enough space on the disk....
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=113045

grrrrr

Will let you know.
Go to Top of Page

MaKKrO
Starting Member

8 Posts

Posted - 2008-11-13 : 06:47:42
Do I need to have the database created to restore it ?
Or will the restore create it ?

Thanks
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-11-13 : 07:00:00
you specify the databse name to which you with to restore to. db doesn't have to be created before.

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page

MaKKrO
Starting Member

8 Posts

Posted - 2008-11-13 : 07:13:31
I just tried... but again...

TITLE: Microsoft SQL Server Management Studio
------------------------------

Restore failed for Server '190823-SQLCLUS'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3282.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: Cannot use file 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Argo_FHWW.MDF' for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource of the Sql Server does not have a dependency on it. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3282.00&LinkId=20476

-------
That's true, the 1st server is not a cluster, the new one is.
Is there a workaround ?
I'll try to find something but any help would be appreciated.
Thanks
Go to Top of Page
   

- Advertisement -