cancel
Showing results for 
Search instead for 
Did you mean: 

DBI-Oracle

rgoud
Occasional Advisor

DBI-Oracle

Hi list,
#!C:\perl\ActivePerl\Perl\bin\perl -w

use DBI;
use strict;
my $dbh = DBI->connect( 'dbi:Oracle:db1',
'system',
'manager',
use strict;
my $dbh = DBI->connect( 'dbi:Oracle:agisdev.aegislimited.com',
'sys',
'yss98n',
{
RaiseError => 1,
AutoCommit => 0
}
) || die "Database connection not made: $DBI::
rstr";
#$dbh->trace(9);
my $sql = qq( select round((1-(phy.value / (cur.value + con.value)))
00,2) "% Ratio"
from v\$sysstat\ cur, v\$sysstat\ con, v\$sysstat\ phy
where cur.name = 'db block gets' and
con.name = 'consistent gets' and
phy.name = 'physical reads' );
my $sth = $dbh->prepare( $sql );
$sth->execute();

How do I fetch and print the result? result here will show number like 80.0%.
Thanks in advance