.com Solutions Inc. - logo  
Products - Header Buttons
.
Repgen bullet item 7b Installgen bullet item 7b FmPro Migratorbullet item 7b CGIScripter
.
.
.

.
.

Installgen - win901 - Title Graphic

Installgen Features and Benefits

Installgen Demo Available for download...

Bookmark This Page

email a friend

.

#! /usr/local/bin/perl
# script: c:\server_scripts\prod3_rotate_alert_log_1.pl
# (renamed from 11_win_prod3_rotate_alert_log_1.pl)
# Features: This perl script runs during system startup to rotate
# the Oracle alert.log file.
#
# Usage: Configured as service: OracleRotateAlertLogPROD3
# Copyright 2002 by .com Solutions Inc.
#
# ---------------------- Revision History ---------------
# Date By Changes
# 12-07-2001 dsimpson Created perl script version for use on Windows NT/2000 servers.
# 12-18-2001 dsimpson Corrected alert log name from alertSID.log to
# SIDalert.log format used on Windows for Oracle 9.0.1.
# Added Windows Service handling code.
# 12-27-2001 dsimpson Added ORACLE_SID environment variable
# 06-22-2002 dsimpson alert log filename gets changed appropriately depending
# upon whether Oracle 9.0.1 or 9.2.0 is used.

# 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 File::Find;
use Win32::Daemon;

my $file_to_rotate='';
my $State='';

# insure that environment variable is used by this perl script
$ENV{'ORACLE_SID'} = "PROD3";

Win32::Daemon::StartService();
while( SERVICE_STOPPED != ( $State = Win32::Daemon::State() ) )
{
if( SERVICE_START_PENDING == $State )
{
# Add initialization code here - rotating of alert.log file
# is done here because it only needs done once

# Rotate the Oracle alert error log - this is done during OS startup
# because rotating file does not work well with the database running.
$file_to_rotate="c:\\u01\\bdump\\alert_prod3.log";
rename ($file_to_rotate.".5",$file_to_rotate.".6");
rename ($file_to_rotate.".4",$file_to_rotate.".5");
rename ($file_to_rotate.".3",$file_to_rotate.".4");
rename ($file_to_rotate.".2",$file_to_rotate.".3");
rename ($file_to_rotate.".1",$file_to_rotate.".2");
rename ($file_to_rotate.".0",$file_to_rotate.".1");
rename ($file_to_rotate,$file_to_rotate.".0");

Win32::Daemon::State( SERVICE_RUNNING );
}
elsif( SERVICE_PAUSE_PENDING == $State )
{
# Add pausing code here
Win32::Daemon::State( SERVICE_PAUSED );
}
elsif( SERVICE_CONTINUE_PENDING == $State )
{
# Add resuming code here
Win32::Daemon::State( SERVICE_RUNNING );
}
elsif( SERVICE_STOP_PENDING == $State )
{
# Add stopping code here
Win32::Daemon::State( SERVICE_STOPPED );
}
elsif( SERVICE_RUNNING == $State )
{
# This is the core functionality of the service
# Add code here to perform whatever work the
# service must accomplish. Avoid any code that
# blocks for long durations of time
# stop the service after the 1st iteration - it does not need to run continuously
Win32::Daemon::StopService();
}
sleep( 5 );
}
Win32::Daemon::StopService();



.

hline

. .

.

. .
 

Home | Products | Services | Downloads | Order | Support | Contact

Legal Notices

.
.   .
.
Home Products Services Downloads Order Support Contact