Results 1 to 20 of 20
  1. #1
    Member
    Join Date
    Aug 2006
    Location
    Estonia, Tallinn
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default RMAN not deleting old backups from TSM

    Hello,

    We have problem where RMAN is not deleting old backups from TSM db.

    TSM server version 6.1.3
    TDP client 5.3

    Here's the RMAN script which is runned every day. Also we have archive logs backup running once per hour.

    run {
    allocate channel t1 type 'sbt_tape' PARMS 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';

    backup
    format 'df_%t_%s_%p_%u_%c'
    (database);
    backup archivelog all delete all input format 'af_%t_%s_%p';
    backup current controlfile format 'cf_%d_%u';
    backup spfile;

    release channel t1;
    }
    allocate channel for maintenance device type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';

    crosscheck backup;
    delete noprompt expired backup;
    delete noprompt obsolete;
    crosscheck archivelog all;
    delete noprompt expired archivelog all;

    release channel;

    TSM info:
    vere=no limit, verd=0 rete=7 ret=0 backupdelete=yes

    we want to keep RMAN backups for 7 day.

    Anyone seeing anything wrong about this? Strange thing is that oracle dba is saying that he can see 7 day backups from RMAN. But i can see alot of old backups not deleted in tsm db. So DBA is saying theres something wrong with TSM and im saying theres something wrong with RMAN

    oracle dba is using "allocate channel for maintenance" to delete backups but IBM manual says "allocate channel for delete" oracle dba is saying it doesnt matter and if it does hes demanding explanation from me.

    Thank you!

  2. #2
    Senior Member
    Join Date
    Jun 2006
    Posts
    556
    Thanks
    0
    Thanked 15 Times in 14 Posts

    Default

    Hi

    You set wrong TSM policy. The policy must be:
    vere=1, verd=0 rete=0 ret=0
    All RMAN objects are ACTIVE object so it never expired from TSM.
    When you run delete noprompt expired backup and delete noprompt obsolete; RMAN delete ACTIVE object from TSM DB.

    Efim

  3. #3
    Member
    Join Date
    Aug 2006
    Location
    Estonia, Tallinn
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok i have set it to
    vere=1 verd=0 rete=0 ret=0 backupdelete=yes

    lets see how it goes tonight

  4. #4
    Member
    Join Date
    Aug 2006
    Location
    Estonia, Tallinn
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    still no luck

    TSM db still has all the old backups. How can i get it deleting older then 7 day backups as rman is deleting?

  5. #5
    Moderator moon-buddy's Avatar
    Join Date
    Aug 2005
    Location
    Somewhere in the US
    Posts
    5,903
    Thanks
    4
    Thanked 231 Times in 226 Posts

    Default

    Has "Expire Inventory" ran yet?
    Ed

  6. #6
    Member
    Join Date
    Aug 2006
    Location
    Estonia, Tallinn
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yep its running every morning

  7. #7
    Senior Member
    Join Date
    Apr 2007
    Location
    United States
    Posts
    450
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Did you setup your TDP node to allow delete of archive and backup? Do a query node <NODE-TDP> f=d and view the full setting.

  8. #8
    Senior Member GregE's Avatar
    Join Date
    May 2006
    Posts
    2,100
    Thanks
    9
    Thanked 17 Times in 16 Posts

    Default

    This is what Efim is referring to:
    http://publib.boulder.ibm.com/infoce...ab5w000250.htm

    What is your RMAN retention setting? (in RMAN, not in TSM)

    RMAN> show all;

    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 35 DAYS;

  9. #9
    Senior Member
    Join Date
    Dec 2009
    Location
    Sydney, Australia
    Posts
    384
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The only data RMan knows about is that which is in its catalog/control file. If RMan has already expired the objects from its catalog, but the inactivate failed (at the time) with TSM, then the two are out of sync.

    There is a utility called tdposync which can resync the two repositories - might be your best bet.

    T

  10. #10
    Member
    Join Date
    Aug 2006
    Location
    Estonia, Tallinn
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    All oracle backups are in active_version state. RMAN retention policy is set to 7 days and if DBA lists backups from RMAN he can see only 7 day backups but if i do
    "select * from backups where node_name='NODENAME' order by backup_date desc" in tsm i can see all backups still in ACTIVE_VERSION state.
    tdposync is not in use because oracle rman is not using catalog but controlfile. I'll talk about start using tdposync with dba.

    i understand that old backups wont go to inactive when they are already gone from RMAN controlfile but why new backups are not going to inactive state with the rman script above and tsm settings i have posted.

  11. #11
    Senior Member
    Join Date
    Jun 2006
    Posts
    556
    Thanks
    0
    Thanked 15 Times in 14 Posts

    Default

    Hi

    This is just points to check:

    1. Run dsmadmc -console
    2. Ask you Oracle admin to delete (oldest) backupset using command:
    change backupset 19 delete;
    During delete he must use the same environment as during backup ('ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
    3. During delete you can see connection to TSM (p.1)
    ANR0406I Session 91 started for node ORACLE_DB (TDPO Linux86) (Tcp/Ip 192.168.75.128(58460)).
    ANR0403I Session 91 ended for node ORACLE_DB (TDPO Linux86).
    4. After that use command:
    select * from backups where NODE_NAME='<nodename>'
    for check that state changed to INACTIVE_VERSION.
    5. You can see in RMAN log:
    allocated channel: ORA_MAINT_SBT_TAPE_1
    channel ORA_MAINT_SBT_TAPE_1: sid=14 devtype=SBT_TAPE
    channel ORA_MAINT_SBT_TAPE_1: Data Protection for Oracle: version 5.5.2.0

    deleted backup piece
    backup piece handle=DB.20100121_21_1_0ll414gs_1_1.bkp recid=19 stamp=708874782
    Deleted 1 objects

    P.S In your script you save control files to TSM.
    During disaster you can't restore those files from TSM without those files
    you can use script like this:

    sqlplus '/as sysdba' <<EOF >> //<path>/backup_log.log
    alter database backup controlfile to '//<path>/ctlfile.ctl';
    exit
    EOF

    and after that backup or archive control file + spfile using BA Client

    Efim

  12. #12
    Member crooked's Avatar
    Join Date
    Feb 2008
    Location
    North West England
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    When you registered the node did you setup backdel=yes ?

    This is required to enable rman to remove the data.

  13. #13
    Member
    Join Date
    Aug 2006
    Location
    Estonia, Tallinn
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    if we do it manually like Efim said i can see backups going to inactive_version state but it is not working with script running at night.

  14. #14
    Senior Member
    Join Date
    Jun 2006
    Posts
    556
    Thanks
    0
    Thanked 15 Times in 14 Posts

    Default

    Quote Originally Posted by putukas View Post
    if we do it manually like Efim said i can see backups going to inactive_version state but it is not working with script running at night.
    It means that you have correct TSM configuration.
    Now you have guide how to troubleshoot TDP for Oracle.

    Efim

  15. #15
    Senior Member
    Join Date
    Dec 2006
    Location
    northern front-range Colorado, USA
    Posts
    600
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    tdposync is the correct way to hunt down extra backups.
    BTW:rete won't keep them from being deleted by RMAN. They're not being marked expired - they're being deleted.
    If your DBAs dig in their heels and refuse to learn to use tdposync, get a printout of all the RMAN objects for all the nodes, then select NODE_NAME, FILESPACE_NAME, HL_NAME, LL_NAME, and OBJECT_ID from BACKUPS for just the nodes and filespaces in question, and remove the objects the DBAs say should be there, recheck the list for oddities, and use delete object on the object ids that should not be there. I have to do that every few months... deleted 17TB last time around.

  16. #16
    Member
    Join Date
    Aug 2006
    Location
    Estonia, Tallinn
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    rman is still not deleting it's backups from TSM db and im kinda clueless. I'll paste the RMAN scripts we are using atm. Maybe someone of you can find bugs in it.

    Code:
    Full backup, this is command runned by tivoli every night.
    
    $ cat /usr/tivoli/tsm/client/oracle/sched/schedbkdb.scr
    #!/bin/ksh
    su oracle -c /opt/app/oracle_php/oracle/scripts/backup_sched.scr
    
    $ cat /opt/app/oracle_php/oracle/scripts/backup_sched.scr
    #!/bin/ksh
    . /home/oracle/.oraprofile_php
    rman target rmanbackup/rmanbackup@php_dedicated cmdfile /opt/app/oracle_php/oracle/scripts/backup.scr msglog /opt/app/oracle_php/oracle/scripts/logs/backup.log
    
    $ cat backup.scr
    run {
    allocate channel t1 type 'sbt_tape' PARMS 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
    
    backup
    format 'df_%t_%s_%p_%u_%c'
    (database);
    crosscheck archivelog all;
    backup archivelog all delete all input format 'af_%t_%s_%p'; sql "alter database backup controlfile to ''/php_flash/oradata/php/backupset/controlfile_backup_binary.ctl'' reuse"; sql "alter database backup controlfile to trace as ''/php_flash/oradata/php/backupset/controlfile_backup_human.ctl'' reuse"; backup current controlfile format 'cf_%d_%u'; backup spfile format 'spf_%d_%u';
    
    release channel t1;
    }
    allocate channel for delete device type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
    
    crosscheck backup;
    delete noprompt obsolete;
    
    release channel;
    And this is for archive logs runned every hour.
    Code:
    $ cat /usr/tivoli/tsm/client/oracle/sched/schedbkarch.scr
    #!/bin/ksh
    su oracle -c /opt/app/oracle_php/oracle/scripts/backup_archsched.scr
    
    $ cat /opt/app/oracle_php/oracle/scripts/backup_archsched.scr
    #!/bin/ksh
    . /home/oracle/.oraprofile_php
    rman target rmanbackup/rmanbackup@php_dedicated cmdfile /opt/app/oracle_php/oracle/scripts/backup_arch.scr msglog /opt/app/oracle_php/oracle/scripts/logs/backup_arch.log
    
    $ cat /opt/app/oracle_php/oracle/scripts/backup_arch.scr
    run {
    allocate channel t1 type 'sbt_tape' PARMS  'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
    
    backup archivelog all not backed up format 'af_%t_%s_%p'; sql "alter database backup controlfile to ''/php_flash/oradata/php/backupset/controlfile_backup_binary.ctl'' reuse"; sql "alter database backup controlfile to trace as ''/php_flash/oradata/php/backupset/controlfile_backup_human.ctl'' reuse"; backup current controlfile format 'cf_%d_%u';
    
    release channel t1;
    }

  17. #17
    Member
    Join Date
    Aug 2007
    Posts
    128
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    i do this as a manual process... but will be scripted soon.

    1. allocate channel for maint.
    2. resync catalog
    3. delete force noprompt obsolete

  18. #18
    Member
    Join Date
    Aug 2006
    Location
    Estonia, Tallinn
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    my backups are now deleting. Im not sure what dba did. Only thing he told he changed is that he separated backup deleting script from main rman script.

  19. #19
    Member
    Join Date
    May 2006
    Posts
    198
    Thanks
    3
    Thanked 6 Times in 5 Posts

    Default

    Quote Originally Posted by putukas View Post
    Hello,
    Oracle dba is using "allocate channel for maintenance" to delete backups but IBM manual says "allocate channel for delete" oracle dba is saying it doesnt matter and if it does hes demanding explanation from me.
    I was wondering the same thing.

    I am looking at a similar problem. Many Oracle TDP clients that should have 30 day backup retention but when I search through the backup table I find backups going back years. It looks like rman is deleting any reference to backups older than 30 days in it's catalog, but this is never communicated to TSM.

    The last two lines of the rman script are:

    allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
    delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
    exit;

  20. #20
    Newcomer
    Join Date
    Feb 2010
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by putukas View Post
    my backups are now deleting. Im not sure what dba did. Only thing he told he changed is that he separated backup deleting script from main rman script.
    Hello,

    I am encounter the same problem. RMAN still unable to delete all the old backup set. TSM still detect Active state for the old RMAN Backup set.
    Any advice on this?

    Thanks,
    zack

Similar Threads

  1. Replies: 5
    Last Post: 05-06-2013, 02:23 AM
  2. deleting aix backups of tsm db files
    By wesd in forum TSM Database
    Replies: 3
    Last Post: 05-30-2008, 12:12 PM
  3. Deleting unreferenced TDPO RMAN objects
    By n9hmg in forum TDP/Application Layer Backup
    Replies: 4
    Last Post: 03-19-2008, 09:33 AM
  4. Deleting old Inactive Backups
    By rdavila in forum TDP/Application Layer Backup
    Replies: 7
    Last Post: 05-03-2007, 05:05 PM
  5. Oracle backups to TSM via rman
    By sdmartin1 in forum TDP/Application Layer Backup
    Replies: 2
    Last Post: 07-17-2003, 08:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •