Backup Threads
DatabaseMonster
Posts: 3
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?
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?
Comments
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.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
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
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).
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8