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

#! /usr/local/bin/perl
# script: prod3_import_stats_day_job_1.pl (renamed from 57_win_920_prod3_import_stats_day_job_1.pl)
# Features: This perl script configures Oracle CBO statistics to use
# the stats gathered during daytime processing.
#
# Note: If ORA-20003 occurs, check the status of the stats with:
# SELECT STATID,C1,C2,C3 FROM SYSSTATS;
#
# Script Sequence#: 57
# Used By: run automatically via AT scheduler
# Usage:
# ******** Import daytime Oracle CBO stats weekdays daily at 5:00AM ********
# AT 05:00 /every:M,T,W,Th,F c:\server_scripts\prod3_import_stats_day_job_1.pl
# Copyright 2002 by .com Solutions Inc.
#
# ---------------------- Revision History ---------------
# Date By Changes
# 12-22-2001 dsimpson Initial Release
# 12-27-2001 dsimpson Added ORACLE_SID environment variable
#
# 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;
# insure that environment variable is used by this perl script
$ENV{'ORACLE_SID'} = "PROD3";
my @proglist = '';
my $tempsqlcode="";
my $temp_sql_filename="temp_sql.sql";
my $tempsqlcode=<<"EOF";
connect / as SYSDBA
set echo on
set feedback on
set verify on
set pagesize 24
exec dbms_stats.import_system_stats(stattab =>'sysstats', statown =>'SYS', statid =>'day');
exit;
EOF
open (FILE1,">$temp_sql_filename") || die ("Could not open output file $temp_sql_filename for writing. \n Does the full directory path exist?");
print FILE1 ($tempsqlcode);
# close the output file
close (FILE1);
@proglist = ("c:\\v901\\bin\\sqlplus.exe /nolog \@$temp_sql_filename");
system (@proglist);

