
Installgen
Features and Benefits
Installgen
Demo Available for download...
Bookmark This Page

#! /usr/local/bin/perl
# program: prod3_rman_archivelog_backup_job.pl (renamed from 85_prod3_rman_archivelog_backup_job_1.pl)
# features: This script backs up archivelog files via RMAN
# and removes the archivelog files from the archivelog
# directory. This script is useful for situations
# in which the nightly full database RMAN backup
# will not occur soon enough to prevent the archivelog
# directory from filling up.
#
# Script Sequence#: 85
# Used By: run every 4 hours via AT scheduler
# Usage:
# ******** RMAN Backup of Archivelogs Every 4 Hours ********
# AT 00:00 /every:M,T,W,Th,F,S,Su c:\server_scripts\prod3_rman_archivelog_backup_job.pl
# AT 04:00 /every:M,T,W,Th,F,S,Su c:\server_scripts\prod3_rman_archivelog_backup_job.pl
# AT 08:00 /every:M,T,W,Th,F,S,Su c:\server_scripts\prod3_rman_archivelog_backup_job.pl
# etc...
#
# Copyright 2002 by .com Solutions Inc.
#
# --------------- Revision History ---------------
# Date By Changes
# 01-20-2002 dsimpson Initial Release
# 04-17-2002 dsimpson Added use of oem sid domain.
# 07-29-2002 dsimpson Corrected hard-coded Oracle SID for ENV variable.
# Removed unneeded RMAN setup commands.
# Set RMAN rate and maxpiecesize to avoid possible
# 2GB file size limitations on some systems.
# Simplified "system" call code.
# This output file was created by Installgen version 1.38 on Thu Nov 14 17:48:05 2002. By .com Solutions Inc. www.dotcomsolutionsinc.net
use strict;
use File::Copy;
# insure that environment variable is used by this perl script
$ENV{'ORACLE_SID'} = "PROD3";
my $tempsqlcode='';
my @proglist='';
my $temp_sql_filename="temp_sql.sql";
# start the rman backup
my $tempsqlcode=<<"EOF";
connect catalog rman/rmanpassword\@prod5.world
run {
allocate channel ch3 type Disk rate 1500K maxpiecesize = 1900M;
backup archivelog all
delete all input
format 'c:\\archive\\%d_archivelog_%s_%p.bak'
tag 'prod3_archivelog_4hr';
}
quit
EOF
open (FILE1,">$temp_sql_filename") || die ("Could not open output file $temp_sql_filename for writing.
Does the full directory path exist?");
print FILE1 ($tempsqlcode);
# close the output file
close (FILE1);
system ("c:\\v901\\bin\\rman.exe target / \@$temp_sql_filename");

