Red Gate forums :: View topic - Backup Threads
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup 7
SQL Backup 7 forum

Backup Threads

Search in SQL Backup 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
DatabaseMonster



Joined: 27 Jun 2014
Posts: 2

PostPosted: Fri Jun 27, 2014 9:31 am    Post subject: Backup Threads Reply with quote

Hello,

Can anyone tell me if there is a programmatic way of determining how many threads a database backup used as part of the sql backup?
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2301

PostPosted: Mon Jun 30, 2014 2:43 am    Post subject: Reply with quote

For backup reader threads, it's always the number of physical devices your database files are stored on (see http://www.sqlbackuprestore.com/backupreadsandwrites.htm).

For SQL Backup writer threads, it depends. If you are backing up to a single file without the THREADCOUNT parameter, there's only 2 threads - 1 to read the backup data provided by SQL Server and compress/encrypt it, and another to write the processed data.

If you are backing up to multiple files, it's 2 x the number of files. If you are backing up to a single file using a THREADCOUNT value of 2 or more, it's the THREADCOUNT value + 1.
_________________
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
Back to top
View user's profile Send private message Send e-mail
DatabaseMonster



Joined: 27 Jun 2014
Posts: 2

PostPosted: Mon Jun 30, 2014 8:31 am    Post subject: Reply with quote

Thanks for the info!

So if I backup a database using 4 x threads to a single file is there a way then to query the backup information in code so that when I come to restore the database I know how many DISK keywords to specific
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2301

PostPosted: Mon Jun 30, 2014 9:27 am    Post subject: Reply with quote

You could use the RESTORE SQBHEADERONLY command e.g.

Code:
EXEC master..sqlbackup '-sql "RESTORE SQBHEADERONLY FROM DISK = [g:\backups\AdventureWorks.sqb]"'

For backups that were split across multiple files, you will see a value for 'File number' e.g. 1 of 3, 2 of 3 etc.

For backups that used multiple threads but written to a single file, you will see a value for 'Threads' e.g. 5 (multi-threaded file).
_________________
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
Back to top
View user's profile Send private message Send e-mail
lindaquist



Joined: 09 Jul 2014
Posts: 1

PostPosted: Wed Jul 09, 2014 6:29 am    Post subject: Reply with quote

For non technical user, it is not an easy task to repair sql database mannually, i would recommend to such people, go for third party application, which is easy and fast way to recover sql database.

Go to Google search there lot of tools available there, one such application is here: - http://www.filesrecoverytool.com/sql-database-repair.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group