SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


copy system database files


copy system database files

Author
Message
mJai
mJai
SSC Journeyman
SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)

Group: General Forum Members
Points: 90 Visits: 114
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
sharath.chalamgari
sharath.chalamgari
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1472 Visits: 798
without taking server offline it is not possible to move the system db's to another location.
happycat59
happycat59
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4737 Visits: 3215
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)



HanShi
HanShi
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4380 Visits: 3668
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’! **
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87029 Visits: 45267
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, MVP, M.Sc (Comp Sci)
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


mJai
mJai
SSC Journeyman
SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)

Group: General Forum Members
Points: 90 Visits: 114
absolutely. copies of system files saves the database when it comes to a reality Smile

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.
VastSQL
VastSQL
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4401 Visits: 5157
Try This..

1.Turn ON the Auto-Close option for databases
2.Kill all connections
and then try to copy the files
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87029 Visits: 45267
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, MVP, M.Sc (Comp Sci)
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


GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87029 Visits: 45267
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, MVP, M.Sc (Comp Sci)
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


mJai
mJai
SSC Journeyman
SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)

Group: General Forum Members
Points: 90 Visits: 114
Hmm...Looks like theres no way to get a copy of these files (model and master) without bringing the database down first!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search