-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcheck_environment.pl
More file actions
75 lines (61 loc) · 1.94 KB
/
Copy pathcheck_environment.pl
File metadata and controls
75 lines (61 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/local/bin/perl -w
print <<EOT;
This next Section displays some of the Oracle Settings currently set in your environment, it then
gathers some system information.
EOT
if ( ! $ENV{"ORACLE_HOME"} ) {
print "Oracle Home has not been set !! \n";
exit(1);
} else {
print "Oracle Home is set to \t : $ENV{ORACLE_HOME} \n";
}
if ( ! $ENV{"ORACLE_SID"} ) {
print "Oracle SID has not been set !! \n";
exit(1);
} else {
print "Oracle SID is set to \t : $ENV{ORACLE_SID} \n";
}
if ( ! $ENV{"ORACLE_BASE"} ) {
print "Oracle BASE has not been set !! \n";
exit(1);
} else {
print "Oracle Base is set to \t : $ENV{ORACLE_BASE} \n";
}
$tns = $ENV{ORACLE_HOME};
$alertlog = $ENV{ORACLE_BASE};
$sid = $ENV{ORACLE_SID};
$tnsfile = "${tns}/network/admin/tnsnames.ora";
$listenerfile = "${tns}/network/admin/listener.ora";
$oratab = '/etc/oratab';
$alert_log = "${alertlog}/admin/${sid}/bdump/alert_${sid}.log";
print LOGFILE "open(INFO, $tnsfile)";
@lines = <INFO>;
close(INFO);
print @lines;
open(INFO, $listenerfile);
@lines = <INFO>;
close(INFO);
print @lines;
open(INFO, $oratab);
@lines = <INFO>;
close(INFO);
print @lines;
system ("uname -a");
system ("df -k");
warn "alert log is old!\n"
if -M $alert_log > 10;
warn "alert was last modified\n";
-C $alert_log;
use English; # Let us say "$CHILD_ERROR" instead of "$?", etc.
use strict; # Enforce strict variables, refs, subs, etc.
use File::Basename();
use lib &File::Basename::dirname($PROGRAM_NAME) . "/perl_modules";
# Command.pm initializes the command set and associated attributes.
use Command();
#my $copyright = "\nOracle Interim Patch Installer version " .
# &Command::version . "\n" .
# &Command::copyright . "\n";
#opatchIO -> print_message_noverbose ( { message => $copyright } );
my $current_perl = $EXECUTABLE_NAME;
my $current_name = $PROGRAM_NAME;
## End of Script