• Please help support our sponsors by considering their products and services.
    Our sponsors enable us to serve you with this high-speed Internet connection and fast webservers you are currently using at ADSM.ORG.
    They support this free flow of information and knowledge exchange service at no cost to you.

    Please welcome our latest sponsor Tectrade . We can show our appreciation by learning more about Tectrade Solutions
  • Community Tip: Please Give Thanks to Those Sharing Their Knowledge.

    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.


    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

TSM TDP Backup > Automation for missing fullbackups

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 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


ADSM.ORG Senior Member
Stab in the dark, but my suspicion is that the script is trying to run the log backup while the full backup is running and is unable to do so. There should be logs somewhere to that nature if that's the case.

I don't see any supporting lines to call pslist or tasklist and seeing if tdpsqlc is finished. Also, if more than one tdpsqlc process is running you may need to get a list of all tdpsqlc's and do some filtering to make sure you are watching the right process.
Another way that may work is using the windows 'START' with /w option, or the CALL command to fire up tdp.

My batch scripting is worse than my KSH scripting, and don't really have a quick way to test any of these idea's on, so I could be way off here. So just a few random thoughts.

Advertise at ADSM.ORG

If you are reading this, so are your potential customer. Advertise at ADSM.ORG right now.

UpCloud high performance VPS at $5/month

Get started with $25 in credits on Cloud Servers. You must use link below to receive the credit. Use the promo to get upto 5 month of FREE Linux VPS.

The Spectrum Protect TLA (Three-Letter Acronym): ISP or something else?

  • Every product needs a TLA, Let's call it ISP (IBM Spectrum Protect).

    Votes: 18 18.6%
  • Keep using TSM for Spectrum Protect.

    Votes: 59 60.8%
  • Let's be formal and just say Spectrum Protect

    Votes: 12 12.4%
  • Other (please comement)

    Votes: 8 8.2%

Forum statistics

Latest member