Re: perl connection "/ as sysdba" doesn't work for me on solaris



Tasm wrote:
I'm trying to connect "/ as sysdba" (without using a username or password) as the documentation says
http://search.cpan.org/dist/DBD-Oracle/Oracle.pm

I can connect as follows:

sqlplus '/ as sysdba'

but not using the following perl example from the same oracle account

$dsn = "dbi:Oracle:"; # no dbname here
$ENV{ORACLE_SID} = "orcl"; # set ORACLE_SID as needed
delete $ENV{TWO_TASK}; # make sure TWO_TASK isn't set
$dbh = DBI->connect($dsn, "", "", { ora_session_mode => ORA_SYSDBA });


The above perl results in the following error message:

DBI->connect failed: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin)

The DBA_AUDIT_TRAIL lists the failed logon username as OPS$ORACLE.

I'm trying this on Solaris 8 on a 8.1.7.4 database with the following version of perl -v

This is perl, v5.6.0 built for sun4-solaris

Whenever I use a username and password with my perl scripts I don't have a problem
; however, I would like to be able to connect without usernames and password in the same way as I can connect from sqlplus.

What is the business case for using perl to log in as SYS? This seems
like a violation of common-sense security procedures. What is it you are doing?

Oracle is making the assumption that you are trying to log in using an
externally authenticated account. Since the Solaris user is oracle it is prepending the OPS$.
--
Daniel A. Morgan
University of Washington
damorgan@xxxxxxxxxxxxxxxx
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
.



Relevant Pages

  • Re: SQLPlus with Perl
    ... I've been assigned a project involving SQLplus calls to an Oracle ... database within Perl code. ... now need to perform a select statement to check values in the database. ...
    (comp.lang.perl.misc)
  • Re: ANNOUNCE: DBD:Oracle 1.18
    ... Well a warning in one compiler is better than and error in an other so I ... This might be a problem more with the older oracle OCI in your client. ... perl -Mblib t/26exe_array.t ...
    (perl.dbi.users)
  • Re: DBD Oracle 1.20 ORA-24334 Error
    ... On the premise instant client and also tried to run perl Makefile.PL -V ... the status after having connected to Oracle ... Failed 2/33 tests, 93.94% okay ...
    (perl.dbi.users)
  • Re: float bug? perl 5.8, DBI and oracle 10.2.0
    ... If you want to store high precision numbers in oracle, you've got 38 decimal digits to play with, and with minimal coaxing perl will handle them as strings at the appropriate points so that the exact values go in and come out. ... I haven't done any numerical work in 10 years or so, but I seem to recall that one can reasonably expect 6 or so decimal significant digits from a 32 bit floating point number - I'll go out on a limb and hazard that one can expect 12 or so digits from a 64 bit floating point number - at any rate I'd be very surprised to get 18 significant digits. ...
    (perl.dbi.users)
  • RE: Memory fault(coredump) with two DBD type connections
    ... I get a core dump ... all the libraries are the same threaded model(single threaded perl uses ... I am running Perl 5.8.8 with DBD-Oracle 1.19 compiled against Oracle ... when I try to connect to the same Oracle database AND same DB2 database ...
    (perl.dbi.users)