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»»

copy system database files Expand / Collapse
Author
Message
Posted Sunday, July 7, 2013 9:55 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, February 27, 2014 9:04 PM
Points: 46, Visits: 113
Dear All,

I would like to have a backup of the SQL system databases (the files themselves) not the SQL backup.

When I try to copy these files (master,model,msdb,tempdb), it says the files is in use and it does not allow me to copy.

My clarifications:-
1) Without having to bring down the database, how can I copy these files to another location?
2) Is it possible to backup these files themselves during a full database backup? How do i perform that task?

Many thanks,
Jai
Post #1471025
Posted Sunday, July 7, 2013 10:05 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, September 2, 2014 10:39 AM
Points: 1,194, Visits: 787
without taking server offline it is not possible to move the system db's to another location.
Post #1471027
Posted Sunday, July 7, 2013 10:14 PM
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: Yesterday @ 9:05 PM
Points: 3,044, Visits: 2,649
1. Backing up files that are in use is not an option. SQL Server caches data and that may mean that, even though your queries are showing a record, that does not mean that it is on disk. If you want to backup the actual files themselves, the only way you can do this is to stop the SQL Server service.
2. Using a database backup is the only way to backup a SQL Server database whilst it is being used by SQL Server. Have a look at the backup command (http://msdn.microsoft.com/en-us/library/ms186865.aspx) or maintenance plans (http://msdn.microsoft.com/en-us/library/ms187658.aspx)




Post #1471030
Posted Monday, July 8, 2013 1:51 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 7:51 AM
Points: 2,404, Visits: 2,941
mJai (7/7/2013)
I would like to have a backup of the SQL system databases (the files themselves) not the SQL backup.

Why would you want a copy of the files themselves? Why does a SQL backup not satisfy your needs?.

When I try to copy these files (master,model,msdb,tempdb), it says the files is in use and it does not allow me to copy.

When SQL Server is started, it locks all the files of all the databases on that instance.


My clarifications:-
1) Without having to bring down the database, how can I copy these files to another location?

No file copy is possible. Only way to do this is with a (native or third party) SQL backup.


2) Is it possible to backup these files themselves during a full database backup? How do i perform that task?

When you create a SQL full backup of a database (see: http://msdn.microsoft.com/en-us/library/ms186865(v=sql.105).aspx), the complete database is being backupped. With a restore the database is being placed on the destination instance and you can specify where the database files are are being placed.


** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Post #1471069
Posted Monday, July 8, 2013 2:02 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: Yesterday @ 6:05 AM
Points: 40,258, Visits: 36,681
HanShi (7/8/2013)
mJai (7/7/2013)
I would like to have a backup of the SQL system databases (the files themselves) not the SQL backup.

Why would you want a copy of the files themselves? Why does a SQL backup not satisfy your needs?.


Because it's damn handy to have copies of those files (well, master and model) in case there's any problems with the system databases. It's far easier to switch in known-to-be working files, start SQL then restore backups than to go through the hoops required to get SQL started with damaged/missing system files.

Not instead of database backups. As well as.



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 #1471078
Posted Monday, July 8, 2013 3:14 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, February 27, 2014 9:04 PM
Points: 46, Visits: 113
absolutely. copies of system files saves the database when it comes to a reality :)

I have heard that it is possible to actually have a copy of those files(system), triggered during a SQL backup using certain switches. I was hoping someone must have surely used that method. Thanks.
Post #1471097
Posted Monday, July 8, 2013 3:18 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, October 27, 2014 5:42 AM
Points: 2,634, Visits: 3,980
Try This..

1.Turn ON the Auto-Close option for databases
2.Kill all connections
and then try to copy the files
Post #1471099
Posted Monday, July 8, 2013 3:30 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: Yesterday @ 6:05 AM
Points: 40,258, Visits: 36,681
Ratheesh.K.Nair (7/8/2013)
Try This..

1.Turn ON the Auto-Close option for databases
2.Kill all connections
and then try to copy the files


He's talking about the system databases, not user databases...



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 #1471102
Posted Monday, July 8, 2013 3:31 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: Yesterday @ 6:05 AM
Points: 40,258, Visits: 36,681
mJai (7/7/2013)
When I try to copy these files (master,model,msdb,tempdb), it says the files is in use and it does not allow me to copy.


You don't need the TempDB files. Master and model are the ones that are useful to have file copies of, msdb just make sure you have good backups.



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 #1471103
Posted Wednesday, July 10, 2013 7:57 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, February 27, 2014 9:04 PM
Points: 46, Visits: 113
Hmm...Looks like theres no way to get a copy of these files (model and master) without bringing the database down first!
Post #1472158
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse