三、 TSM 进程管理 1. 启动TSM Server #/usr/tivoli/tsm/server/bin/dsmserv quiet & 2. 启动TSM Client #/usr/tivoli/tsm/client/ba/bin/dsmcad 3. 停止TSM Server #/usr/tivoli/tsm/server/bin/dsmadmc(输入提示的用户、口令) dsmadmc>;halt 4. 停止TSM Client 通过ps –ef|grep dsmcad 查找出对应的PID,然后通过kill命令停止进程。 四、 TSM软件配置 1. 在操作系统检查磁带库设备硬件 #lsdev –Cc tape(会看到rmtx和smc0 的状态为Avaliable),如不能看到则需要安装3583磁带库的驱动程序,具体安装方法请参见3583相关资料。 2. 磁带库配置 A、使用tapeutil找到Driver的element值#tapeutil B、选择“open a device”:/dev/smc0 C、选择“elements Information”,就可以得到Driver和Slots的elements值。 E、定义磁带库 define library autolib libtype=scsi(定义一个名字为autolib的SCSI磁带库)。 F、定义磁带库的PATH(定义TSM SERVER名为TSM所连的接磁带库autolib在TSM SERVER中的设备PTAH:/dev/smc0)。 define path tsm autolib srctype=server desttype=library device=/dev/smc0 online=yes G、定义磁带机(Driver)(定义磁带库autolib中的磁带机,磁带机的名字叫做 driver01)。 define drive autolib drive01 element=256 H、定义磁带机(Driver)的PATH(定义TSMSERVER名为TSM所连接的磁带库autolib中的磁带机在TSM SERVER中的设备PATH)。 define path tsm drive01 srctype=server desttype=drive library=autolib device=/dev/rmt0 online=yes I、定义设备CLASSES define devclass ltotape devtype=lto library=autolib format=ultriumc mountlimit=drives mountretention=5 estcapacity=200G J、检查磁带库的相关配置 query library、query driver、query path、query devclasses K、定义磁带存储池 define stgpool 3583_pool ltotape maxscratch=20(定义ltotape设备类使用的磁带存储池3583_pool)。 3. 调整TSM DB 和LOG空间的大小 define dbvolume /tsmdata/dblog/db01.dsm formatsize=160 wait=yes extend db 160 dfine logvloume /tsmdata/dblog/log01.dsm formatsize=100 wait=yes extend log 100 define spacetrigger db fullpct=85 spaceexpansion=25 expansionprefix=/tsmdata/dblog/ define spacetrigger log fullpct=85 spaceexpansion=25 expansionprefix=/tsmdata/dblog/ reduce db 16 reduce log 8 delete dbvolume /usr/tivoli/tsm/server/bin/db.dsm delete logvolume /usr/tivoli/tsm/server/bin/log.dsm 安装TSM SERVER时默认的db和log的大小分别是16,8MB。 4. 备份策略的设置 Storage management policies are rules your administrator defines in order to manage your backups and archives on the server(Storage managermanet policies是管理员为了在服务端管理备份和归档定义的一种规则)。You can associate (or bind) your data to these policies(你能够绑定你的数据到这些Policies);when the data is backed up or archived, it is managed according to policy criteria(当数据被备份或归档被相应Policy标准管理)。Policy criteria include a policy domain, and a management class ,a policy set, a copy group。 policy决定了是否一个文件或目录适合备份或归档、保留多少个备份版本、非激活状态的备份和归档拷贝保留多长时间、拷贝存放在何处。 Policy daemon是一组有相类似备份或归档需求数据的客户机的集合(A policy domain is a group of clients with similar requirements for backing up and archiving data.)。Policy domains contain one or more policy sets。 A policy set is a group of one or more management classes。 A management class is a collection of backup and archive copy groups that establishes and contains specific storage management requirements for backing up and archiving data. Within a management class, the specific backup and archive requirements are in copy groups. Copy groups define the specific storage management attributes that describe how the server manages backed up or archived data. Copy groups include both backup copy groups and archive copy groups. A management class can have one backup copy group, one archive copy group, both, or neither。 A、 创建备份 client node B、 通过WEB方式建立Policy daemon,选择object class/Policy daemon/define a Policy daemon C、 选择Policy daemon下面的.Policy sets/define a policy sets,并将policy set给Active D、 选择Policy sets下面的ManageClass/define a manageclass E、 选择ManagClass下面的Copy Group F、 将Client node分配到相应的Policy daemon 5. 6. 五、 文件系统备份 六、 RMAN的配置 安装一套独立与生产数据库之外的ORACLE数据库作为catalog database,最好安装在不同的主机上。 1. 在catalog数据库服务器上创建RMAN所需要的表空间 $svrmgrl svrmgrl>;connect system/manager svrmgrl>;create tablespace rman_ts datafile ‘;/;’ >;size 100M autoextend on next 100M maxsize 300M; 2. 创建RMAN用户并赋予角色及权限 svrmgrl>;create user rman identified by rman >;default tablespace rman_ts >;temporary tablespace temporary >;quota unlimited on rman_ts; svrmgrl>;grant recovery_catalog_owner to rman; svrmgrl>;connect / as sysdba; svrmgrl>;grant dba,connect,resource to rman; 3. 创建recovery catalog的表结构 $rman target internal/oracle@targetSID rcvcat rman/rman@recoverycatalogSID rman>;create catalog; 4. 在catalog数据库中对目标数据库进行注册 rman>;register database; 七、 ORACLE数据库的备份 Database备份script: run { allocate channel d1 type 'sbt_tape' connect 'internal/manager@scdb2' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)'; allocate channel d2 type 'sbt_tape' connect 'internal/manager@scdb1' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)'; backup format 'ctl_t%t_s%s_p%p' tag cf (current controlfile); backup full filesperset 8 format 'db_t%t_s%s_p%p' tag fulldb (database); release channel d1; release channel d2; } Archivelog的备份script: run { allocate channel d1 type 'sbt_tape' parms ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)' connect 'internal/manager@scdb1'; sql 'alter system archive log current'; backup format 'arch_t%t_s%s_p%p' (archivelog like '/jfbackup/arch_log/arch_1_%.arc' delete input); release channel d1; }
run { allocate channel d2 type 'sbt_tape' parms ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)' connect 'internal/manager@scdb2'; sql 'alter system archive log current'; backup format 'arch_t%t_s%s_p%p' (archivelog like '/jfbackup/arch_log/arch_2_%.arc' delete input); release channel d2; } 同时还可以对指定的tablespace datafile进行备份,具体请参见RMAN相关手册。 手工执行ORACLE的备份: rman target internal/oracle@targetSID rcvcat rman/rman@recoverycatalogSID cmdfile=/xxx/xxx msglog=xxx.log 八、 ORACLE数据库的恢复 run { allocate channel d3 type 'sbt_tape' connect 'internal/manager@scdb1' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)'; allocate channel d4 type 'sbt_tape' connect 'internal/manager@scdb2' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)'; restore controlfile; alter database mount; restore database; recover database; release channel d1; release channel d2; sql "alter database open resetlogs"; } 九、 Twelve Steps to Configuring Your Tsm Environment
1、 Install the TSM code on the machine that will be your TSM server (referred to as server).This process may involve a few steps that are dependent on your platform type.Please read the Quick Start Guide and REAMES for yout platform. 2、 At the install time you had created default DB and LOG volumes.Now you want to supportment or replace that initial configuration. A、 Add additional DB volumes.i.e. def dbv filename f=volsize Note:make sure they are on separate physical disks form other DB vols,LOG vols or mirrors of their LOGs or DBs. B、 Extend the data base to use the newly added space.i.e ext db 100 C、 Add additional LOG volumes,i.e.def logv filename f=volsize Notice:Same rules apply for LOG volumes as DB volumes. D、 Extend the log to use the newly added space.i.e ext log 100 E、 You may have to delete the default volumes that were created during install,i.e del dbv filename or del log filename Notice:You may have to reduce the DB or LOG in order to delete the volume i.e.reduce db 16 3、 Now configure you dsmserv.opt file.Read though the default file.There are serval values you may wish to set or adjust. A、 Set yout COMMMethods and there related attributes B、 Set VOLHISTORY and DEVCONFIG,remember make 2 copies C、 Set EXPInterval 0,this will disable expiration.You will have a admin schedule take care of this D、 Set various performance releated attributes,i.e. TCPNODELAY,TCPWindowsize,MAXSessions,BUFPoolsize,LOGPoolsize,TXNGroupmax.etc E、 To use the Web Admin Client set COMMM tcpip,HTTPPort 1580,1580 is the default port number 4、 Now you must defined the Libraries,Drivers and Device Classes your system will use A、 You must define libraries frist.Both manual and automated libraries can be defined,i.e.manual –def lib manlib libtype=manual or automated –def lib autolib libtype=scsi device=dec_spec B、 Now define drives in your libraries,i.e manual –def dr manlib mandr device=dec_spec or def dr autolib autodriv1 device=dec_spec element=element# C、 Now we can create device classes.You can have more than 1 device class use the same library if yoy like.Notelease refer to the documentation for def dev command.There are many options available. 5、 Once we have Device Classes we can create Storage Pools that will use them,also,we must establish or SP hierarchy. A、 Determine the number of top level pools you will need.They will typically be Disk based SPs B、 Next decide on the hierarchy from the top levels to the final pools.Make sure you consider things like:Backup vs Archive data,Collocation,Offsite (copy pools) vs Local.etc. C、 Create the necessary storage pools with the appropriate attributes.In particular consider,the valus for migration,reclamation and next storage pool as they will also affected by your administrative schedules.Nore: Please consult the documentation for the def stg command.There are many options available. 6、 Nextt you right create Policy Domian(s) and right Policy that is reflective of your Service Level Agreement(SLA). A、 Determine how you will group your manages systems.i.e.1 Policy Domain or several. B、 Create you policy domain(s).Note:The following steps will be repeated for each Policy domain ü def do mydomain ü def po mydomain myposet ü def mg mydomain myposet mymc Note:Create as many Management Classes as necessary. ü def co mydomain myposet mymc standard type=backup… ü def co mydomain myposet mymc standard type=archive… Note:above two lines are optional for any given Management Class ü as defmg mgname ü val po mydomain myposet ü act po mydomain myposet Note:Each of the above steps have many options,especially the def co commands,so please consult the documentation 7、 You probably want to go home at night so lets define some client schedules.Please remember client schedules are within a given Policy Domain,therefore you may want to right a schedule once and copy it to different domains if necessary. A、 Create a schedule to do your nightly Incremental backups.Your clients Domain and Include/Exclude list should be written so that all that is need in the schedule is just I with no file specification given. B、 Right any other schedules that maybe appropriate for you needs.Note:def sch command has several options,so please consult the documentation. 8、 The server will need some schedules as well.The followingis just a list of some things you should consider for scheduling.This is not intend to be a complete list nor do I attempt to make a 24 hour plan.The timings will depand entirely on your environment.There is a good example of a 24 hour schedule plan in the “Getting Statrted with Tivoli Storage Manager:Implementation Guide”. A、 migration,reclamation,expiration,DB Backups, SPs Backups,Clean Volhist, backup Volhist and Devconfig,DRM B、 Consider the time and order to do these things,in general do one things at a time,backup the DB after large changes C、 Remember to allow down time in your schedule.That is time when nothing is scheduled,so you can catch up if needed 9、 There are just a few other miscellaneous server function left. A、 Create your client option sets.these are client options that you are going to override at the server. ü Define one or more client option sets.i.e.def clo ntclients ü Next define the various options for each client option set.i.e.def cliento ntclients compress no B、 Add any additional administrators thal you will need,i.e.server admins,help desk workers,operators,etc. ü reg admin jradmin jrpasswd ü grant auth jradmin… Note:Consult the documentation for all the extra options. C、 Label and checkin tape media.For NT,W2K and UNIX you can use the label libvol command. 10、 Now it is time at register you managed system(refereed to as clients). A、 Things to consider at registration time,what domain and client option set to associate them with. B、 reg node node_name node_password domain= domain_name clopset=ntclients C、 This must be done for every managed system,consider scripting it if you have a large number of clients. D、 You must associate the node with the schedules you would like it to use.i.e.def assoc domain schedule node Note:You can only associate nodes to schedules within their domain 11、 The managed system(clients) must have the client code installed.Consult the “Installing the Clients Guide” for details on the different platforms that you will be using. 12、 Once the clients are installed you will need to update the dsm.opt file and the dsm.sys(unix only) file. A、 Select a(just one)COMMMethod and configure any associated parms for that method,i.e.COMMM tcpip,TCPPort 1500,TCPServer server.dot.decimal.addr B、 Configure schedule log,error log and their retention time,i.e.SCHEDLOGName dsmsched.log,SCHEDLOGRetention 10,ERRORLOGName dsmerr.log C、 Set performance related attributes.Consult the documentation for appropriate values for your environment,i.e.TCPB,TCPW,TXNB,etc. D、 Configure you Domain and Include/Exclude statements.The goal here is to eliminate those files you do not wish to backup and to bind particular files to a specific Management Class. E、 Insure that the dsmc sched program runs either as a service or a daemon when the client is rebooted. F、 Set passwordaccess generate This will allow the scheduler to authenticate automatically. G、 Configure the client to be accessed through the web client interface. ü This will vary from platform to platform so please consult the Installing the Clients manual. ü In general,you will need to have the TSM client acceptor service/daemon running. ü TSM Client Acceptor service/daemon is generally started at boot time. ü Passwordaccess generate is required in the dsm.opt(dsm.sys for unix) file.
Storage Pool Name Description Media Access Status Maximum Size Threshold Next Storage Pool High Migration Threshold Low Migration Threshold Cache Migrated Files? YES NO Migration Processes Migration Delay Migration Continue YES NO Copy Storage Pool(s) Continue Copy on Error? YES NO CRC Data YES NO
使用tapeutil查找3583 drive的element号 1.# tapeutil 2. 选:“1. Open a Device”,输入device名称:/dev/smc0 3.选:“12. Element Information”,便可查找到drive的element号。 一般来说第一个drive的element号为256
定义库 select object view ->; server storage ->; Libraries and Drives ->; Automated Libraries ->; Operations: ->; Define Automated Library library name : 3583 device: /dev/smc0
定义驱动器 驱动器一: select object view ->; server storage ->; Libraries and Drives ->; Automated Drives ->; Operations: ->; Define Automated Drive Library Name 3583 Drive Name 3583_drive1 Device /dev/rmt1 Element 256 ( 256 just for 3583 drive 1, you should find out element information via tapeutil ) Device On-Line YES NO Cleaning Frequency (Gigabytes/ASNEEDED/NONE) 驱动器二: define second drive select object view ->; server storage ->; Libraries and Drives ->; Automated Drives ->; Operations: ->; Define Automated Drive Library Name 3583 Drive Name 3583_drive2 Device /dev/rmt2 Element 257 ( you should find out element information via tapeutil ) Device On-Line YES NO Cleaning Frequency (Gigabytes/ASNEEDED/NONE)
定义LTO设备类 For 3583: select object view ->; server storage ->; Device Classes ->; LTO Device Classes ->; Operations: ->; Define Device Class Device Class Name 3583_Class Recording Format Drive Library Name 3583 Mount Limit DRIVES Mount Retention 60 Tape Volume Prefix ADSM Estimated Capacity Mount Wait 60
tsm: BRAZIL>;def domain api_domain DESC='DO for all DB-Backups' ANR1500I Policy domain API_DOMAIN defined. tsm: BRAZIL>;
tsm: BRAZIL>;def policyset api_domain api_policy DESC='PO for all DB Backups' ANR1510I Policy set API_POLICY defined in policy domain API_DOMAIN.
tsm: BRAZIL>;def mgmtclass api_domain api_policy api_mgmtclass DESC='MC for all DB-Backups' ANR1520I Management class API_MGMTCLASS defined in policy domain API_DOMAIN, set API_POLICY. tsm: BRAZIL>;
以下为建立拷贝副本组,需注意选项值: tsm: BRAZIL>;def copygroup api_domain api_policy api_mgmtclass type=archive DEST=api_disk retver=nolimit ANR1535I Archive copy group STANDARD defined in policy domain API_DOMAIN, setAPI_POLICY, management class API_MGMTCLASS.
tsm: BRAZIL>;def copygroup api_domain api_policy api_mgmtclass type=backup DEST=api_disk_ vere=1 verd=0 rete=0 reto=0 ANR1530I Backup copy group STANDARD defined in policy domain API_DOMAIN, set API_POLICY, management class API_MGMTCLASS.
TDP for Oracle客户端安装 smit安装以下软件包: tivoli.tsm.client.api.aix43.64bit tivoli.tsm.client.oracle.64bit tivoli.tsm.client.oracle.tools.64bit
编辑tdpo.opt文件: 在/usr/tivoli/tsm/client/oracle/bin/目录下新建文件tdpo.opt *************************************************************************** * Tivoli Storage Manager - Tivoli Data Protection for Oracle * * Sample tdpo.opt for the AIX TDP for Oracle *********************************************************************