Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
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