hidden:TSM backup: Difference between revisions

From Lsdf
Jump to navigationJump to search
No edit summary
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
1. '''TSM backup of HPSS mover'''
1. '''TSM backup of HPSS mover'''
0 22 * * * /opt/tivoli/tsm/client/ba/bin/dsmc inc -errorlogname=/var/log/dsmerror.log >> /var/log/dsmbackup.log 2>&1

[root@hpssmvr02 ~]# cat /opt/tivoli/tsm/client/ba/bin/dsm.sys
defaultserver backup
servername backup
nodename scc-hpssmvr02
domain / /varhpss /hpss_src /localhome /boot
tcpport 1503
tcpserveraddress scc-tsm-sb03.scc.kit.edu
commmethod tcpip
passwordaccess generate
managedservices schedule
<nowiki>*</nowiki>inclexcl /usr/local/tsm/backup.inclexcl
schedlogretention 32 d
errorlogretention 32 d
resourceutilization 1
guitreeviewafterbackup yes

'''NOTE'''
HPSS Mover04 has a GridKA IP and makes a TSM backup on TSM server scctsm02.gridka.de


2. '''TSM backup of HPSS core'''
2. '''TSM backup of HPSS core'''
on either core server in crontab:
on either core server in crontab:
#HPSS file systems backups only from the active core server
#HPSS file systems backups only from the active core server
00 02 * * * if [ $(hostname) == "hpsscr" ] ; then /opt/tivoli/tsm/client/ba/bin/dsmc inc -se="hpsscr_backup" 2>&1 ; /root/tsm/hpss_ba_tbspaces_tree.sh >> /root/tsm/hpsscr/dsm_hpss.out 2>&1 ; fi
00 02 * * * if [ $(hostname) == "hpsscr" ] ; then /opt/tivoli/tsm/client/ba/bin/dsmc inc -se="hpsscr_backup" -errorlogname=/root/tsm/hpsscr/dsmerror_hpsscr_backup.log>> <br />/root/tsm/hpss/dsm_hpsscr_backup.out 2>&1 ;/root/tsm/hpss_ba_tbspaces_tree.sh >> /root/tsm/hpsscr/dsm_hpsscr_ba_tbspaces.out 2>&1 ; fi
#system backup
#system backup
00 07 * * * /opt/tivoli/tsm/client/ba/bin/dsmc inc -se="system_backup" >> /root/tsm/hpsscr02/dsm_hpsscr02.out 2>&1
00 07 * * * /opt/tivoli/tsm/client/ba/bin/dsmc inc -se="system_backup" -errorlogname=/root/tsm/hpsscr01/dsmerror_system_backup.log >> /root/tsm/hpsscr01/dsm_hpsscr01.out 2>&1
'''System backup:'''
'''System backup:'''
TSM backup for the local file systems: / /localhome /boot (TSM does not make a backup for mounted file systems, they have to be specified)
TSM backup for the local file systems: / /localhome /boot (TSM does not make a backup for mounted file systems, they have to be specified)
Line 15: Line 35:
TSM node name: scc-hpsscr
TSM node name: scc-hpsscr
TSM server defined in dsm.sys: hpsscr_backup
TSM server defined in dsm.sys: hpsscr_backup

'''TSM backup of DB2 tablespaces directory structure'''

The following script takes a tsm backup of DB2 tablespaces directory structure. (DB2 backup makes data backup here is only the directory structure)
It may be helpful for restoring DB2 from a DB2 bgackup.
It is an IBM recommendation to backup the directory structure, it was not required for our restore test [[hidden:Database Restore exercised on Test Core|Database Restore exercised on Test Core]]

[root@hpsscr02 lost+found]# cat /root/tsm/hpss_ba_tbspaces_tree.sh
<nowiki>#</nowiki>! /bin/bash
for i in $(seq 1 24); do
/opt/tivoli/tsm/client/ba/bin/dsmc inc -se="hpsscr_backup" -errorlogname=/root/tsm/hpsscr/dsm_hpsscr_ba_tbspaces.log -dirsonly /hpss_tbspc$i
done
'''TSM config file on either core server'''
'''TSM config file on either core server'''
Line 42: Line 74:
resourceutilization 1
resourceutilization 1


'''TSM useful'''
[root@hpsscr02 lost+found]# cat /root/tsm/hpss_ba_tbspaces_tree.sh

<nowiki>#</nowiki>! /bin/bash
'''List backup file systems made by TSM:'''
for i in $(seq 1 24); do
/opt/tivoli/tsm/client/ba/bin/dsmc inc -se="hpsscr_backup" -dirsonly /hpss_tbspc$i
[root@hpsscr02 db2_backup1]#dsmc q fi -se=hpsscr_backup
done
'''List all active backup files in a directory:'''
[root@hpsscr02 db2_backup1]#dsmc q ba /db2_backup1/hghi/ -se=hpsscr_backup
'''List all backup files in a directory (active and inactive):'''
[root@hpsscr02 db2_backup1]#dsmc q ba -ina /db2_backup1/hghi/ -se=hpsscr_backup
'''Restore a file with its original path in another directory:'''
[root@hpsscr02 db2_backup1]#dsmc restore /db2_backup1/hghi/HGHI.0.hpssdb.DBPART000.20160705040006.001 /tmp/ -se=hpsscr_backup
The restored file will be put in '''/tmp/hghi/HGHI.0.hpssdb.DBPART000.20160705040006.001'''
'''Restore a file without its original path in another directory:'''
[root@hpsscr02 db2_backup1]#dsmc restore /db2_backup1/hghi/HGHI.0.hpssdb.DBPART000.20160705040006.001 /tmp/ -se=hpsscr_backup -preservepath=nobase
The restored file will be put in '''/tmp/HGHI.0.hpssdb.DBPART000.20160705040006.001'''
'''Restore a file in its original location:'''
[root@hpsscr02 db2_backup1]#dsmc restore /db2_backup1/hghi/HGHI.0.hpssdb.DBPART000.20160705040006.001 -se=hpsscr_backup
The restored file will be put in '''/db2_backup1/hghi/HGHI.0.hpssdb.DBPART000.20160705040006.001'''
'''NOTE'''
For more complicated restores read TSM BAUser'sGuide or ask SCC-TSM-Team

Latest revision as of 17:49, 27 July 2016

1. TSM backup of HPSS mover

0 22 * * * /opt/tivoli/tsm/client/ba/bin/dsmc inc -errorlogname=/var/log/dsmerror.log >>  /var/log/dsmbackup.log 2>&1
[root@hpssmvr02 ~]# cat /opt/tivoli/tsm/client/ba/bin/dsm.sys
defaultserver   backup
servername      backup
nodename        scc-hpssmvr02
domain / /varhpss /hpss_src /localhome /boot
tcpport                 1503
tcpserveraddress        scc-tsm-sb03.scc.kit.edu
commmethod              tcpip
passwordaccess          generate
managedservices         schedule
*inclexcl                /usr/local/tsm/backup.inclexcl
schedlogretention       32 d
errorlogretention       32 d
resourceutilization     1
guitreeviewafterbackup  yes
NOTE
HPSS Mover04 has a GridKA IP and makes a TSM backup on TSM server scctsm02.gridka.de

2. TSM backup of HPSS core

on either core server in crontab:
#HPSS file systems backups only from the active core server
00 02 * * * if [ $(hostname) == "hpsscr" ] ; then /opt/tivoli/tsm/client/ba/bin/dsmc inc -se="hpsscr_backup" -errorlogname=/root/tsm/hpsscr/dsmerror_hpsscr_backup.log>> 
/root/tsm/hpss/dsm_hpsscr_backup.out 2>&1 ;/root/tsm/hpss_ba_tbspaces_tree.sh >> /root/tsm/hpsscr/dsm_hpsscr_ba_tbspaces.out 2>&1 ; fi #system backup 00 07 * * * /opt/tivoli/tsm/client/ba/bin/dsmc inc -se="system_backup" -errorlogname=/root/tsm/hpsscr01/dsmerror_system_backup.log >> /root/tsm/hpsscr01/dsm_hpsscr01.out 2>&1 System backup: TSM backup for the local file systems: / /localhome /boot (TSM does not make a backup for mounted file systems, they have to be specified) TSM server defined in dsm.sys: system_backup TSM node names: scc-hpsscr01, scc-hpsscr02 Active core backup: TSM backup for all HPSS file systems; it runs only on active core TSM node name: scc-hpsscr TSM server defined in dsm.sys: hpsscr_backup

TSM backup of DB2 tablespaces directory structure

The following script takes a tsm backup of DB2 tablespaces directory structure. (DB2 backup makes data backup here is only the directory structure)
It may be helpful for restoring DB2 from a DB2 bgackup.
It is an IBM recommendation to backup the directory structure, it was not required for our restore test Database Restore exercised on Test Core
[root@hpsscr02 lost+found]# cat /root/tsm/hpss_ba_tbspaces_tree.sh
#! /bin/bash
for i in $(seq 1 24); do
/opt/tivoli/tsm/client/ba/bin/dsmc inc -se="hpsscr_backup" -errorlogname=/root/tsm/hpsscr/dsm_hpsscr_ba_tbspaces.log -dirsonly /hpss_tbspc$i
done

TSM config file on either core server

cat /opt/tivoli/tsm/client/ba/bin/dsm.sys 
servername      system_backup
  nodename        scc-hpsscr01
  domain / /localhome /boot
  tcpport                 1503
  tcpserveraddress        scc-tsm-sb03.scc.kit.edu
  commmethod              tcpip
  passwordaccess          generate
*inclexcl                /usr/local/tsm/backup.inclexcl
  schedlogretention       32 d
  errorlogretention       32 d
  resourceutilization     1
servername      hpsscr_backup
  nodename        scc-hpsscr
  domain /varhpss /hpss_src /db2_backup1 /db2_backup2 /db2_logarchived1 /db2_logarchived2 /optdb2 /varhpssdb
  tcpport                 1503
  tcpserveraddress        scc-tsm-sb03.scc.kit.edu
  commmethod              tcpip
  passwordaccess          generate
*inclexcl                /usr/local/tsm/backup.inclexcl
  schedlogretention       32 d
  errorlogretention       32 d
  resourceutilization     1

TSM useful

List backup file systems made by TSM:
[root@hpsscr02 db2_backup1]#dsmc q fi -se=hpsscr_backup

List all active backup files in a directory:
[root@hpsscr02 db2_backup1]#dsmc q ba /db2_backup1/hghi/ -se=hpsscr_backup

List all backup files in a directory (active and inactive):
[root@hpsscr02 db2_backup1]#dsmc q ba -ina /db2_backup1/hghi/ -se=hpsscr_backup

Restore a file with its original path in another directory:
[root@hpsscr02 db2_backup1]#dsmc restore /db2_backup1/hghi/HGHI.0.hpssdb.DBPART000.20160705040006.001 /tmp/ -se=hpsscr_backup
The restored file will be put in /tmp/hghi/HGHI.0.hpssdb.DBPART000.20160705040006.001

Restore a file without its original path in another directory:
[root@hpsscr02 db2_backup1]#dsmc restore /db2_backup1/hghi/HGHI.0.hpssdb.DBPART000.20160705040006.001 /tmp/ -se=hpsscr_backup -preservepath=nobase
The restored file will be put in /tmp/HGHI.0.hpssdb.DBPART000.20160705040006.001

Restore a file in its original location:
[root@hpsscr02 db2_backup1]#dsmc restore /db2_backup1/hghi/HGHI.0.hpssdb.DBPART000.20160705040006.001 -se=hpsscr_backup
The restored file will be put in /db2_backup1/hghi/HGHI.0.hpssdb.DBPART000.20160705040006.001

NOTE
For more complicated restores read TSM BAUser'sGuide or ask SCC-TSM-Team