Dbd Error Ocisessionbegin Perl
Contents |
Q&A Tutorials Poetry RecentThreads NewestNodes Donate What'sNew on Aug 05, 2009 at 09:28UTC ( #786017=perlquestion: print w/replies, xml ) Need Help?? laminee has asked for the wisdom of the Perl Monks perl dbi connect oracle service name concerning the following question: Hi Monks, I am trying to replicate
Ora-01017: Invalid Username/password; Logon Denied (dbd Error: Ocisessionbegin)
the sqlplus '/as sysdba' connection using DBI and DBD::Oracle by following the guidelines from http://search.cpan.org/~pythian/DBD-Oracle-1.23/Oracle.pm#Connect_Attributes. My tnsnames.ora dbi connect dbi oracle is like this: #Generated tnsnames.ora by gen_tnsnames.sh script #Localnode service connectivity ABCD12.COMPANYDOMAIN.COM = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = testserver24.companydomain.co +m )(PORT = 30710))
Perl Dbd Oracle
) (CONNECT_DATA = (INSTANCE_NAME = ABCD12) (SERVICE_NAME = ABCD12.COMPANYDOMAIN.COM) ) ) [download] and I have no problem connecting with the usual sqlplus '/as sysdba'. I am doing the following in my script: use DBI; use DBD::Oracle qw(:ora_session_modes); my $dsn = "dbi:Oracle:"; #$ENV{ORACLE_SID} = "ABCD12"; $ENV{ORACLE_SID} = "ABCD12.COMPANYDOMAIN.COM"; delete $ENV{TWO_TASK}; my $dbh = DBI->connect($dsn, "", "", { ora_session_mode => ORA_SYSDBA +}); [download] and getting the error: DBI connect('','',...) failed: ORA-12545: Connect failed because targe +t host or object does not exist (DBD ERROR: OCIServerAttach) [download] Specifying ORACLE_SID with/without the domain name doesn't change the error message. I have checked that $TNS_ADMIN is defined and the host name is present in /etc/hosts. What am I doing wrong here? Thanks, AniComment on Connecting 'as sysdba' using DBD::OracleSelect or Download Code Replies are listed 'Best First'. Re: Connecting 'as sysdba' using DBD::Oracle by tweetiepooh (Friar) on Aug 05, 2009 at 11:08UTC Try $dsn = "dbi:Oracle:ABCD12"; [download] and make sure that sqlnet.ora has NAMES.DEFAULT_DOMAIN = COMPANYDOMAIN.COM [download] [reply][d/l][select] Re^2: Connecting 'as sysdba' using DBD::Oracle by laminee (Novice) on Aug 05, 2009 at 11:38UTC With $dsn = "dbi:Oracle:DS8CC2"; [download] or $dsn = "dbi:Oracle:DS8CC2.ORACLEOUTSOURCING.COM"; [download] the error becomes DBI connect('DS8CC2','',...) failed: ORA-01031: insufficient privilege +s (DBD ERROR: OCISessionBegin) [download] and DBI connect('DS8CC2.ORACLEOUTSOURCING.COM','',...) failed: ORA-01031: +insufficient privileges (DBD ERROR: OCISessionBegin) [download] respectively. But as I mentioned, there's no issue while connecting
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Perl DBI connecting to Oracle 12c up vote 0 down vote favorite I'm http://www.perlmonks.org/index.pl?node_id=786017 using Perl DBI & trying to connect to Oracle 12c. I get an error: DBI connect('host=serverip;sid=comms;port=1521','comms',...) failed: ORA-28040: No matching authentication protocol (DBD ERROR: OCISessionBegin) My connection is: DBI->connect($connectionString, $user, $passwd,{PrintError=>1, RaiseError=>1, AutoCommit=>1}) Would like to know if DBI can connect to Oracle 12c? Should I change to use something else? Am new to Perl, so any help very much appreciated. Thank You. oracle perl dbi oracle12c share|improve this question http://stackoverflow.com/questions/28935996/perl-dbi-connecting-to-oracle-12c asked Mar 9 '15 at 5:58 njihan 313 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote accepted Seems like an issue with the sqlnet.ora file. The parameters might not be same for the sqlnet.ora file in the client-side and server-side. Since you have not posted all the details, there could be more than one issue. however, the most common is the SQLNET.ALLOWED_LOGON_VERSION. Read the Database Net Services Reference documentation for more details on Parameters for the sqlnet.ora File. share|improve this answer answered Mar 9 '15 at 6:27 Lalit Kumar B 26.9k82547 Thank you for your reply. Added SQLNET.ALLOWED_LOGON_VERSION = 8 & able to connect now. –njihan Mar 9 '15 at 7:52 You're welcome. Thanks for the feedback. –Lalit Kumar B Mar 9 '15 at 7:54 add a comment| up vote 0 down vote The connection string is always of the form: "dbi:Oracle:" There are several ways to identify a database: If the database is local, specifying the SID or service name will be enough. If the database is defined in a TNSNAMES.ORA file, you can use the service name given in the file To connect without TNSNAMES.ORA file, you can use an EZCONNECT url, of the form: //host[:port][/service_na
= DBI->connect( "dbi:Oracle:orcl", "SYS", "sys", {ora_session_mode =>ORA_SYSDBA,RaiseError => 1,AutoCommit => 0 })or die "Can't open orcl database: $DBI::errstr"; my $dbh = DBI->connect( "dbi:Oracle:orcl", "SYS", "sys", {RaiseError http://ora10gadmin.blogspot.com/2013/03/dbi-connectorclsys-failed-ora-28009.html => 1,AutoCommit => 0 })or die "Can't open $db_name database: $DBI::errstr"; https://books.google.com/books?id=ZxEL-FO4u7wC&pg=PA237&lpg=PA237&dq=dbd+error+ocisessionbegin+perl&source=bl&ots=6ew2tfiFb9&sig=trzXxDGShG1qvmRc8bUspK_BA5w&hl=en&sa=X&ved=0ahUKEwjpycrGmL7PAhVjpIMKHcHHANwQ6AEIVDAH Error Msg: DBI connect('orcl','sys',...) failed: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER (DBD ERROR: OCISessionBegin) Solution: Use the below updated script to connect oracle DB using Perl (SYSDBA role): #!/usr/bin/perluse strict ; use DBI;use Getopt::Long qw(:config no_ignore_case);#use DBD::Oracle qw(ora_session_modes);my $dbh = DBI->connect( "dbi:Oracle:orcl", "SYS", dbd error "sys", {ora_session_mode =>2,RaiseError => 1,AutoCommit => 0 })or die "Can't open $db_name database: $DBI::errstr";my $sth = $dbh->prepare( "SELECT * FROM dba_tables" ) or die "Can't prepare SQL statement: $DBI::errstr\n"; ### Execute the statement in the database $sth->execute or die "Can't execute SQL statement: $DBI::errstr\n"; ### Retrieve the returned rows of data my @row; while ( @row = $sth->fetchrow_array( ) ) dbd error ocisessionbegin { print "Row: @row\n"; } warn "Data fetching terminated early by error: $DBI::errstr\n" if $DBI::err;$dbh->disconnect or warn "Error disconnecting: $DBI::errstr\n"; exit; Posted by sumit Tyagi at 11:23 Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: Perl-OCI Newer Post Older Post Home Subscribe to: Post Comments (Atom) About Me sumit Tyagi View my complete profile Blog Archive ► 2016 (29) ► Oct (1) ► Sep (6) ► Aug (1) ► Jul (6) ► May (4) ► Mar (9) ► Jan (2) ► 2015 (73) ► Dec (5) ► Nov (1) ► Oct (3) ► Sep (4) ► Aug (3) ► Jul (9) ► Jun (7) ► May (8) ► Apr (7) ► Mar (12) ► Feb (7) ► Jan (7) ► 2014 (33) ► Dec (22) ► Nov (8) ► Aug (1) ► May (1) ► Jan (1) ▼ 2013 (21) ► Nov (1) ► Sep (1) ► Jul (2) ► May (1) ► Apr (2) ▼ Mar (6) Do You Have a Wait Problem? Maximize the Data Up-Load Performance in Oracle Tablespace usage report (w/ autoextend)
from GoogleSign inHidden fieldsBooksbooks.google.com - Secrets of the Oracle Database is the definitive guide to undocumented and partially-documented features of the Oracle Database server. Covering useful but little-known features from Oracle Database 9 through Oracle Database 11, this book will improve your efficiency as an Oracle database administrator...https://books.google.com/books/about/Secrets_of_the_Oracle_Database.html?id=ZxEL-FO4u7wC&utm_source=gb-gplus-shareSecrets of the Oracle DatabaseMy libraryHelpAdvanced Book SearchBuy eBook - $47.39Get this book in printApress.comAmazon.comBarnes&Noble.comBooks-A-MillionIndieBoundFind in a libraryAll sellers»Secrets of the Oracle DatabaseNorbert DebesApress, Aug 3, 2010 - Computers - 450 pages 0 Reviewshttps://books.google.com/books/about/Secrets_of_the_Oracle_Database.html?id=ZxEL-FO4u7wCSecrets of the Oracle Database is the definitive guide to undocumented and partially-documented features of the Oracle Database server. Covering useful but little-known features from Oracle Database 9 through Oracle Database 11, this book will improve your efficiency as an Oracle database administrator or developer. Norbert Debes shines the light of day on features that help you master more difficult administrative, tuning, and troubleshooting tasks than you ever thought possible.Finally, in one place, you have at your fingertips knowledge that previously had to be acquired through years of experience and word of mouth through knowing the right people. What Norbert writes is accurate, well-tested, well-illustrated by clear examples, and sure to improve your ability to make an impact on your day-to-day work with Oracle. Preview this book » What people are saying-Write a reviewWe haven't found any reviews in the usual places.Selected pagesTitle PageTable of ContentsIndexContentsCHAPTER 1 Partially Documented Parameters 3 CHAPTER 2 Hidden Initialization Parameters 29 PART 2 Data Dictionary Base Tables 40 CHAPTER 3 Introduction to Data Dictionary Base Tables 41 CHAPTER 4 IND VOBJECT_USAGE and Index Monitoring 45 PART 3 Events 56 CHAPTER 5 Event 10027 and Deadlock Diagnosis 57 CHAPTER 6 Event 10046 and Extended SQL Trace 61 Oracle 223 CHAPTER 23 Application Instrumentation and EndtoEnd Tracing 251 PART 8 Performance 268 CHAPTER 24 Extended SQL Trace File Format Reference 271 CHAPTER 25 Statspack 311 CHAPTER 26 Integrating Extended SQL Trace and AWR 345 CHAPTER 27 ESQLTRCPROF Extended SQL Trace Profiler 351 CHAPTER 28 The MERITS Performance Optimization Method