ADSM-L

Re: [ADSM-L] RMAN Options Unix

2012-06-09 04:50:39
Subject: Re: [ADSM-L] RMAN Options Unix
From: Grigori Solonovitch <Grigori.Solonovitch AT AHLIUNITED DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Sat, 9 Jun 2012 11:44:34 +0300
Just some comments about RMAN expiration process:
1) you need to register each database in RMAN catalog;
2) just to be sure you need to set recovery window for each database as oracle 
owner user (for example, to have 31 day recovery window):

#!/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;
#
EOF

3) perform some daily purging for each database like:

#!/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
#
# Backup database, archived logs and control file
rman <<EOF
#
# Connect to Recovery Manager Catalog Database
connect catalog $RC_USER/$RC_PASSWORD@$RC_SERVICE;
#
# Connect to target database
connect target;
#
# To maintain backups
run {
#
# Allocate channel for maintenance
allocate channel for maintenance type 'sbt_tape' parms
        'ENV=(TDPO_OPTFILE=/home/oracle/admin/tdpo/$1.opt)';
#
# Report unrecoverable data files
report unrecoverable database;
#
# Report data files required backup according to retention policy
report need backup database;
#
# Report number of redundant backups
report need backup redundancy 7 database;
#
# Report number of incremental backups
report need backup incremental=0 database;
#
# Delete obsolete backups
delete noprompt obsolete;
#
# Release TSM channel
release channel;
#
exit
EOF

4) periodically run cross-check procedure against RMAN and TDPO:

#!/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

So, everything is not very simple, but after correct configuration everything 
is working fine for many years.
Good luck!

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 
Remco Post
Sent: 08 06 2012 11:47 PM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Re: [ADSM-L] RMAN Options Unix

Hi,

you definitely don't need any excludes.

normally you don't need any includes, only if you need some special management 
class for some databases, because they go into another storage pool, will you 
need any. R/man manages expiration for all log archives and all backups.

On 8 jun. 2012, at 20:36, Huebner,Andy,FORT WORTH,IT wrote:

> We are setting up our first Oracle RMAN nodes.
> The part we are not sure about are the include and excludes.  Are there any 
> include and excludes we should use?  These are AIX and x86 Linux Oracle 
> servers.
>
> Andy Huebner
>
>
> This e-mail (including any attachments) is confidential and may be legally 
> privileged. If you are not an intended recipient or an authorized 
> representative of an intended recipient, you are prohibited from using, 
> copying or distributing the information in this e-mail or its attachments. If 
> you have received this e-mail in error, please notify the sender immediately 
> by return e-mail and delete all copies of this message and any attachments.
>
> Thank you.

--
Met vriendelijke groeten/Kind Regards,

Remco Post
r.post AT plcs DOT nl
+31 6 248 21 622


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.