TSM TDP Backup > Automation for missing fullbackups

  • shp.shftr


    Points: 478

    Hello there,

    I am struggling to get TSM TDP to work properly with adjusted scripts. I want to implement an automatism to the schedule-scripts for diff- and logbackups, meaning there should be a check beforehand if fullbackup is missing (and if yes, do it).

    The schedules within TSM (which I am not working on as this is maintained from a different provider of my customer) are pointing directly to the respective scripts. Each instance has its own specific disk where config, scripts and dsm.opt files are located

    As an example, here is my approach for logbackups. These are based on the general plane scripts from IBM.

    set TSMERROR=0

    set sql_dir=c:\Progra~1\Tivoli\TSM\TDPSql

    set config_dir=E:\TSM_SQL

    set sql_instance=Server\Instance

    cd %sql_dir%

    date /t < NUL >> %config_dir%\sqlsched.log

    time /t < NUL >> %config_dir%\sqlsched.log

    REM Output databases with missing fullbackup

    sqlcmd -E -S %sql_instance% -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" -y0 >%config_dir%\check_before_log.txt

    REM Fullbackup for databases with missing fullbackup

    for /f "tokens=1" %%i in ('type %config_dir%\check_before_log.txt') do %sql_dir%\tdpsqlc backup %%i FULL /tsmoptfile=%config_dir%\dsm.opt /config=%config_dir%\tdpsql.cfg /logfile=%config_dir%\sqlfull.log >> %config_dir%\sqlsched.log

    REM Logbackup of all databases

    %sql_dir%\tdpsqlc backup * log /tsmoptfile=%config_dir%\dsm.opt /config=%config_dir%\tdpsql.cfg /logfile=%config_dir%\sql_tx.log >> config_dir%\sqlsched.log

    The actual part for the missing fullbackup is working as intended - but it is ignoring the part after it, its just not performing a logbackup after it at all. I want to avoid to cut this logic as this would prevent unnecessary tickets for newly created databases (where fullbackup is missing since never created) in the future.

    General schedule is sunday evening fullbackup, every other evening diffbackup and a logback every hour.

    My biggest problem is that I am a MSSQL dba - no expert for TSM. But due to circumstances within the contract of my company and my customer, the actual backup team itself is not supporting the creation of the scripts.

    Did anyone worked around such a topic before and has an idea to help me here? I would gladly appreciate any kind of help.


    Thanks in advance and greetings from Germany


    • This topic was modified 3 months, 1 week ago by  shp.shftr.
    • This topic was modified 3 months, 1 week ago by  shp.shftr.
  • Site Owners

    SSC Guru

    Points: 80376

    Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply