Tuesday, October 4, 2016

TSM Script for UNIX server for multible TSM instance

Before we see the script we should know in which environment we can use this script .

  1. All the TSM instance should run in UNIX server 
  2. All the UNIX server should have network connection
  3. The server where you running script from that server you should able to connect all the TSM instance ( For this connectivity we need to add all the TSM instances following information in the dsm.sys file in this unix server

    Servername                      TSMINSTANCENAMETCPPort                         1500
    TCPServeraddress                20.28.24.14

Now we can see the script 

we need two files for this script 
File 1 -- All the TSM instances server names 
File 2 -- Script File

The below is the script for collecting DB backup status for past 24 hours
-----------------------------------------------------------------------------------------------------------------
for i in `cat FILE1`

do

echo "$i"

echo "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"

dsmadmc -id=yyyyy -password=xxxxxxxxx -DATAOnly=yes -se=$i -tab "SELECT TO_CHAR(CHAR(date_time),'YYYY-MM-DD HH24:MI:SS') AS Date_Time, type, devclass FROM volhistory WHERE type='BACKUPFULL' AND date_time>=current_timestamp-24 hours"|uniq
 
done-----------------------------------------------------------------------------------------------------------------

In the script file(File 2) we need to add this script and give execute privilege 

for run this script we need all the TSM instance id and password should be same if you have different id password then we need to modify this script (if anybody want that script please mention in comment)

Now we can see one examble

FILE 1 - Name -- TSMINSTANCES below is the entries 
TSM01
TSM02
TSM03

FILE 2 - Name -- DB_BACKUP_STATUS.ksh below is the enries

 

for i in `cat TSMINSTANCES`

do

echo "$i"

echo "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"

dsmadmc -id=yyyyy -password=xxxxxxxxx -DATAOnly=yes -se=$i -tab "SELECT TO_CHAR(CHAR(date_time),'YYYY-MM-DD HH24:MI:SS') AS Date_Time, type, devclass FROM volhistory WHERE type='BACKUPFULL' AND date_time>=current_timestamp-24 hours"|uniq
 
done


to run the script just give the script file name

DB_BACKUP_STATUS.ksh     and enter then script will start to run and give the output in the screen like below.

TSM01
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
2016-10-04 08:00:24     BACKUPFULL      DEVICECLASSNAME
2016-10-04 15:00:27     BACKUPFULL      DEVICECLASSNAME
TSM02
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
2016-10-04 08:00:21     BACKUPFULL      DEVICECLASSNAME
2016-10-04 15:00:23     BACKUPFULL      DEVICECLASSNAME
TSM03
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
2016-10-04 06:00:20     BACKUPFULL      DEVICECLASSNAME
2016-10-04 17:00:20     BACKUPFULL      DEVICECLASSNAME
 
**if anybody want any script please comment I will help you



Thursday, August 25, 2016

Which are the times or conditions TSM will take backup

Based on the 4 key features of the files, TSM application will decide whether the file needs to be backed up or not

   MODified
      Specifies that Tivoli Storage Manager backs up the file only if it
      has changed since the last backup. Tivoli Storage Manager
      considers a file changed if any of the following is true:
      *  The date last modified is different
      *  The file size is different
      *  The file owner is different
      *  The file permissions are different

Tuesday, August 9, 2016

TSM LAN Free Configuration

1. LAN FREE PREREQUISITES

  1. Identify the devices which are used in Lan Free Data movement.
  2. Identify the TSM Clients which use Lan Free Data movement.
  3. Identify the TSM server.
  4. Identify the Library that is used. Library should be shared among TSM server and TSM clients that use Lan Free Data movement.
  5.  Compatibility of TSM Server, Storage Agent Code and library drives

TSM for SAN is also referred as Storage Agent.

Lan Free consists of TSM Server, TSM Client with Storage Agent Installed and both need access to Shared Library connected to SAN.

Conditions to be met:

  1. SAN configuration must be supported by TSM from H/W and S/W perspective.
  2. TCP/IP comm. Is required between TSM Server, TSM Client and Storage Agent.
  3. licenses of Tivoli Storage Manager for SAN.
  4. TSM BA client or TSM Data Protection application client must be installed on a client system Figure
Note: The Tivoli Storage Manager server and Storage Agents may run on different platforms ( Eg. NNALMG01 is on Aix and US-EX-CL-80* are on Windows 2008 )

2. Server setup for LAN-free

TSM Server is referred as Library Manager and other hosts as Library Clients When Library is shared among different hosts. ( Eg. In Lexington NNALMG01 is Library Manager and other TSM Servers NNATSM01, NNATSM02, NNATSM04 and TSM Clients US-EX-CL-80*_STA are Library Clients).
 
The library manager owns and controls the library device and processes all requests from the library
clients, such as mounting and dismounting volumes.
 

Prepare TSM Server for server-to-server communication.

TSM server name must be setup and it should be unique across the TSM Environment.
TSM Server Highlevel Address and Lowlevel address should be set

Highlevel Address = IP Address
LowLevel Address = Port No.
Port No. by default is 1500

tsmsrvr> set servername NNALMG01
tsmsrvr> set serverpassword xxxxxx
tsmsrvr> set serverhladdress 192.168.56.16
tsmsrvr>set serverlladdress 1500
tsmsrvr>q status
shows all these set things.

Defining library, drives, and associated paths on the server

Library is shared between TSM server and Storage Agents. If Library is not shared, Storage Agents cannot communicate with Library.

tsmsrvr>define library nnalbr01 libtype=scsi shared=yes resetdrives=yes autolabel=yes serial=autodetect

tsmsrvr >define path nnalmg01 nnalbr01 srctype=server desttype=library autodetect=yes device=/dev/smc0

tsmsrvr>define drive nnalbr01 drive01 serial=autodetect element=autodetect cleanfrequency=none

tsmsrvr>define drive nnalbr01 drive02 serial=autodetect element=autodetect cleanfrequency=none

tsmsrvr>define path nnalbr01 drive01 srctype=server desttype=drive library=nnalbr01 device=/dev/rmt0 online=yes

tsmsrvr>define path nnalbr01 drive02 srctype=server desttype=drive library=nnalbr01 device=/dev/rmt0 online=yes

Defining the Device Class

tsmsrvr>define devclass LTO_CLASS_1 devtype=LTO library=nnalbr01 format=ULTRIUM2C mountretention=5 mountlimit=DRIVES

Creating primary sequential storage pool for LAN-free

Define stg pool for Lan Free clients to backup ( LANFREE_TP)

tsmsrvr>define stgp LANFREE_TP LTO_CLASS_1 description="Lan-free storage pool" collocate=node maxscratch=999
 
Define Policy
 
Create Policy for EXCHANGE_LANFREE for Lan free clients and copy destination LANFREE_TP
Register Node
 
LAN FREE Validation

tsmsrvr> validate lanfree us-ex-mb-805 us-ex-cl-812_sta

3.Storage Agent setup

Storage Agent is an Interface between TSM server and Client.
Storage Agent does not initiate a Backup or Restore, it is initiated by BA client.

Perform a Normal Backup and restore over Lan before installing Storage Agent, to make sure basic connectivity is fine.

Steps to configure Storage Agent
  1. Identify Library and drives in Client OS
  2. Install Device Drivers for Library and Drives
  3. Install Storage Agent S/W
  4. Configure the Storage Agent and set it as a service.
  5. Obtain device information.
  6. Define the Storage Agent and device paths.
  7. Customize the client options file to enable LAN-free.
 
Note: Cannot install the Storage Agent on a machine that is an Tivoli Storage Manager server.

Device drivers for shared devices

Install Device Drivers for Library and Drives

Note: On Windows 2000 machines, enable the device driver using tsmscsi
/enable command, which is located in the Storage Agent installation directory

The supported devices and required device drivers are on the Tivoli Storage Manager Web site:
http://www.ibm.com/software/sysmgmt/products/support/IBM_TSM_Supported_Devices_for_AIXHPSUNWIN.html

Note: Disable the Windows Removable Storage Manager (RSM) component so that it will not conflict with the device drivers. Disable the RSM component by selecting RSM from the Windows services available and updating its startup type to disabled.

Install Storage Agent software
 
Advisable to go with Complete Install

Configuring the Storage Agent
 
For Storage Agent to communicate with TSM server-to-server communication is needed. TSM Server is prepared for server-to-server communication.

Now we need to define Storage Agent on the TSM Server. For this we need a unique Storage Agent name, password, communication path (IP address or DNS name) to the Storage Agent, and the IP port the agent listens on.

Defining Storage Agent on the server for server-to-server communication

tsmsrvr>define server US-EX-Cl-801_STA serverpassword=us-ex-cl-801_sta
hladdress=192.168.63.6 lladdress=1502 description="Storage Agent on US-EX-CL-801"

Customize the Storage Agent Configuration file
 
To cistomize the Storage Agent we need to edit the dsmsta.opt file located in Storage Agent
Installation folder. ( c:/program files/Tivoli/tsm/StorageAgent/)

There are many things we can set in dsmsta.opt ( just like in dsm.opt / dsm.sys), however, for basic setup only two options are needed, DEVCONFIG and TCPPORT
 
Option file dsmsta.opt
------------------------
DEVCONFIG devconfig.txt
TCPPORT 1502

 
Now Initializing Storage Agent. There are two methods to Initialize the Storage Agent:

a. GUI ( Preferred method)
b. Command Line
Storage Agent initialization using GUI wizard

1. Start → Programs → Tivoli Storage Manager → Management Console -> Double click "Storage Agent Initialization"
2. Next
3. Enter the Storage Agent configuration values

Storage Agent Name: US-EX-CL-801_STA
Storage Agent Password: us-ex-cl-801_sta
Verify Storage Agent Password: us-ex-cl-801_sta
Storage Agent TCP/IP Address: 192.168.63.6
 
Next
4. Enter the Tivoli Storage Manager server
TSM Server Name
: NNALMG01 
TSM Server Password : xxxxxxx
TSM Server TCP/IP Addr : 192.168.x.16 
TSM Server Port No. : 1500
5. Set Storage Agent Service Behaviour

Account under which Service has to run. ( Administrator )
Recommended automatically starting the service on reboot
Next -> Finish

This creates a Service "TSM StorageAgent1" and starts it.

6. If the service started successfully, two sessions are opened to the Tivoli Storage Manager server. One session is for the Storage Agent itself, and the other is for event logging to the Tivoli Storage Manager server

Even tough Two sessions are started and seem that communication is correctly established, you
should verify this using the ping server command

tsmsrvr>ping server us-ex-cl-801_sta
 
Storage Agent initialization using the command line
 
C:\Program Files\Tivoli\TSM\storageagent>DSMSTA –k “StorageAgent1”
SETSTORAGESERVER MYname=US-EX-CL-801_STA MYPassword=us-ex-cl-801_sta
MYHLAddress=192.168.28.89 servername=NNALMG01 SERVERPASSWORD=nnalmg01
HLAddress=192.168.10.16 LLaddress=1500
This makes few configuration entries in the devconfig.txt file.
 
Now we start Storage Agent in the foreground to verify that the Storage Agent starts and connects to the server.

C:\Program Files\Tivoli\TSM\storageagent>dsmsta

This show 2 sessions on TSM Server. One session is for Storage Agent and the other for Event
Logging on TSM Server.

Setting up Storage Agent service using the command line

C:\Program Files\Tivoli\TSM\storageagent>install "TSM StorageAgent1"

( Should have initialized Storage Agent with “ >dsmsta –k “StorageAgent1” )

Device configuration on the Storage Agent

The following command lists all the needed details to configure devices (Tape Drives)
C:\Program Files\Tivoli\TSM\storageagent>tsmdlst /xinquiry

Output of ‘>tsmdlst /xinquiry’

 
Manufacturer  Model  Driver  Version  Firmware  Description
----------------------------------------------------------------------------------------------------------------
QLogic Corporation QLA2340 ql2300.sys 9.1.7.18 3.03.25 QLogic QLA2340 Fibre Channel Adapter
QLogic Corporation QLA2340 ql2300.sys 9.1.7.18 3.03.25 QLogic QLA2340 Fibre Channel Adapter



TSM Name ID LUN Bus Port SSN WWN TSM Type Device Identifier
---------------------------------------------------------------------------------------------------------------------
mt0.0.0.4 0 0 0 4 0007813585 500507630F0A0000 LTO IBM ULT3580-TD3
73P5
mt1.0.0.4 1 0 0 4 0007813550 500507630F0A0000 LTO IBM ULT3580-TD3 73P5
mt0.0.0.5 0 0 0 5 0007813441 500507630F0A0000 LTO IBM ULT3580-TD3 73P5
mt1.0.0.5 1 0 0 5 0007813437 500507630F0A0000 LTO IBM ULT3580-TD3 73P5

Defining paths between Storage Agent and shared drives
In our case all the exchange servers US-EX-CL-801 – 814 has a tool. ‘c:\New Folder\ has itdt.exe. 

(IBM TotalStorage Tape Diagnostic Tool )Run this file, this gives all the output as follows:
Host Bus ID LUN Model
Serial
Ucode Changer [#]
+----+----+----+----+----+--------------+------------+------+------------+-+
| 0 | 4 | 0 | 0 | 0 | ULT3580-TD3 | 0007813585 | 73P5 | 78206390401| |
| 1 | 4 | 0 | 0 | 1 | 03584L32         | 78206390401| 7379 |                        | |
| 2 | 4 | 0 | 1 | 0 | ULT3580-TD3 | 0007813550 | 73P5 | 78206390401| |
| 3 | 5 | 0 | 0 | 0 | ULT3580-TD3 | 0007813441 | 73P5 | 78206390401| |
| 4 | 5 | 0 | 1 | 0 | ULT3580-TD3 | 0007813437 | 73P5 | 78206390401| |

(IBM TotalStorage Tape Diagnostic Tool (itdt.exe)
With the help of output from itdt.exe define paths to Storage Agent.
tsmsrvr>define path US-EX-CL-801_STA Drive01 srct=server destt=drive libr=nnalbr01
device=mt0.0.0.4 online=yes

tsmsrvr>define path US-EX-CL-801_STA Drive02 srct=server destt=drive libr=nnalbr01
device=mt0.0.0.5 online=yes

tsmsrvr> q path US-EX-CL-801_STA    ( Verify the Paths)

Client LAN-free customization

To make the TSM Client utilize Lan Free path we need to customize the opt file to specify
communication method, Storage Agent Address and port on which Storage Agent listens for
requests.
( If we are configuring BA client for lan free these should be entered in BA client dsm.opt. In our case we use this only for Application backup i.e Exchange... so this should be entered in TDPforExchange folder C:\Program Files\Tivoli\TSM\TDPExchange\dsm.opt)
 
ENABLELANFREE YES
LANFREECOMMMETHOD TCPIP
LANFREETCPSERVERADDRESS US-EX-MB-801
LANFREETCPPORT 1502
Note:- Even though Data is Transferred Lan Free, Bytes Transferred will be more than LanFree Data Bytes transferred as Lan Path is used for storing Metadata in the server database. Thus Total value of Transferred data will be more than LanFree Data transferred.

Determining whether the data movement is LAN-free
Query session against the node that is running the LAN-free backup, when LAN-free data movement is occurring. Here Bytes Recvd column for US-EX-MB-801 determines it.
 
tsmsrvr>us-ex-cl-801_sta:q se
Sess      Comm.    Sess   Wait Bytes Bytes Sess  Platform Client Name
Number Method State Time Sent Recvd Type
------ ------ ------ ------ ------- ------- ----- -------- --------------------

1,118 Tcp/Ip IdleW 0S 1.2 K 352.0 G Node TDP MSE- US-EX-MB-801
1,119 Tcp/Ip IdleW 0S 6.2 K 13.4 K Servr AIX-RS/6000 NNALMG01
1,120 Tcp/Ip IdleW 0S 7.2 K 12.4 K Servr AIX-RS/6000 NNALMG01

The output on the Tivoli Storage Manager server shows a very small number of bytes of metadatareceived for the same node. This confirms that data movement is LAN-free.



tsmsrvr>q se
20,279  Tcp/Ip  IdleW  14 S  345.2 K 142.0 K Servr Windows US-EX-CL-801_STA
20,283  Tcp/Ip  IdleW  14 S  135.2 K 342.0 K Servr Windows US-EX-CL-801_STA
11,135  Tcp/Ip  IdleW  19 S  945.2 K 162.0 K Node TDP MSE- US-EX-MB-801




Alternatively, we can use the following command to figure out whether the data movement was
LAN-free



tsmsrvr>query actlog search=US-EX-CL-801_STA msgno=8337
06/21/09 03:31:28 ANR8337I (Session: 95322, Origin: US-EX-CL-801_STA) LTO
                   volume N02155L3 mounted in drive DRIVE034 (mt0.0.0.4).
                   (SESSION: 95322)
06/21/09 19:12:33 ANR8337I (Session: 104645, Origin: US-EX-CL-801_STA) LTO
                   volume N01601L3 mounted in drive DRIVE034 (mt0.0.0.4).
                  (SESSION: 104645)
06/21/09 19:37:13 ANR8337I (Session: 104645, Origin: US-EX-CL-801_STA) LTO

                  volume N02155L3 mounted in drive DRIVE034 (mt0.0.0.4).
                  (SESSION: 104645)
06/21/09 20:15:40 ANR8337I (Session: 104645, Origin: US-EX-CL-801_STA) LTO
                  volume N02155L3 mounted in drive DRIVE034 (mt0.0.0.4).
                   (SESSION: 104645)
06/21/09 21:05:22 ANR8337I (Session: 104645, Origin: US-EX-CL-801_STA) LTO
                  volume N01601L3 mounted in drive DRIVE034 (mt0.0.0.4).
                  (SESSION: 104645)
06/21/09 21:52:18 ANR8337I (Session: 104645, Origin: US-EX-CL-801_STA) LTO
                 volume N02155L3 mounted in drive DRIVE033 (mt0.0.0.5)
                 (SESSION: 104645)
06/22/09 02:37:39 ANR8337I (Session: 115175, Origin: US-EX-CL-801_STA) LTO
                volume N01601L3 mounted in drive DRIVE033 (mt0.0.0.5).
                (SESSION: 115175)
06/22/09 03:08:36 ANR8337I (Session: 115175, Origin: US-EX-CL-801_STA) LTO
                volume N02155L3 mounted in drive DRIVE033 (mt0.0.0.5).
                 (SESSION: 115175)