Professional Web Applications Themes

Oracle DBI - PERL Beginners

Hi! I'm a starter with this subject. my script is: use strict; use DBI; my $dbh = DBI->connect( 'dbi:Oracle:orcl', 'blah', 'blah',)|| die "Database connection not made: $DBI::errst r"; $dbh->disconnect(); when trying to run this i get an error: DBI->connect(APPS1) failed: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin) at dbi.pl line 4 But my user name/password are correct, i've checked that. Is it something to do with shell variables or stuff? Ant....

  1. #1

    Default Oracle DBI

    Hi!

    I'm a starter with this subject.

    my script is:
    use strict;
    use DBI;

    my $dbh = DBI->connect( 'dbi:Oracle:orcl', 'blah', 'blah',)|| die
    "Database connection not made: $DBI::errst
    r";
    $dbh->disconnect();

    when trying to run this i get an error:
    DBI->connect(APPS1) failed: ORA-01017: invalid username/password; logon
    denied (DBD ERROR: OCISessionBegin) at dbi.pl line 4

    But my user name/password are correct, i've checked that.

    Is it something to do with shell variables or stuff?


    Ant.



    Anton Arhipov Guest

  2. #2

    Default Re: Oracle DBI

    In article <3FB0B683.8040902hot.ee>,
    [email]tonyfox24hot.ee[/email] (Anton Arhipov) writes:
    >Hi!
    >
    >I'm a starter with this subject.
    >
    >my script is:
    >use strict;
    >use DBI;
    >
    >my $dbh = DBI->connect( 'dbi:Oracle:orcl', 'blah', 'blah',)|| die
    >"Database connection not made: $DBI::errst
    >r";
    >$dbh->disconnect();
    >
    >when trying to run this i get an error:
    >DBI->connect(APPS1) failed: ORA-01017: invalid username/password; logon
    >denied (DBD ERROR: OCISessionBegin) at dbi.pl line 4
    >
    >But my user name/password are correct, i've checked that.
    How? And have you put them literally between the single quotes,
    or did you try escaping any characters?

    Does yor ORACLE_HOME environment variable point to the right place?
    Do you have a tnsnames.ora that designates the right Oracle
    nameserver?

    --
    Peter Scott
    [url]http://www.perldebugged.com/[/url]
    *** NEW *** http//www.perlmedic.com/
    peter@PSDT.com Guest

  3. #3

    Default Re: Oracle DBI

    I'm struggling with the DBI too, one of the things that my book says is
    that you can create config files the DBI will use. Is it possible that
    you have an Oracle config file (perhaps stored by your sysadmin) that is
    giving the DBI the wrong ideas?

    -Dan

    On Tue, 2003-11-11 at 05:14, Anton Arhipov wrote:
    > Hi!
    >
    > I'm a starter with this subject.
    >
    > my script is:
    > use strict;
    > use DBI;
    >
    > my $dbh = DBI->connect( 'dbi:Oracle:orcl', 'blah', 'blah',)|| die
    > "Database connection not made: $DBI::errst
    > r";
    > $dbh->disconnect();
    >
    > when trying to run this i get an error:
    > DBI->connect(APPS1) failed: ORA-01017: invalid username/password; logon
    > denied (DBD ERROR: OCISessionBegin) at dbi.pl line 4
    >
    > But my user name/password are correct, i've checked that.
    >
    > Is it something to do with shell variables or stuff?
    >
    >
    > Ant.
    >
    >
    >
    Dan Anderson Guest

  4. #4

    Default Re: Oracle DBI


    On Tuesday, Nov 11, 2003, at 14:50 US/Pacific, Dan Anderson wrote:
    [..]
    > I'm struggling with the DBI too, one of the things that my book says is
    > that you can create config files the DBI will use. Is it possible that
    > you have an Oracle config file (perhaps stored by your sysadmin) that
    > is
    > giving the DBI the wrong ideas?
    [..]

    One way to think about this that stack of
    environmental variables, peter had mentioned.

    The user may have those in their '.cshrc' or '.bashrc'
    and hence able to do 'the right thing' from the command line.
    But one will need to make sure that the 'code' gets them as
    well. Hence having a config file that will be read only
    and in a well known place can help make sure that one
    has them defined and stuffed into the

    $ENV{'ORACLE_HOME'}

    etc, etc, etc....

    ciao
    drieux

    ---

    Drieux Guest

  5. #5

    Default Re: Oracle DBI

    No panic anymore. I was given a wrong database schema. Everything works
    fine now.

    Ant.

    Dan Anderson wrote:
    >I'm struggling with the DBI too, one of the things that my book says is
    >that you can create config files the DBI will use. Is it possible that
    >you have an Oracle config file (perhaps stored by your sysadmin) that is
    >giving the DBI the wrong ideas?
    >
    >-Dan
    >
    >On Tue, 2003-11-11 at 05:14, Anton Arhipov wrote:
    >
    >
    >>Hi!
    >>
    >>I'm a starter with this subject.
    >>
    >>my script is:
    >>use strict;
    >>use DBI;
    >>
    >>my $dbh = DBI->connect( 'dbi:Oracle:orcl', 'blah', 'blah',)|| die
    >>"Database connection not made: $DBI::errst
    >>r";
    >>$dbh->disconnect();
    >>
    >>when trying to run this i get an error:
    >>DBI->connect(APPS1) failed: ORA-01017: invalid username/password; logon
    >>denied (DBD ERROR: OCISessionBegin) at dbi.pl line 4
    >>
    >>But my user name/password are correct, i've checked that.
    >>
    >>Is it something to do with shell variables or stuff?
    >>
    >>
    >>Ant.
    >>
    >>
    >>
    >>
    >>
    >
    >
    >
    >


    Anton Arhipov Guest

  6. #6

    Default Re: Oracle DBI

    Hello,

    This is a follow-up to the DBI question:

    I'm using Oracle 10g Enterprise Release 10.2.0.4.0 on a Windows 2003 Server

    I have a user called EXTRACT and am attempting to use perl DBI to connect via the network to update the EXTRACT tables.

    From my Win 7 workstation I can open a sqlplus session (sqlplus extract/passworddatabase). This works fine.

    But, when using a perl script, it fails for "invalid userid/password":

    print "start of pr\n";
    use DBI;
    use DBD::Oracle qw(:ora_session_modes);
    my $DBUSER = "extract";
    my $DBPASS = "password";

    my $database = 'extract';
    my $DSN = "dbi:Oracle:$database";
    my $dbh = DBI->connect( $DSN,
    $DBUSER,
    $DBPASS, {
    PrintError=>1,###Report errors via warn() to the screen
    RaiseError=>1,##Do report errors via die()
    AutoCommit =>0## disable autocommit
    })
    || die( $DBI::errstr . "\n" );


    Any ideas are appreciated...

    Mark
    Unregistered Guest

Similar Threads

  1. Replies: 2
    Last Post: April 11th, 03:47 PM
  2. #13053 [Com]: oci8 error, this kill oracle-prosseces in the oracle-instance.
    By gid at gifpaste dot net in forum PHP Development
    Replies: 0
    Last Post: November 20th, 06:51 PM
  3. Replies: 0
    Last Post: August 6th, 02:54 PM
  4. #24950 [Com]: Compiling PHP --with-oci8 --with oracle (Oracle 9i) fails
    By cunha17 at uol dot com dot br in forum PHP Development
    Replies: 0
    Last Post: August 5th, 11:27 PM
  5. Replies: 0
    Last Post: January 2nd, 10:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139