Making SQL backup script - need some help

bostjanc

ADSM.ORG Member
Joined
Jun 1, 2010
Messages
63
Reaction score
2
Points
0
PREDATAR Control23

Hi guys.
We are in the phase of implementing TSM DP For SQL.
We are trying to create FULL-backup-sql.bat and DIFF-backup-sql.bat.
So far we are at creating FULL-backup script and got stucked on "inactivating" databases.

The idea is to make full backup on sunday's and differential backups between monday and saturday.
When we run full backup we would also like to delete any previous full backups (for example: delete full backups older then 1 day)

Currently the script for full backup looks like this:

set TSMERROR=0
set sql_dir=C:\Progra~1\Tivoli\TSM\TDPSql
C:
cd %sql_dir%
CALL %sql_dir%\tdpsqlc backup "Analysis Repository" full /SQLSERVER=srvname /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_dir%\sqlschedFULL.log >> %sql_dir%\sqlschedFULL.log
CALL %sql_dir%\tdpsqlc inactiv "Analysis Repository" full /FROMSQLSERVer=srvname /olderthan=0 >> %sql_dir%\sqlschedFULL.log
CALL %sql_dir%\tdpsqlc delete backup "Analysis Repository" full /FROMSQLSERVer=srvname >> %sql_dir%\sqlschedFULL.log

The thing is that inactiv command does not do anything.
It gives error: FMY5551I There are no backups matching the criteria specified for server name

* Please advise us how to achieve to delete full backups older then one day
* My next question is Will the logs be automatically truncated or do we need to "push" them also with tdpsqlc command?
With best regards
 
PREDATAR Control23

It's not dead, but it's possible that nobody knows the answer to your question.

I have never used TDP SQL, so I can't be much help, other than giving you general troubleshooting tips.

With a script, I find sometimes it's harder to troubleshoot, if you have not done so, try every command in the script one by one, in the same order until you can get them all to run without errors.

Double-check the syntax in the manual also make sure you have the right order of operations.
 
PREDATAR Control23

Do you really need to deactivate and delete older backups manually from within script?
After you backup database "Analysis Repository" the previous backup is marked as inactive. Inactive backup objects will be expired and deleted during "expire inventory" daily TSM maintenance based on copy group settings. Just set your backup copy group to 0 inactive version (but think before you are changing it as you might set it also for other nodes)
 
PREDATAR Control23

Do you really need to deactivate and delete older backups manually from within script?
After you backup database "Analysis Repository" the previous backup is marked as inactive. Inactive backup objects will be expired and deleted during "expire inventory" daily TSM maintenance based on copy group settings. Just set your backup copy group to 0 inactive version (but think before you are changing it as you might set it also for other nodes)
smajl is right: http://www-01.ibm.com/support/knowl...tsm.db.sql.doc/dps_tsk_gui_inactivatedbs.html
 
PREDATAR Control23

Hi guys.
We are in the phase of implementing TSM DP For SQL.
We are trying to create FULL-backup-sql.bat and DIFF-backup-sql.bat.
So far we are at creating FULL-backup script and got stucked on "inactivating" databases.

The idea is to make full backup on sunday's and differential backups between monday and saturday.
When we run full backup we would also like to delete any previous full backups (for example: delete full backups older then 1 day)

Currently the script for full backup looks like this:

set TSMERROR=0
set sql_dir=C:\Progra~1\Tivoli\TSM\TDPSql
C:
cd %sql_dir%
CALL %sql_dir%\tdpsqlc backup "Analysis Repository" full /SQLSERVER=srvname /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_dir%\sqlschedFULL.log >> %sql_dir%\sqlschedFULL.log
CALL %sql_dir%\tdpsqlc inactiv "Analysis Repository" full /FROMSQLSERVer=srvname /olderthan=0 >> %sql_dir%\sqlschedFULL.log
CALL %sql_dir%\tdpsqlc delete backup "Analysis Repository" full /FROMSQLSERVer=srvname >> %sql_dir%\sqlschedFULL.log

The thing is that inactiv command does not do anything.
It gives error: FMY5551I There are no backups matching the criteria specified for server name

* Please advise us how to achieve to delete full backups older then one day
* My next question is Will the logs be automatically truncated or do we need to "push" them also with tdpsqlc command?
With best regards

The inactivation of full backup is automatically done when you launch a new full backup.
see http://www-01.ibm.com/support/knowl...dps_ref_opt_inactivatepositional.html?lang=en
 
Top