This discussion is archived
10 Replies Latest reply: Jan 18, 2013 1:53 AM by SurinderSingh RSS

delete backup archive

864103 Newbie
Currently Being Moderated
Hi all ,

oracle 11g.2 ASM RAC under RHEL 5

we use HP DATA Protector to make a backed to TAPE

but now i need to remove the backup from tape :

the below script not work :
 run {
2>  allocate channel 'dev_0' type 'sbt_tape'
3> parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=MEDI,OB2BARLIST=Mediation DB Whole Online - Archive Delete)';
4> DELETE ARCHIVELOG ALL COMPLETED BEFORE "sysdate-3";
5> }
i use the first 3 line to backed up but no i need to delete it ???


the below is a result of delete command :
allocated channel: dev_0
channel dev_0: SID=256 instance=MEDI2 device type=SBT_TAPE
channel dev_0: Data Protector A.06.11/243

released channel: dev_0
thanks
  • 1. Re: delete backup archive
    Mihael Pro
    Currently Being Moderated
    but now i need to remove the backup from tape :

    the below script not work :
    run {
    2>  allocate channel 'dev_0' type 'sbt_tape'
    3> parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=MEDI,OB2BARLIST=Mediation DB Whole Online - Archive Delete)';
    4> DELETE ARCHIVELOG ALL COMPLETED BEFORE "sysdate-3";
    5> }
    use "list backup" to see what backup you need to delete, notice "tag";
    then use "delete backup tag ..."
  • 2. Re: delete backup archive
    JohnWatson Guru
    Currently Being Moderated
    You are launching a tape channel, and then trying to delete archive log files. That cannot work: it is impossible for archive log files to exist on a tape device. Archive logs will always be on disc, it is only backup sets that can go to tape.
  • 3. Re: delete backup archive
    864103 Newbie
    Currently Being Moderated
    yes i speak on backup of archive redo log files in TAPE


    RMAN> run {
    2> allocate channel 'dev_0' type 'sbt_tape'
    3> parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=MEDI,OB2BARLIST=Mediation DB Whole Online - Archive Delete)';
    4> delete backup tag "TAG20130114T033039";
    5> }


    thanks
  • 4. Re: delete backup archive
    JohnWatson Guru
    Currently Being Moderated
    861100 wrote:
    yes i speak on backup of archive redo log files in TAPE


    RMAN> run {
    2> allocate channel 'dev_0' type 'sbt_tape'
    3> parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=MEDI,OB2BARLIST=Mediation DB Whole Online - Archive Delete)';
    4> delete backup tag "TAG20130114T033039";
    5> }

    This looks better.
    Your archive logfiles exist only on disk, so to delete them launch a disk channel.
    To delete the backup sets on tape that contain the archive logfiles, something like the above command should do.
  • 5. Re: delete backup archive
    TSharma-Oracle Guru
    Currently Being Moderated
    Use this;

    DELETE ARCHIVELOG ALL COMPLETED BEFORE "sysdate-3" to device type sbt;
  • 6. Re: delete backup archive
    Mihael Pro
    Currently Being Moderated
    DELETE ARCHIVELOG ALL COMPLETED BEFORE "sysdate-3" to device type sbt;
    correctly so :

    delete BACKUP OF ARCHIVELOG all COMPLETED BEFORE "sysdate-3" device type sbt;
  • 7. Re: delete backup archive
    864103 Newbie
    Currently Being Moderated
    thanks guys for your support.
  • 8. Re: delete backup archive
    864103 Newbie
    Currently Being Moderated
    Hi guys , i executed this command means open channel with tape and then delete the backup completed before and delete the obsolete backup ,
    by apply this command :
     run {
     allocate channel 'dev_0' type 'sbt_tape'
     parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=MEDI,OB2BARLIST=Mediation DB Whole Online - Archive Delete)';
     delete BACKUP OF ARCHIVELOG all COMPLETED BEFORE "sysdate-30" device type sbt;
    }
    
    and 
    run {
     allocate channel 'dev_0' type 'sbt_tape'
     parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=MEDI,OB2BARLIST=Mediation DB Whole Online - Archive Delete)';
     delete obsolete;
    }
    but hen i check the tape it's with the same size ????why????
  • 9. Re: delete backup archive
    Mihael Pro
    Currently Being Moderated
    Hi guys , i executed this command means open channel with tape and then delete the backup completed before and delete the obsolete backup ,
    by apply this command :
    run {
    allocate channel 'dev_0' type 'sbt_tape'
    parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=MEDI,OB2BARLIST=Mediation DB Whole Online - Archive Delete)';
    delete BACKUP OF ARCHIVELOG all COMPLETED BEFORE "sysdate-30" device type sbt;
    }
    
    and 
    run {
    allocate channel 'dev_0' type 'sbt_tape'
    parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=MEDI,OB2BARLIST=Mediation DB Whole Online - Archive Delete)';
    delete obsolete;
    }
    but hen i check the tape it's with the same size ????why????
    What is the output of above commands and how you determine free space on tape ?
  • 10. Re: delete backup archive
    SurinderSingh Newbie
    Currently Being Moderated
    Scan the tape using tape utility & recheck

    Regards
    Surinder Singh

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points