Full and Diff backups

Status
Not open for further replies.

Q

ADSM.ORG Member
Joined
Jun 7, 2006
Messages
44
Reaction score
1
Points
0
Website
Visit site
I am running SQL server 2008 R2. On my 2005 SQL server I could run a diff backup and if the DB did not have a full backup, TSM would do a full backup. I run via a cmd file.

%sql_dir%\tdpsqlc backup DB1*,DB2*,LoanReport*,ReportServer difffull /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_dir%\sql_diff.log >> %sql_dir%\sql_diff_sched.log

This no longer works, I get the following error

Backup of DB1xxxx failed.
10/04/2013 14:19:20 ACO5422E Received the following from the MS SQL server:
10/04/2013 14:19:20 An exception occurred while executing a Transact-SQL statement or batch.
10/04/2013 14:19:20 Cannot perform a differential backup for database "DB1xxxx", because a current database backup does not exist. Perform a full database backup by reissuing BACKUP DATABASE, omitting the WITH DIFFERENTIAL option.
10/04/2013 14:19:20 BACKUP DATABASE is terminating abnormally.

Can this be done as I did with SQL 2005?
 
I am running SQL server 2008 R2. On my 2005 SQL server I could run a diff backup and if the DB did not have a full backup, TSM would do a full backup. I run via a cmd file.

%sql_dir%\tdpsqlc backup DB1*,DB2*,LoanReport*,ReportServer difffull /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_dir%\sql_diff.log >> %sql_dir%\sql_diff_sched.log

This no longer works, I get the following error

Backup of DB1xxxx failed.
10/04/2013 14:19:20 ACO5422E Received the following from the MS SQL server:
10/04/2013 14:19:20 An exception occurred while executing a Transact-SQL statement or batch.
10/04/2013 14:19:20 Cannot perform a differential backup for database "DB1xxxx", because a current database backup does not exist. Perform a full database backup by reissuing BACKUP DATABASE, omitting the WITH DIFFERENTIAL option.
10/04/2013 14:19:20 BACKUP DATABASE is terminating abnormally.

Can this be done as I did with SQL 2005?

What version of TDP for SQL are you using? If I remember correctly, this is a version issue. A later version should correct this.
 
I am using the following script below. It does identify the database that needs the full backup, but TDP will not do a full when I am doing a diff.

REM Set Environment Variables
set sql_dir=C:\Progra~1\Tivoli\TSM\TDPSql
set sql_log=C:\Progra~1\Tivoli\TSM\logs\sql
set backupcheck="C:\Progra~1\Tivoli\TSM\TDPSql\check.txt"

REM Write Date & Time To Log File
echo %date% %time% >> %sql_log%\sqlsched.log

REM Output Databases With No Backups
sqlcmd -E -S %computername% -d master -Q "SET NOCOUNT ON SELECT master.dbo.sysdatabases.NAME AS database_name, NULL AS [Last Data Backup Date], 9999 AS [Backup Age (Hours)] FROM master.dbo.sysdatabases LEFT JOIN msdb.dbo.backupset ON master.dbo.sysdatabases.name = msdb.dbo.backupset.database_name WHERE msdb.dbo.backupset.database_name IS NULL AND master.dbo.sysdatabases.name <> 'tempdb' ORDER BY msdb.dbo.backupset.database_name" -h-1 >%backupcheck%

REM Backup Databases With No Backups
for /f "tokens=1" %%i in ('type %backupcheck%') do %sql_dir%\tdpsqlc backup %%i FULL /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_log%\sqlfull.log >> %sql_log%\sqlsched.log

REM Diff Backup Of All Databases
%sql_dir%\tdpsqlc backup * diff /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_log%\sqldiff.log >> %sql_log%\sqlsched.log
 
I am using the following script below. It does identify the database that needs the full backup, but TDP will not do a full when I am doing a diff.

REM Set Environment Variables
set sql_dir=C:\Progra~1\Tivoli\TSM\TDPSql
set sql_log=C:\Progra~1\Tivoli\TSM\logs\sql
set backupcheck="C:\Progra~1\Tivoli\TSM\TDPSql\check.txt"

REM Write Date & Time To Log File
echo %date% %time% >> %sql_log%\sqlsched.log

REM Output Databases With No Backups
sqlcmd -E -S %computername% -d master -Q "SET NOCOUNT ON SELECT master.dbo.sysdatabases.NAME AS database_name, NULL AS [Last Data Backup Date], 9999 AS [Backup Age (Hours)] FROM master.dbo.sysdatabases LEFT JOIN msdb.dbo.backupset ON master.dbo.sysdatabases.name = msdb.dbo.backupset.database_name WHERE msdb.dbo.backupset.database_name IS NULL AND master.dbo.sysdatabases.name <> 'tempdb' ORDER BY msdb.dbo.backupset.database_name" -h-1 >%backupcheck%

REM Backup Databases With No Backups
for /f "tokens=1" %%i in ('type %backupcheck%') do %sql_dir%\tdpsqlc backup %%i FULL /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_log%\sqlfull.log >> %sql_log%\sqlsched.log

REM Diff Backup Of All Databases
%sql_dir%\tdpsqlc backup * diff /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_log%\sqldiff.log >> %sql_log%\sqlsched.log



I got this working.
 
Status
Not open for further replies.
Back
Top