关于 tsm 数据 备份和恢复的 测试

今天联系了数据的备份和恢复:

[root@sheng test]# pwd
/bk/test
[root@sheng test]# ls -l
total 8708
-rw-r--r-- 1 root root 8896502 May 23 07:53 vistor_2_1_1.tgz
[root@sheng test]# du -k
8716    .

开始备份:
cd /opt/tivoli/tsm/client/ba/bin
./dsmc
注意,以后发现client 端的tsm 没有备份的话,要先看dsmc 的进程有没有在,如果没有进程的话,
那就备份失败。

好,我打算备份:/bk/test

查看一下磁带的状态:
TSM:TSM_SVR1>
q v
ANR2017I Administrator SERVER_CONSOLE issued command: QUERY VOLUME

Volume Name                  Storage         Device         Estimated       Pct      Volume
                             Pool Name       Class Name      Capacity      Util      Status
------------------------     -----------     ----------     ---------     -----     --------
/opt/tivoli/tsm/server/-     ARCHIVEPOOL     DISK               5.0 M       0.0     On-Line
 bin/archive.dsm                                                                           
/opt/tivoli/tsm/server/-     BACKUPPOOL      DISK              10.0 M       0.0     On-Line
 bin/backup.dsm                                                                            
AD0001                       BA_TAPE_PO-     LTO2               1.0 G       0.0     Filling
                              OL                                                           
AD0002                       BA_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
AD0003                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
AD0004                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
TT0003                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
TT0004                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 


[root@sheng bin]# ./dsmc selective /bk/ -subdir=yes
IBM Tivoli Storage Manager
Command Line Backup/Archive Client Interface
  Client Version 5, Release 5, Level 1.0 
  Client date/time: 05/23/2011 09:50:52
(c) Copyright by IBM Corporation and other(s) 1990, 2008. All Rights Reserved.

Node Name: TSM_SVR1
Please enter your user id <TSM_SVR1>: admin

Please enter password for user id "ADMIN":

Session established with server TSM_SVR1: Linux/i386
  Server Version 5, Release 5, Level 1.0
  Server date/time: 05/23/2011 09:50:52  Last access: 05/23/2011 09:33:16

Selective Backup function invoked.

Directory-->               4,096 /bk [Sent]     
Directory-->               4,096 /bk/test [Sent]     
Normal File-->         8,896,502 /bk/test/vistor_2_1_1.tgz [Sent]     
ANS1114I Waiting for mount of offline media.
Retry # 1  Directory-->               4,096 /bk [Sent]     
Retry # 1  Directory-->               4,096 /bk/test [Sent]     
Retry # 1  Normal File-->         8,896,502 /bk/test/vistor_2_1_1.tgz [Sent]     
Selective Backup processing of '/bk/*' finished without failure.

                                 
Total number of objects inspected:        3
Total number of objects backed up:        3
Total number of objects updated:          0
Total number of objects rebound:          0
Total number of objects deleted:          0
Total number of objects expired:          0
Total number of objects failed:           0
Total number of bytes transferred:   16.97 MB
Data transfer time:                    0.99 sec
Network data transfer rate:        17,546.40 KB/sec
Aggregate data transfer rate:      12,185.50 KB/sec
Objects compressed by:                    0%
Elapsed processing time:           00:00:01
[root@sheng bin]#

看一下磁带的状态:

tsm: TSM_SVR1>q v

Volume Name                  Storage         Device         Estimated       Pct      Volume
                             Pool Name       Class Name      Capacity      Util      Status
------------------------     -----------     ----------     ---------     -----     --------
/opt/tivoli/tsm/server/-     ARCHIVEPOOL     DISK               5.0 M       0.0     On-Line
 bin/archive.dsm                                                                           
/opt/tivoli/tsm/server/-     BACKUPPOOL      DISK              10.0 M       0.0     On-Line
 bin/backup.dsm                                                                            
AD0001                       BA_TAPE_PO-     LTO2               1.0 G       0.8     Filling
                              OL                                                           
AD0002                       BA_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
AD0003                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
AD0004                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
TT0003                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
TT0004                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           

tsm: TSM_SVR1>

看到ad0001 的pct until 利用为0.8%, 可以看到数据进去了。

好!
下面来进行数据的恢复,注意,/bk 文件夹必须存在。现在吧/bk 下的子文件夹所以东西删掉:
[root@sheng bk]# rm -rf test
[root@sheng bk]# ls -l
total 0

cd /opt/tivoli/tsm/client/ba/bin

[root@sheng bin]# ./dsmc restore /bk/ -subdir=yes
IBM Tivoli Storage Manager
Command Line Backup/Archive Client Interface
  Client Version 5, Release 5, Level 1.0 
  Client date/time: 05/23/2011 10:00:29
(c) Copyright by IBM Corporation and other(s) 1990, 2008. All Rights Reserved.

Node Name: TSM_SVR1
Please enter your user id <TSM_SVR1>: admin

Please enter password for user id "ADMIN":

Session established with server TSM_SVR1: Linux/i386
  Server Version 5, Release 5, Level 1.0
  Server date/time: 05/23/2011 10:00:30  Last access: 05/23/2011 09:51:16

Restore function invoked.

ANS1247I Waiting for files from the server...
 ** Interrupted **
ANS1114I Waiting for mount of offline media.
Restoring           4,096 /bk/test [Done]     
Restoring       8,896,502 /bk/test/vistor_2_1_1.tgz [Done]     
<    8.48 MB> [ - ]
Restore processing finished.
                                 
Total number of objects restored:         2
Total number of objects failed:           0
Total number of bytes transferred:    8.48 MB
Data transfer time:                    0.43 sec
Network data transfer rate:        19,817.72 KB/sec
Aggregate data transfer rate:      1,417.76 KB/sec
Elapsed processing time:           00:00:06
[root@sheng bin]#

好,现在再看一下/bk 下的文件夹:
[root@sheng bin]# cd /bk
[root@sheng bk]# ls -l
total 8
drwxr-xr-x 2 root root 4096 May 23 09:48 test
[root@sheng bk]# cd test
[root@sheng test]# ls -l
total 8708
-rw-r--r-- 1 root root 8896502 May 23 09:48 vistor_2_1_1.tgz
[root@sheng test]#

数据恢复成功。

现在再看一下,磁带的状态:

tsm: TSM_SVR1>q v

Volume Name                  Storage         Device         Estimated       Pct      Volume
                             Pool Name       Class Name      Capacity      Util      Status
------------------------     -----------     ----------     ---------     -----     --------
/opt/tivoli/tsm/server/-     ARCHIVEPOOL     DISK               5.0 M       0.0     On-Line
 bin/archive.dsm                                                                           
/opt/tivoli/tsm/server/-     BACKUPPOOL      DISK              10.0 M       0.0     On-Line
 bin/backup.dsm                                                                            
AD0001                       BA_TAPE_PO-     LTO2               1.0 G       0.8     Filling
                              OL                                                           
AD0002                       BA_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
AD0003                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
AD0004                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
TT0003                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
TT0004                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           

tsm: TSM_SVR1>

发现数据虽然恢复,但是磁带中的数据还保留着,好,下面练习删除磁带中的数据:

发现有点问题:

tsm: TSM_SVR1>delete backup "/bk/" -deltype=all
ANR2000E Unknown command - DELETE BACKUP.
ANS8001I Return code 2.

下面将继续研究...

 

后来发现是在 ./dsmc delete backup "/bk/" 下运行的:

 

[root@sheng bin]# ./dsmc delete backup /bk/ -deltype=all
IBM Tivoli Storage Manager
Command Line Backup/Archive Client Interface
  Client Version 5, Release 5, Level 1.0 
  Client date/time: 05/23/2011 11:45:50
(c) Copyright by IBM Corporation and other(s) 1990, 2008. All Rights Reserved.

Node Name: TSM_SVR1
Please enter your user id <TSM_SVR1>: admin

Please enter password for user id "ADMIN":

Session established with server TSM_SVR1: Linux/i386
  Server Version 5, Release 5, Level 1.0
  Server date/time: 05/23/2011 11:45:50  Last access: 05/23/2011 11:23:10

 


All backup objects in the specified directory and its subdirectories will be deleted. This command ignores the -subdir option. Do you wish to proceed? (Yes (Y)/No (N)) y
Backup Delete->           4,096 /bk/test [Sent]     
Backup Delete->       8,896,502 /bk/test/vistor_2_1_1.tgz [Sent]     
                                 
Total number of objects deleted:          2
Total number of objects failed:           0
Total number of bytes transferred:       0  B
Data transfer time:                    0.00 sec
Network data transfer rate:            0.00 KB/sec
Aggregate data transfer rate:          0.00 KB/sec
Objects compressed by:                    0%
Elapsed processing time:           00:00:20

 

删除成功:

看一下磁带的状态:

 

tsm: TSM_SVR1>q v

Volume Name                  Storage         Device         Estimated       Pct      Volume
                             Pool Name       Class Name      Capacity      Util      Status
------------------------     -----------     ----------     ---------     -----     --------
/opt/tivoli/tsm/server/-     ARCHIVEPOOL     DISK               5.0 M       0.0     On-Line
 bin/archive.dsm                                                                           
/opt/tivoli/tsm/server/-     BACKUPPOOL      DISK              10.0 M       0.0     On-Line
 bin/backup.dsm                                                                            
AD0001                       BA_TAPE_PO-     LTO2               1.0 G       0.8     Filling
                              OL                                                           
AD0002                       BA_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
AD0003                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
AD0004                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
TT0003                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           
TT0004                       AR_TAPE_PO-     LTO2               0.0 M       0.0      Empty 
                              OL                                                           

tsm: TSM_SVR1>

 

看到 ad0001 pct util 还是 0.8, 不过没有关系。log 已经显现delete 成功了。很高兴!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shenghuiping2001

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值