ADSM-L

Re: [ADSM-L] AUto Sync of TDP backup and RMAN catalog

2013-01-17 23:55:04
Subject: Re: [ADSM-L] AUto Sync of TDP backup and RMAN catalog
From: Grigori Solonovitch <Grigori.Solonovitch AT AHLIUNITED DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Fri, 18 Jan 2013 07:48:15 +0300
Hello,
Maybe I do not understand your request, but I will try to give you some 
solution.

To enable automatic retention in RMAN catalog you need to set recovery window 
for each database (in my case it is for Oracle instance ifns and 31 DAYS is a 
recovery window, which has to be in sync with TSM retention period for the same 
database):
#!/bin/sh
#
export ORACLE_SID=ifns
export ORACLE_BASE=/home/oracle
export ORACLE_HOME=`grep "ifns:" /etc/oratab | head -n1 | cut -f2 -d":"`
export PATH=$ORACLE_HOME/bin:$PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin
#
# Configure backup policy
rman <<EOF
#
# Connect to Recovery Manager Catalog Database
connect catalog $RC_USER/$RC_PASSWORD@$RC_SERVICE;
#
# Connect to target database
connect target;
#
# Set retention policy
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 31 DAYS;
#
# Set compression mode
#CONFIGURE DEVICE TYPE sbt_tape BACKUP TYPE TO COMPRESSED BACKUPSET;
#
EOF
exit

In addition, you need to run  daily RMAN crosscheck for each database, 
something like this (key command in this script is "crosscheck backup":
#!/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

After implementing this solution I never use tdposync except some crazy cases.
Kindest regards,

Grigori G. Solonovitch
Senior Technical Architect  Ahli United Bank Kuwait  www.ahliunited.com.kw

Please consider the environment before printing this E-mail

-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf Of 
Lakshminarayanan, Rajesh
Sent: 18 01 2013 6:21 AM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: [ADSM-L] AUto Sync of TDP backup and RMAN catalog

Hi,



    We have been backing the Oracle db to TSM through TDP api.  And we have 
been syncing the RMAN catalog and TSM through  "TDPOSYNC" command manually.



     Just want to check with you, it there a way to automate this process and 
has any one tired it before.

Regards,

Rajesh Lakshminarayanan


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.

<Prev in Thread] Current Thread [Next in Thread>