define library FileLib libtype=file share=yes
DEFINE DEVCLASS tsmdev DEVTYPE=FILE MAXCAPACITY=2G DIRECTORY=/tsmpool shared=yes mountlimit=20 library=filelib
update devclass tsmdev library=filelib
DEFINE STGPOOL stg_ora tsmdev ACCESS=READWRITE COLLOCATE=NO MAXSCRATCH=20 REUSEDELAY=0 DATAFORMAT=NATIVE
define domain oradomain
define policyset oradomain orapolicy
define mgmtclass oradomain orapolicy oramgmt
define copygroup oradomain orapolicy oramgmt standard destination=stg_ora verexist=1 verdelete=0 retextra=0 retonly=0 mode=absolute
assign defmgmtclass oradomain orapolicy oramgmt
activate policyset oradomain orapolicy
register node CLIENT1 admin backdel=yes compress=yes domain=oradomain
Update node CLIENT1 domain=oradomain archdelete=yes backdelete=yes
define vol STG_ORA /tsmpool/vol01.dsm formatsize=200
DEFINE VOLUME stg_ora vol01.dsm ACCESS=READWRITE
update node 'CLIENT1' MAXNUMMP= 1000
update devclass tsmdev mountlimit=10
EXPIRE INVENTORY
reclaim stgpool orapool
SPACE RECLAMATION
backup db devclass=tsm_dbbak type=full
grant authority admin classes=system
(2) 快速重复利用
如果用 q content命令查看某盘磁带上的备份内容后,认为这些备份数据都可以删除了,我们就能快速清空这盘磁带,使它可以被重复利用。
delete vol 00000002.BFS discarddata=yes
delete backup /dbbak/dbbak/ * -deltype=all -noprompt
--=======================
update copygroup oradomain ORAPOLICYSET ORAMGMTCLASS VERExists=1 VERDeleted=0 RETExtra=0 RETOnly=0
--=======================
DEFINE DEVCLASS tsm_dbbak DEVTYPE=FILE DIR=/tsmdbbak MOUNTLIMIT=10 MAXCAP=100m SHARED=no library=filelib
define stgpool backuppool tsm_dbbak MAXSCRatch=100
define schedule tsmdbbak type=administrative cmd="backup db devclass=tsm_dbbak type=full" active=yes starttime=13:30 period=1
--===========================
29.
显示某个节点所有备份文件的版本信息
dsmadmc:
select * from backups where node_name='CLIENT1'
select * from backups where node_name='ORA_CLIENT' and filespace_name='/dbbak' and ll_name='1_27169_718202824.dbf'
select ll_name from backups where node_name='ORA_CLIENT' and filespace_name='/dbbak' and state='INACTIVE_VERSION'
select state,count(*) from backups where node_name='ORA_CLIENT' and filespace_name='/dbbak' group by state
select state,ll_name,count(*) from backups where node_name='ORA_CLIENT' and filespace_name='/dbbak' group by state,ll_name
可以使用SQL语句对TSM自身的DB进行查询。
--===========================
备份:
tsm: >backup db type=full devclass=tsm_dbbak
备份数据写到定义的设备类当中。因为在定义文件设备类时需要指定文件目录,所以,DB
备份时将会写入该指定的文件夹中。还可以指定具体备份到哪一卷,但是不能使用存储池。因为一旦数据库损坏,是无法识别存储池的。
恢复:
1. 重新安装
tsm server
2.
将备份的最新的tsm的db、log和dsmserv.opt dsmserv.dsk, dsm.sys, dsm.opt devcnfg.out, volhist.out
配置文件拷贝回原来位置
3.
在/usr/Tivoli/tsm/server/bin下执行dsmserv命令:
dsmserv restore db devclass=filedev2 vol=95362738.dbf commit=yes
在进行数据库恢复时,若备份时采用的是文件设备类,此时需提前定义相同名字的文件设备类,并且要与原类定义时指
向同一文件夹。
--=========================
如何删除tsm db自身备份:
delete volhistory todate=today totime=now type=dbb
delete volhistory tpye=dbbackup todate=06/13/2014
delete volhistory type=dbb todate=06/14/2014 totime=13:30:22
--=========================
如何定义client端schedule:
define schedule oradomain client_dbbak type=client action=command objects="/home/oracle/dbbak/dbbak.sh" starttime=13:10 dayofweek=any
define sche MYSCHEDULE zlinux_hour act=command bjects="/opt/tivoli/tsm/client/domino/bin64/domdsmc_lotus0/domsel.sh" duration=3 durunits=minutes period=2 perunits=hour startt=now
DEFine ASSOCiation oradomain client_dbbak CLIENT1
update schedule oradomain client_dbbak starttime=20:50
--====================================
VERExists
Specifies the maximum number of backup versions to retain for files that are currently on the client file system. This parameter is optional.
If an incremental backup causes the limit to be exceeded, the server expires the oldest backup version that exists in server storage. Possible values are:
number
Specifies the number of backup versions to retain for files that are currently on the client file system. You can specify an integer from 1 to 9999.
NOLimit
Specifies that you want the server to retain all backup versions.
The number of backup versions to retain is controlled by this parameter until versions exceed the retention time specified by the RETEXTRA parameter.
VERDeleted
Specifies the maximum number of backup versions to retain for files that have been deleted from the client file system after being backed up using the server. This parameter is optional.
If a user deletes a file from the client file system, the next incremental backup causes the server to change the active backup version of the file to inactive and expire the oldest versions in excess of this number. The expiration date for the remaining versions is determined by the retention time specified by the RETEXTRA or RETONLY parameter. Possible values are:
number
Specifies the number of backup versions to retain for files that are deleted from the client file system after being backed up. You can specify a value from 0 to 9999.
NOLimit
Specifies that you want the server to retain all backup versions for files that are deleted from the client file system after being backed up.
RETExtra
Specifies the number of days that the server retains a backup version after that version becomes inactive. A version of a file becomes inactive when the client stores a more recent backup version, or when the client deletes the file from the workstation and then runs a full incremental backup. The server deletes inactive versions based on retention time even if the number of inactive versions does not exceed the number allowed by the VEREXISTS or VERDELETED parameters. This parameter is optional. Possible values are:
days
Specifies the number of days to retain inactive backup versions. You can specify an integer from 0 to 9999.
NOLimit
Specifies that you want to retain inactive backup versions indefinitely.
If you specify NOLIMIT, the server deletes extra backup versions based on the VEREXISTS parameter (when the file still exists on the client file system) or the VERDELETED parameter (when the file no longer exists on the client file system).
RETOnly
Specifies the number of days to retain the last backup version of a file that has been deleted from the client file system. This parameter is optional. Possible values are:
days
Specifies the number of days to retain the last remaining inactive copy of a file. You can specify an integer from 0 to 9999.
NOLimit
Specifies that you want to keep the last remaining inactive version of a file indefinitely.
If you specify NOLIMIT, the server retains the last remaining backup version forever, unless a user or administrator deletes the file from server storage.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/19602/viewspace-1253060/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/19602/viewspace-1253060/