The problem you are having is most likely due to your
use of v$session_connect_info.  Getting your own sessions
SID and using it to choose the correct row from v$session_connect_info
is notoriously tricky.

Try doing this instead:

my $sql=q{select sys_context('userenv', 'authentication_type') auth_type from 
dual};
my $sth = $dbh->prepare($sql);
$sth->execute;
my ($authtype) = $sth->fetchrow;
print "Authtype: $authtype";

$sth->finish;

HTH,

Jared

On Thursday 19 December 2002 01:21, Georg Botorog wrote:
> Hi,
>
> I have the following trivial piece of code:
>
> use DBI           ;
> use DBD::Oracle   ;
> use strict        ;
>
> my $db   = "..." ;
> my $usr  = "..."         ;
> my $pwd  = "..."      ;
> my $mode = 2             ;
>
> my $dbh = DBI->connect ("dbi:Oracle:".$db, $usr, $pwd, {ora_session_mode
> => $mode}) ;
> ...
> $dbh->disconnect ;
>
> However, the connect is not done "as sysdba", but normally. I know this,
> because:
> 1. if the DB is shut down, then I get ORA-1034 ("Oracle not available")
> 2. if the DB is open, then the column AUTHENTICATION_TYPE of the view
> V_$Session_Connect_Info
>    has the value "DATABASE" (as with normal logins) for the given
> session, instead of "OS" (as with "as
>    sysdba" connects)
>
> What am I doing wrong?
>
> I use Perl 5.6.1, DBI 11.3, and DBD::Oracle 1.80.
>
> Thanks
> G. Botorog

Reply via email to