免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1564 | 回复: 0
打印 上一主题 下一主题

对tdp的一些思考 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-04-07 16:13 |只看该作者 |倒序浏览
主要是想通过何种方式解决数据类备份是保留版本的问题。
在完成对oracle备份的简单设置后,oracle对版本的保留是通过rman来实现,
list backupset后的显示:
List of Backup Sets
Key     Recid      Stamp      LV Set Stamp  Set Count  Completion Time
------- ---------- ---------- -- ---------- ---------- ----------------------
81      4          554907723  0  554907639  5          06-APR-05
    List of Backup Pieces
    Key     Pc# Cp# Status      Completion Time        Piece Name
    ------- --- --- ----------- ---------------------- ------------------------
    82      1   1   AVAILABLE   06-APR-05              05gh6dvn_1_1
    List of Datafiles Included
    File Name                                  LV Type Ckp SCN    Ckp Time
    ---- ------------------------------------- -- ---- ---------- -------------
    1    /dev/rorasystem                       0  Full 146063     06-APR-05
    2    /dev/roratools                        0  Full 146063     06-APR-05
    3    /dev/rorarbs                          0  Full 146063     06-APR-05
    4    /dev/roratemp                         0  Full 146063     06-APR-05
    5    /dev/rorauser                         0  Full 146063     06-APR-05
    6    /dev/roraindex                        0  Full 146063     06-APR-05
    7    /dev/roraliming                       0  Full 146063     06-APR-05
    8    /dev/roraundo                         0  Full 146063     06-APR-05
    9    /tsmdata/rman_ts.dbf                  0  Full 146063     06-APR-05
删除其中backupset number是81的文件集:
RMAN> allocate channel for maintenance type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: delete
RMAN-08500: channel delete: sid=19 devtype=SBT_TAPE
RMAN-08526: channel delete: Tivoli Data Protection for Oracle: version 2.2.0.0
RMAN> change backupset 81 delete;
RMAN-03022: compiling command: change
RMAN-03023: executing command: DELETE
RMAN-08073: deleted backup piece
RMAN-08517: backup piece handle=05gh6dvn_1_1 recid=4 stamp=554907640
RMAN-03023: executing command: partial resync
RMAN-08003: starting partial resync of recovery catalog
RMAN-08005: partial resync complete
RMAN> release channel;
RMAN-03022: compiling command: release
RMAN-03023: executing command: release
RMAN-08031: released channel: delete
察看已经备份的oracle的版本信息:
tsm: TSM>q content test filespace=/test
Node Name                    Type     Filespace      Client's Name for File               
                                      Name           
------------------------     ----     ----------     --------------------------------------
H50                          Bkup     /test          // test                              
H50                          Bkup     /test          // 02gh66hb_1_1                       
H50                          Bkup     /test          // 03gh695a_1_1                       
H50                          Bkup     /test          // 04gh6crk_1_1                       
H50                          Bkup     /test          // 05gh6dvn_1_1
因没有手动过期操作,tsm server还没来得及察看到过期状态,因此手动执行过期操作,操作完成后的状态如下:
tsm: TSM>expire inventory
ANS8003I Process number 145 started.
tsm: TSM>q content test filespace=/test
Node Name                    Type     Filespace      Client's Name for File               
                                      Name           
------------------------     ----     ----------     --------------------------------------
H50                          Bkup     /test          // test                              
H50                          Bkup     /test          // 02gh66hb_1_1                       
H50                          Bkup     /test          // 03gh695a_1_1                       
H50                          Bkup     /test          // 04gh6crk_1_1     
某些时候用户需要将某些版本拿到磁带库外进行保存,在这种情况下需要将rman和tdp参数设置结合来实现:
备份时还发现了分配channel时常出问题,原因不明。
我在一个备份任务中分配了两个channel,结果出错:
RMAN> run{
2> allocate channel h1 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
3> backup full database;
4> release channel h1;
5> allocate channel h2  type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
6> backup current controlfile;
7> release channel h2;}
RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: h1
RMAN-08500: channel h1: sid=22 devtype=SBT_TAPE
RMAN-08526: channel h1: Tivoli Data Protection for Oracle: version 2.2.0.0
RMAN-03022: compiling command: backup
RMAN-03023: executing command: backup
RMAN-08008: channel h1: starting full datafile backupset
RMAN-08502: set_count=10 set_stamp=554911324 creation_time=06-APR-05
RMAN-08010: channel h1: specifying datafile(s) in backupset
RMAN-08522: input datafile fno=00003 name=/dev/rorarbs
RMAN-08522: input datafile fno=00004 name=/dev/roratemp
RMAN-08522: input datafile fno=00008 name=/dev/roraundo
RMAN-08522: input datafile fno=00007 name=/dev/roraliming
RMAN-08522: input datafile fno=00001 name=/dev/rorasystem
RMAN-08011: including current controlfile in backupset
RMAN-08522: input datafile fno=00002 name=/dev/roratools
RMAN-08522: input datafile fno=00005 name=/dev/rorauser
RMAN-08522: input datafile fno=00006 name=/dev/roraindex
RMAN-08522: input datafile fno=00009 name=/tsmdata/rman_ts.dbf
RMAN-08013: channel h1: piece 1 created
RMAN-08503: piece handle=0agh6his_1_1 comment=API Version 2.0,MMS Version 2.2.0.0
RMAN-08525: backup set complete, elapsed time: 00:01:27
RMAN-03023: executing command: partial resync
RMAN-08003: starting partial resync of recovery catalog
RMAN-08005: partial resync complete
RMAN-03022: compiling command: release
RMAN-03023: executing command: release
RMAN-08031: released channel: h1
RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03007: retryable error occurred during execution of command: allocate
RMAN-07004: unhandled exception during command execution on channel h2
RMAN-10035: exception raised in RPC: ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-19557: device error, device type: SBT_TAPE, device name:
ORA-21117: Message 21117 not found;  product=RDBMS; facility=ORA
Additional information: 2
Additional information: 537560280
RMAN-10031: ORA-19624 occurred during call to DBMS_BACKUP_RESTORE.DEVICEALLOCAT
是否是只有一个带机?
涉及到的内容有两块:在rman中删除备份版本时候如何设置将哪些版本过期,在veritas中似乎是通过备份保本保留的方式来删除较早的版本,在tsm中主要是通过rman来进行删除,这样需要察看到这些备份保留版本的日期一起判断所在的backupset;另一方面为了将这版本和其他版本所在磁带区分开,最好是将这个版本的备份保留在不同的磁带上,这样也就是备份到指定的管理类上,对管理类的处理我们需要做的是在备份时候做好策略域和节点名的对应。   
刚才做了一个测试,是在tsm中使用语句将dsm.sys修改,然后在tsm中将该节点的策略域修改,备份没有问题。
对备份版本的处理想到了使用shell来获取数据,这个测试将接下来做。
对过期的处理,可以通过select(spool)保存到某个文本,awk,sed获取到相应脚本,while read line来将这些编号写到文本中,rman再调用删除即可。
#!/bin/sh
echo "sqlplus
[email=rman_us/rman_us@rman]rman_us/rman_us@rman[/email]
/tmp/test2
echo "select bs_key from bs where bck_type='D' and incr_level is null;">>/tmp/test2
echo "exit">>/tmp/test2
su - oracle -c /tmp/test2>/tmp/liming.txt
# more test2
sqlplus
[email=rman_us/rman_us@rman]rman_us/rman_us@rman[/email]
/tmp/raws
raws=`wc -l /tmp/raws|awk '{print $1}'`
rrr=1
while read line;do
echo fdjlsfjdljfl;jfkdjfad>dj#将这些字段输入到指定的文本中,rman再调用这些文本经可以删除这些记录了。
done

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/895/showart_20102.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP