· Uwe Janke
Commands / Test-sqmTdpConfiguration

Test-sqmTdpConfiguration

Backup sqmSQLTool v1.9.218+ · Test ✓ -WhatIf supported
The file-only variant of Test-sqmTdpBackup for the case that there is no SQL Server access: no login, instance down, or only file access to the server. It checks the TDP configuration and the TDP logs and gives a fix hint for every finding. No dbatools and no SQL connection are needed.

Where the paths come from. -TdpDir and -ConfigPath are parameters. The Configuration section of BackupPlan.json (TsmOptFile, TdpConfigFile, LogPath) overrides the defaults <TdpDir>\dsm.opt, <TdpDir>\tdpsql.cfg and <TdpDir>\03_Log. The log name comes from LOGFile in tdpsql.cfg, the script location from SET BackupScriptsDir= in the wrapper, the TSM server from dsm.opt. A remote computer is read through its administrative share.

Not covered because it needs SQL Server: Agent job and schedule, tracking tables, backup age in msdb, plan against existing databases. Use Test-sqmTdpBackup for those.

Parameters

ParameterTypeRequiredDefaultNotes
-ComputerNamestring[]Optional$env:COMPUTERNAMEComputer that runs the TDP client. Remote computers are read through \\computer\C$.
-TdpDirstringOptionalC:\Program Files\Tivoli\TSM\TDPSqlTDP directory on that computer.
-ConfigPathstringOptional<TdpDir>\BackupPlan.jsonPath of BackupPlan.json.
-LogFilesToScanintOptional5Number of newest logs scanned.
-LogDaysintOptional7Only messages of the last N days count.
-TestTsmServerswitchSwitch$falseTCP test of the TSM server from dsm.opt (local computer only).
-AdditionalFindingobject[]Optional, Findings the caller already collected; Test-sqmTdpBackup passes its SQL finding here.
-OutputPathstringOptional<OutputPath config>\TdpConfigurationReport directory.
-NoOpenswitchSwitch$falseDo not open the HTML report.
-NoReportswitchSwitch$falseWrite no files, only return the result object.
-ContinueOnErrorswitchSwitch$falseContinue with the next instance or computer on error.
-EnableExceptionswitchSwitch$falseThrow exceptions immediately.

Execution Flow

START Locate the TDP directory -TdpDir, locally or through \\computer\C$ for -ComputerName directory not reachable: Critical finding and nothing more to read BackupPlan.json exists, valid JSON, no <placeholders>, English day names, a FULL day databases selected, no duplicates; Configuration paths override the defaults TDP and TSM files tdpsqlc.exe, dsm.opt (TCPServeraddress), tdpsql.cfg, TdpBackup.config wrapper passes the exit code on and finds Backup-TdpFull.ps1 Logs of the last -LogDays days wrapper logs: FAILED or unfinished; per-database TDP logs and tdpsql.log ANS, ACN and ACO messages: E = Warning, S = Critical, with a hint for common codes TSM server (only with -TestTsmServer, local computer) TCP connect to TCPServeraddress and TCPPort from dsm.opt Findings by severity, report TXT, CSV and HTML; result object with Findings END

Return value

One object per computer with Status (OK, Warning, Critical, Error), the counts, Findings (Severity, Category, Message, Hint) and the report file paths.

SeverityMeaning
CriticalThe backup is not working or the data is not protected. Changes the overall status to Critical.
WarningNeeds attention but the backup still runs. Overall status Warning.
InfoGood to know (for example a step runs without a proxy). Does not change the overall status.

Known hints: ANS1017E (TCP/IP connection to the TSM server failed), ANS1025E (authentication failed, node password), ANS1035S (options file not found or invalid). Other codes are reported with their message line.

Examples

Local computer
Test-sqmTdpConfiguration
Remote server, only what needs attention
(Test-sqmTdpConfiguration -ComputerName SQL01 -NoReport).Findings |
    Where-Object Severity -ne 'Info' | Format-List Severity, Category, Message, Hint
Non-default TDP directory and TSM server test
Test-sqmTdpConfiguration -TdpDir 'D:\Tivoli\TDPSql' -TestTsmServer
Only the last day of log messages
Test-sqmTdpConfiguration -LogDays 1