Showing posts with label Backup. Show all posts
Showing posts with label Backup. Show all posts

Sunday, 24 March 2013

lsmksysb


There's a simple command to list information about a mksysb image, called lsmksysb:
# lsmksysb -lf mksysb.image
VOLUME GROUP: rootvg
BACKUP DATE/TIME: Mon Jun 6 04:00:06 MST 2011
UNAME INFO: AIX testaix1 1 6 0008CB1A4C00
BACKUP OSLEVEL: 6.1.6.0
MAINTENANCE LEVEL: 6100-06
BACKUP SIZE (MB): 49920
SHRINK SIZE (MB): 17377
VG DATA ONLY: no

rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 32 64 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 8 16 2 open/syncd /
hd2 jfs2 40 80 2 open/syncd /usr
hd9var jfs2 40 80 2 open/syncd /var
hd3 jfs2 40 80 2 open/syncd /tmp
hd1 jfs2 8 16 2 open/syncd /home
hd10opt jfs2 8 16 2 open/syncd /opt
dumplv1 sysdump 16 16 1 open/syncd N/A
dumplv2 sysdump 16 16 1 open/syncd N/A
hd11admin jfs2 1 2 2 open/syncd /admin

Tuesday, 12 March 2013

Netbackup Cheat Sheet


Master Server Daemons/Processes
Request daemonbprd
Schedulerbpsched (started with bprd)
Netbackup database managerbpdbm (started with bpsched)
Job Monitorbpjobd (started with bpdbm)
Media Server Daemons/Processes
Communications daemonbpcd
Backup and restore managerbpbrm (started with bpcd)
Tape Managerbptm (started with bpbrm)
Disk Managerbpdm (started with bpbrm)
Media Managerltid
Bar code readeravrd (started with ltid)
Remote device management/ controls volume databasevmd (started with ltid)
Roboticdaemon (one on each media server) talks to tldcdtldd (started with ltid)
Robotic control daemon talks to the robot directl via scsitldcd (started with ltid)
Catalogs
Master Server
Information about backed-up filesimage - /opt/openv/netbackup/db
Storage Unit, Global Configuration, Catalog backup configuration.config - /opt/openv/netbackup/db
Backup Policy informationclass - /opt/openv/netbackup/db
Job status informationjobs - /opt/openv/netbackup/db
Netbackup logs with error and status informationerror - /opt/openv/netbackup/db
Information on volumes, volume pools, scratch pool and volume groupsvolume - /opt/openv/volmgr/database
Media Server
Tracks assigned volumes (media that has data them)media - /opt/openv/netbackup/db
Information about devices managed by the media serverdevice - /opt/openv/volmgr/database
Log and Information Files
Netbackup and Patch versions/opt/openv/netbackup/bin/version
Media Version/opt/openv/volmgr/version
Patch Level history/opt/openv/netbackup/patch/patch.history
Buffer size/opt/openv/netbackup/db/config/SIZE_DATA_BUFFERS
Number of buffers/opt/openv/netbackup/db/config/NUMBER_DATA_BUFFERS
Network Buffer Size/opt/openv/netbackup/NET_BUFFER_SZ (default = 32)
Java GUI authorisation/opt/openv/java/auth.conf
Catalog type (binary or ASCII)/opt/openv/netbackup/db/config/cat_format.cfg
Netbackup and media manager parameter files/opt/openv/netbackup/bp.conf
/opt/openv/volmgr/vm.conf
Corrupt Database image files (5.0 and above)/opt/openv/netbackup/db.corrupt
Server Commands
Check license details/opt/openv/netbackup/bin/admincmd/get_license_key
Start Netbackupnetbackup start

/opt/openv/netbackup/bin/initbprd (master)
/opt/openv/volmgr/bin/vmd (media)
Stop Netbackup (does not disconnect GUI sessions)netbackup stop
/opt/openv/netbackup/bin/admincmd/bprdreq -terminate (master)
/opt/openv/netbackup/bin/bpdbm -terminate (master)
Stop Netbackup and kill all GUI sessions/opt/openv/netbackup/bin/goodies/bp.kill_all
Start the GUI/opt/openv/netbackup/bin/jnbSA
Scan for tape devicessgscan (solaris)
ioscan (HPUX)
Display all Netbackup processesbpps -a
lists servers errors
bperror -U -problems -hoursago <number of hours>
bperror -U -backstat -by_statcode -hoursago <number of hours>
display information on a error codebperror -statuscode <statuscode> [-recommendation]
Reread bp.conf file without stopping Netbackupbprdreq -rereadconfig
Check database consistencybpdbm -consistency 1
bpdbm -consistency 2
Check for the below lines:
Bad image header
Does not exist
Netbackup Recovery
Device catalog is intactbprecover -l -m <media ID> -d dlt (listing)
bprecover -r -m <media ID> -d dlt (recovering)
Device catalog is gone or corruptedbprecover -l -tpath <tape_path> (listing)
bprecover -r -tpath <tape_path> (recovering)
Disk backupsbprecover -l -dpath <disk_path> (listing)
bprecover -r -dpath <disk_path> (recovering)
Volume Commands
Tape Drive and Inventory Commands
List drive status, detail drive info and pending requestsvmoprcmd
List the tape drive statusvmoprcmd -d ds
List the pending requestsvmoprcmd -d pr
Control a tape devicevmoprcmd [-reset][-up][-down] <drive number>
List all changes in the robot(but do not update)vmupdate -recommend -rt tld -rn 0
vmcheckxxx -rt tld -rn 0 -recommend
Empty the robot and re-inventory (using barcodes)vmupdate -rt tld -rn <robot number> -rh <silo slave> -vh <host> -nostderr -use_barcode_rules -use_seed -empty_ie
Tape Media Commands
List all poolsvmpool -listall -bx
List tapes in poolvmquery -pn <pool name> -bx
List all tapes in the robotvmquery -rn 0 -bx |grep 'TLD' | sort +4
List cleaning tapesvmquery -mt dlt_clean -bx
List tape volume detailsvmquery -m <media ID>
Delete a volume from the catalogvmdelete -m <media ID>
Change a tapes expiry datevmchange -exp 12/31/06 23:59:58 -m <media ID>
Change a tape's media poolvmchange -p <pool number> -m <media ID>
Media commands
List the storage unitsbpstulist -U
Freeze or unfreeze mediabpmedia [-freeze][-unfreeze] -ev <media ID>
List media detailsbpmedialist -ev <media ID>
List media contentsbpmedialist -U mcontents -m <media ID>
List backup Image Informationbpimagelist -backupid <image ID>
Expire client imagesbpimage -cleanup -allclients
Expire a tapebpexpdate -d 0 -ev <media ID> -force
List all netbackups jobsbpdbjobs -report [-hoursago]
Move media from one media server to anotherbpmedia -movedb -newserver <media server> -oldserver <media server>
Tape/Robot commands
List tape drivestpconfig -d
List cleaning times on drivestpclean -L
clean a drivetpclean -C <drive number>
change a drives cleaning frequencytpclean -F <drive> <frequency>
set a drives cleaning time to zerotpclean -M <drive>
Move tapes within robot using robtestrobtest
commands that can be used are as follows:

s s       (show slots)
s d       (show drives)
s i       (show load port)
m s250 d5 (move tape from slot 250 into drive 5)
uload d5  (unload tape from drive 5)
m d5 s250 (move tape from drive 5 to slot 250)
m s250 i1 (mov tape from slot 250 to load port 1)
List load port tapesecho "s i q" | tldtest -r /dev/sg/c0t4l0
List all slot contentsecho "s s q" | tldtest -r /dev/sg/c0t4l0
List tape drive contentsecho "s d q" | tldtest -r /dev/sg/c0t4l0
Move a tape in s100 to drive 1echo "m s100 d1" | tldtest -r /dev/sg/c0t4l0
Move a tape to load port 1echo "m s100 i1" | tldtest -r /dev/sg/c0t4l0
Archiving Commands
list archive infobpcatlist -client all -before Jul 01 2006
bpcatlist -client all -before Aug 01 2006
archive and remove imagesbpcatlist -before Jul 01 2006 | bpcatarc | bpcatrm
restore archive filesbpcatlist -before Jul 01 2006 | bpcatres
Client commands
test client connectivitybpclntcmd [-ip <ip addres>]
bpclntcmd [-hn <hostname>]
bpclntcmd [-pn]
bpclntcmd [-sv]

Courtesy by datadisk.co.uk

lcfd restart process


Step 1 (stop the tivoli agent).

-> Run this command:
/opt/Tivoli/lcf/dat/1/lcfd.sh stop

Step 2 (delete tivoli id files) - Remove these files (if there):

/opt/Tivoli/lcf/dat/1/lcf.dat
/opt/Tivoli/lcf/dat/1/lcfd.st
/opt/Tivoli/lcf/dat/1/lcf.id
/opt/Tivoli/lcf/dat/1/lcfd.bk

and the directory (if there):

/opt/Tivoli/lcf/dat/1/cache

Step 3:  This step is used to test which gateway the endpoint can connect to.

Open a telnet session over port 9494 as followed.
Make sure you can connect to the Tivoli gateways (IP are listed below) over port 9494.
You will get the following return message if the connection is good ->



You will get the following return message if the connection is bad.



If the connection is bad continue down the list of Tivoli Gateway IP Addresses until you find a gateway to connect to.
Here is the list of Tivoli Gateways to try:

129.39.13.38
129.39.13.39
129.39.13.40
10.93.201.144
10.93.201.145
10.93.201.146
10.82.29.201
10.82.29.200
10.83.182.142
10.83.182.143
10.83.182.144
10.72.125.27
10.72.125.26
10.83.146.30
10.86.41.120
10.73.125.17
10.89.126.90

Take note of the connected gateway's IP Address for the following step.

Step 4: Edit the last.cfg file (This will tell the agent to point to a new gateway)

Open the /opt/Tivoli/lcf/dat/1/last.cfg file and put this line at the end of the file ->

lcs.login_interfaces=<successful gateway IP>+9494

example: lcs.login_interfaces=10.89.126.90+9494


Step 5: (start the tivoli agent)

-> Run this command:
/opt/Tivoli/lcf/dat/1/lcfd.sh start

Basic Info on TSM Client

Some Terms:

Node Name: Name assigned to TSM client while registering in TSM server

Backup: It’s a backup, which can have 2 or more versions in TSM Server
  1. Active version of backup which is the latest backup
  2. Inactive version of backup which is older than the latest backup

Archive: It’s a backup, which can have any no. of versions depends upon the expiry date defined in the management class(no. of days of archive stored in tsm server)

You can open a TSM client software using
  1. dsm – GUI based tool
  2. dsmc – Text based tool

Lets get into some basic commands:

To View the session information like the server name, node name (client) etc…


$ dsmc query session
IBM Tivoli Storage Manager
Command Line Backup/Archive Client Interface
  Client Version 5, Release 3, Level 0.12
  Client date/time: 02/11/06   01:15:11
(c) Copyright by IBM Corporation and other(s) 1990, 2005. All Rights Reserved.

Node Name: DDADB350
Session established with server DDTSM05: AIX-RS/6000
  Server Version 5, Release 2, Level 3.0
  Data compression forced on by the server
  Server date/time: 02/11/06   01:15:12  Last access: 02/11/06   00:54:26

TSM Server Connection Information

Server Name.............: DDTSM05
Server Type.............: AIX-RS/6000
Server Version..........: Ver. 5, Rel. 2, Lev. 3.0
Last Access Date........: 02/11/06   00:54:26
Delete Backup Files.....: "Yes"
Delete Archive Files....: "Yes"
Node Name...............: DDADB350
User Name...............: root

This shows that
client name is DDADB350
TSM server name is DDTSM05.
TSM Server version is 5.2
TSM Client version is 5.3
How to take a backup:

To take selective files:
$ dsmc selective /opt/oracle/archive/*  -subdir=yes

To take incremental:
$ dsmc incremental /opt/oracle/archive/*  -subdir=yes


How to archive:

$ dsmc archive /opt/oracle/archive/* -archmc=arch0365 –subdir=yes

Here archmc is the term for management class and arch0365 is a customized management class, which will keep the data in tape for 365 days. We can create customized MC in TSM Server.

How to check the active backup:
$ dsmc query backup /opt/oracle/archive/* -subdir=yes

How to check the inactive backup:
$ dsmc query backup /opt/oracle/archive/* -inactive –subdir=yes

How to check for archived data:
$ dsmc query archive /opt/oracle/archive/* -subdir=yes
This will list the files archived, which can be on different dates:

You can use from date option to get a list of archive from that particular date:
$ dsmc query archive /opt/oracle/archive/* -fromdate=11/02/06 –subdir=yes


How to check the latest backup date and time:
$ dsmc query filespace
here fs means the file space. File space is the space kept in TSM server for each file system. This command will list the backup information with last backup date.

$ root dsmc query filespace
IBM Tivoli Storage Manager
Command Line Backup/Archive Client Interface
  Client Version 5, Release 3, Level 0.12
  Client date/time: 02/11/06   01:25:50
(c) Copyright by IBM Corporation and other(s) 1990, 2005. All Rights Reserved.

Node Name: DDADB350
Session established with server DDTSM05: AIX-RS/6000
  Server Version 5, Release 2, Level 3.0
  Data compression forced on by the server
  Server date/time: 02/11/06   01:25:50  Last access: 02/11/06   01:15:12
TSM Scrollable Window - Query Filespace

     #      Last Incr Date      Type    File Space Name
        ---------------------------------------------------------------------------------------------------------------------
     1. | 02/10/06   22:01:45   JFS     /
     2. | 02/10/06   22:04:46   JFS2    /db2/RVI/db2dump
     3. | 02/11/06   00:54:17   JFS2    /db2/RVI/dbs
     4. | 02/10/06   22:04:46   JFS2    /db2/RVI/sapdata
     5. | 02/10/06   22:04:46   JFS2    /db2/RVI/sapdatat
     6. | 02/10/06   22:04:47   JFS2    /db2/db2as
     7. | 02/10/06   22:04:54   JFS2    /db2/db2rvi
     8. | 02/10/06   22:04:07   JFS     /home
     9. | 00/00/00   00:00:00   API:archive  /mksysb_apitsm
    10. | 02/10/06   22:04:18   JFS     /opt
    11. | 02/10/06   22:05:19   JFS2    /opt/TWS
    12. | 02/11/06   00:54:10   JFS2    /sapmnt/RVI
    13. | 02/11/06   00:54:25   JFS2    /sapwork/RVI
    14. | 00/00/00   00:00:00   JFS     /snap
    15. | 02/10/06   22:03:41   JFS     /usr
    16. | 02/10/06   22:04:27   JFS     /usr/local
    17. | 02/10/06   22:04:36   JFS     /usr/local/Tivoli/lcf/ddadb350
    18. | 02/11/06   00:54:14   JFS2    /usr/sap/RVI
    19. | 02/10/06   22:04:01   JFS     /var
    20. | 02/10/06   22:04:41   JFS     /var/local
        0---------10--------20--------30--------40--------50--------60--------70--------80--------90--------100-------110----
<U>=Up  <D>=Down  <R>=Right  <L>=Left  <Q>=Quit
query filespace> Q


How to restore active backup:
$ dsmc restore /opt/oracle/archive/* -subdir=yes

You have to use “subdir” option to restore subdirectories.

How to restore inactive backups:
$ dsmc restore /opt/oracle/archive/* - inactive –subdir=yes

How to restore archive:
$ dsmc retrieve  /opt/oracle/archive/* -subdir=yes

You can retrieve a archive from a particular date using “fromdate” option.
$ dsmc retrieve  /opt/oracle/archive/* -fromdate=11/02/06 –subdir=yes

To get the scheduled backup information on a client:

$ dsmc
tsm> q schedule
    Schedule Name: AIX_05_DDADB_04
      Description: Incr backups
   Schedule Style: Classic
           Action: Incremental
          Options:
          Objects:
         Priority: 5
   Next Execution: 20 Hours and 27 Minutes
         Duration: 1 Hour
           Period: 1 Day
      Day of Week: Any
            Month:
     Day of Month:
    Week of Month:
           Expire: Never

    Schedule Name: AIX_05_MKSYSB_19
      Description: Monthly System Backup
   Schedule Style: Classic
           Action: Command
          Options:
          Objects: /usr/local/bin/mksysb_apitsm
         Priority: 5
   Next Execution: 190 Hours and 27 Minutes
         Duration: 1 Hour
           Period: 1 Month
      Day of Week: Any
            Month:
     Day of Month:
    Week of Month:
           Expire: Never

Here we have 2 schedules for this client.

For help:

$ dsmc
Ø  help
To search the IBM Tivoli Storage Manager technical support Web site to find
technical solutions and answers to frequently asked questions, refer to
http://www.ibm.com/software/sysmgmt/products/support/IBMTivoliStorageManager.html.

The following help topics are available.
Enter the number of the desired help topic or 'q' to quit,
'd' to scroll down, 'u' to scroll up.

             0 - Summary of Changes for TSM Version 5.3
             1 - Using Commands
             2 - Select from the commands listed below:
             3 -  ARCHIVE
             4 -  BACKUP GROUP
             5 -  BACKUP IMAGE
             6 -  BACKUP NAS
             7 -  BACKUP WAS
             8 -  CANCEL PROCESS
             9 -  CANCEL RESTORE
            10 -  DELETE ACCESS
            11 -  DELETE ARCHIVE
            12 -  DELETE BACKUP
            13 -  DELETE FILESPACE
            14 -  DELETE GROUP
            15 -  EXPIRE
            16 -  HELP
            17 -  INCREMENTAL
            18 -  LOOP
            19 -  MACRO
            20 -  MONITOR PROCESS
            21 -  PREVIEW
            22 -  QUERY ACCESS
            23 -  QUERY ARCHIVE
            24 -  QUERY BACKUP
            25 -  QUERY BACKUPSET
            26 -  QUERY FILESPACE
            27 -  QUERY GROUP
            28 -  QUERY IMAGE
            29 -  QUERY INCLEXCL
            30 -  QUERY MGMTCLASS
            31 -  QUERY NODE
            32 -  QUERY OPTIONS
            33 -  QUERY RESTORE

You can get the syntax of any command here.

Basic (Useful) TSM commands


Analysing Logs
TSM> q actlog

Analysing DB
TSM> q db

Analysing Storage Pool
TSM> q stgpool

Analysing volumes inside the library
TSM>q libvol

Analysing all volumes in Tape Storage Pool
TSM> q vol devclass=ltoclass

Analysing backups in db (executed)
TSM> q volhist type=dbb

Write a label on a volume
TSM> run label “volume name”

Remove a volume from LTO
TSM> run DISMOUNT “volume name”

Verify existing scripts
TSM> q script

Verifying commands executed from one script
TSM> q script f=d

Verifying sessions
TSM> q sess

Canceling a session
TSM>cancel sess “session number”

Show data from scheduled client on the current day
TSM> q event * *

Show data from scheduled client on the next day
TSM> q event * * begind=+1

Show data from administrative schedule on the current day
TSM> q event * t=a

Show data from administrative schedule on the next day
TSM> q event * t=a begind=+1

Show process
TSM> q proc

Show Tape requisition
TSM> q req

Show a tape into the drive
TSM> q mount