Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Difference Between Restore And Attach Expand / Collapse
Author
Message
Posted Tuesday, September 3, 2013 9:53 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Yesterday @ 6:46 AM
Points: 612, Visits: 738
What is the difference between Attach And Restoring a Database in Sql Server?Looks like a Simple question?please folks share your comments?
Post #1491019
Posted Tuesday, September 3, 2013 9:56 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:13 PM
Points: 40,428, Visits: 36,879
Restore you take a database backup and SQL creates a database with database files from that backup
Attach you just have the database files (no backup) and SQL creates the database using those files.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1491020
Posted Tuesday, September 3, 2013 2:59 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 4:16 PM
Points: 31,284, Visits: 15,748
In practice, a restore typically has .bak, .trn., and .dif files. The attach usually has .mdf, .ldf, and .ndf files.






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1491097
Posted Thursday, September 5, 2013 6:52 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, November 11, 2014 3:44 AM
Points: 115, Visits: 241
Shaw,
I think below one is also one of the differences what do you say?
Restore will create the new database and Attach will just create the existing database.
Thanks in advance for your input.


Thanks,
I’m nobody but still I’m somebody to someone………….
Post #1491760
Posted Thursday, September 5, 2013 7:08 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:13 PM
Points: 40,428, Visits: 36,879
Before you attach, there is no database. Just files in the file system. So no, that's not correct.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1491767
Posted Thursday, September 5, 2013 7:15 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, November 20, 2014 4:29 AM
Points: 3,559, Visits: 2,671
So we can say
"Attach is used to move a database physically and restore is used to create/modify database as per requirement based on backups"
Post #1491770
Posted Thursday, September 5, 2013 7:30 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, November 11, 2014 3:44 AM
Points: 115, Visits: 241
Ok accepted Shaw
If you check the created date i think restored database will be the recent date but attached DB date will be old date.


Thanks,
I’m nobody but still I’m somebody to someone………….
Post #1491785
Posted Thursday, September 5, 2013 8:42 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:13 PM
Points: 40,428, Visits: 36,879
sqlnaive (9/5/2013)
"Attach is used to move a database physically and restore is used to create/modify database as per requirement based on backups"


If you like. It's not true though.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1491824
Posted Thursday, September 5, 2013 8:51 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, November 20, 2014 4:29 AM
Points: 3,559, Visits: 2,671
GilaMonster (9/5/2013)
sqlnaive (9/5/2013)
"Attach is used to move a database physically and restore is used to create/modify database as per requirement based on backups"


If you like. It's not true though.


Which part Gail ? Would like to be rectified.
Post #1491827
Posted Thursday, September 5, 2013 8:54 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:13 PM
Points: 40,428, Visits: 36,879
Attach is not the only way to move a database physically and restore doesn't modify databases (doesn't create them technically, the database was created previously if a backup exists)


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1491830
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse