ADSM-L

Re: [ADSM-L] how to delete old oracle backups at the tsm server

2011-03-22 03:32:32
Subject: Re: [ADSM-L] how to delete old oracle backups at the tsm server
From: Grigori Solonovitch <Grigori.Solonovitch AT AHLIUNITED DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 22 Mar 2011 10:28:52 +0300
I am using next script:

#!/bin/sh
#
# Cross-check Recovery Catalog and TSM database
#
# Input parameters:
#   1 - database SID.
#
export ORACLE_SID=$1
export ORACLE_HOME=`grep "$1:" /etc/oratab | head -n1 | cut -f2 -d":"`
export PATH=$ORACLE_HOME/bin:$PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin
#
#######################################################################
# Remove expired datafiles, control files and archived redo log files #
#######################################################################
rman <<EOF
#
# Connect to Recovery Catalog database
connect catalog $RC_USER/$RC_PASSWORD@$RC_SERVICE;
#
# Connect to target database
connect target;
#
# Allocate channel for maintenance
allocate channel for maintenance type 'sbt_tape' parms
        'ENV=(TDPO_OPTFILE=/home/oracle/admin/tdpo/$1.opt)';
#
# Set date and time format
sql 'alter session set NLS_DATE_FORMAT = "YYYY-MM-DD:HH24:MI:SS"';
#
# Resynchronize catalog
resync catalog;
#
# List database incarnations
list incarnation;
#
# List backups
list backup summary;
#
# Crosscheck backups
crosscheck backup;
#
# List expired backups
list expired backup summary;
#
# Delete expired backups
delete noprompt expired backup;
#
# Delete obsolete backups
delete noprompt obsolete;
#
# Release channel
release channel;
#
# Allocate channel for maintenance
allocate channel for maintenance type disk;
#
# Check archived logs on disk
crosscheck archivelog all;
#
# Remove obsolete archived redo logs
delete noprompt expired archivelog all;
#
# Release channel
release channel;
#
exit;
EOF

exit 0

It is for AIX, but maybe it will help you, at least in RMAN part of script.

Grigori G. Solonovitch


-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf Of 
TSM
Sent: Tuesday, March 22, 2011 9:29 AM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: [ADSM-L] how to delete old oracle backups at the tsm server

Hello,

We use tdp for oracle with no catalog database.
We set the oracle parameter control_file_record_keep_time too low.
So the "delete obsolete" removed nothing, because oracle removed the
entries earlier from the controlfiles.

Now we have to delete a lot of oracle backups at the tsm server, which
oracle doesn't know.
Any ideas how to delete the old backups?

Thanks in advance
Andreas.


Please consider the environment before printing this Email.

CONFIDENTIALITY AND WAIVER: The information contained in this electronic mail 
message and any attachments hereto may be legally privileged and confidential. 
The information is intended only for the recipient(s) named in this message. If 
you are not the intended recipient you are notified that any use, disclosure, 
copying or distribution is prohibited. If you have received this in error 
please contact the sender and delete this message and any attachments from your 
computer system. We do not guarantee that this message or any attachment to it 
is secure or free from errors, computer viruses or other conditions that may 
damage or interfere with data, hardware or software.