Leopold,

        Here are two scripts I have developed for deleting the Oracle
backups on my AIX 4.3.3 platforms.  The second one is just the RMAN report
script called from the script that does the deletion.


                 <<RMAN-del-obj.smp>>  <<RMAN-report-obj.smp>>


        Gary L. Ison
        Governor's Office for Technology
        101 Cold Harbor Drive
        Frankfort, Ky.   40601
        Phone:  (502) 564-8724
            Fax:  (502) 564-6856
E-mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

-----Original Message-----
From:   Leopold Hameder [SMTP:[EMAIL PROTECTED]]
Sent:   Thursday, August 17, 2000 9:51 AM
To:     [EMAIL PROTECTED]
Subject:        Re: AW: Oracle Agent

Here is a script I've found in another Newsgroup. It helps to automatically
delete your old backups.

Timo Kilchenmann schrieb:

There is no logic in RMAN for

> automatically deleting old backups. So you must write your own scripts
which
> do this (by RMAN commands).
>

 Subject: A SQL script to delete old backup with rman

  RDBMS Version: 8.1.5
  Operating System and Version: Sun Solaris 2.6 , AIX 4.3

  A SQL script to delete old backup with rman

  Normally, if You have to delete old backup from rman catalog, You have to
issue the rman-command 'list backup' in order to find the    backuppiece and
the

  command 'change backuppiece xxxx delete'.
  In order to avoid to manually extract a lot of backuppiece and delete it,
you
can use this simple script.
  This SQL script must be executed with sqlplus connected to rman database:
  col handle for a30
  set echo off
  set verify off
  set feedback off
  set heading off
  set pagesize 0
  spo delete_backup.cmd;
  select 'connect target;' from dual;
  select 'allocate channel for delete type ''SBT_TAPE'';' from dual;
  select 'change backuppiece '''||handle||''' delete;'
  from rc_backup_piece a, rc_database b
  where a.db_key=b.db_key and
  status ='A' and
  completion_time < SYSDATE-20 and
  b.name='MYDB';
  select 'release channel;' from dual;
  spool off;
  exit;
  As you can see, it dynamically generate another script ready to be run
with
rman. You have only to customize the date (SYSDATE-20) and the DB-name
  (MYDB). After execution of rman you should execute also the script
prgrmanc.sql, but remember that in some version of this script there is a
bug.
  Best regards.
  Guido Vetere.

--
With Regards / Mit freundlichen Gruessen

Leopold Hameder

c.a.r.u.s. InformationsSysteme AG
Borsteler Chaussee 49
22453 Hamburg
Tel.: +49 40 514 35 - 0
Fax: +49 40 514 35 - 111
E-Mail: mailto:[EMAIL PROTECTED]
WWW: http://www.carus.de

RMAN-del-obj.smp

RMAN-report-obj.smp

Reply via email to