This discussion is archived
1 2 3 Previous Next 36 Replies Latest reply: Nov 13, 2012 10:34 AM by orafad RSS

Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010

970316 Newbie
Currently Being Moderated
Hi Sir/Madam,
I am Wayne, I need your help to resolve my issue in oracle database 11g.
1. I installed Oracle 11g Personal Edition, Release 11.2.0.10, 64bits,
2. Test connection(oracle in oradb11g_home1) is successed in data source, odbc,
2. Then, I tried to connect this with Visual Basic(Visual Studio 2010), data connections, add connections, .net framework data provider for oracle,
3. but I received an error message as "Attempt to load Oracle client libraries threw BadImageFormatException."
4. Then, I download the ODAC(11.2.0.3.0) for 64bits, and installed,
5. I tried to test the connection, but failed with error message as stated above,
"Unable to connect SQLState=08004 Oracle ODBC Ora-12154: TNS:could not resolve the connect identifier specified"

Could you please give me a help on this, do I need to install ODAC for 11g Personal Edition ? Please advice accordingly, thanks.
  • 1. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    Welcome to OTN


    Post
    Lsnrctl status
  • 2. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    Sunny kichloo Expert
    Currently Being Moderated
    You are getting Ora-12154 Error.

    Crosscheck the connect identifier specified?? It should have the same value as mentioned in tnsnames.ora file present in $ORACLE_HOME/network/admin directory


    Also have a look into this article of Edstevens Sir

    http://edstevensdba.wordpress.com/2011/02/26/ora-12154tns-03505/
  • 3. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    970316 Newbie
    Currently Being Moderated
    Hi Osama,

    The below are after I run Lsnrctl status,

    C:\Users\Administrator>Lsnrctl status

    LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 31-OCT-2012 16:25
    *:33*

    Copyright (c) 1991, 2010, Oracle.  All rights reserved.

    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Produ
    ction
    Start Date                31-OCT-2012 08:06:04
    Uptime                    0 days 8 hr. 19 min. 57 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   C:\app\Administrator\product\11.2.0\dbhome_1\network\a
    dmin\listener.ora
    Listener Log File         c:\app\administrator\diag\tnslsnr\wayne\listener\alert
    *\log.xml*
    Listening Endpoints Summary...
    *(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))*
    *(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wayne)(PORT=1521)))*
    Services Summary...
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orclXDB" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    The command completed successfully

    C:\Users\Administrator>

    Please give me a help on this, thanks.

    wayne
  • 4. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    Post tnsnames.ora Please
  • 5. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    970316 Newbie
    Currently Being Moderated
    Hi Osama,
    Please view the below, thanks.


    *# tnsnames.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora*
    *# Generated by Oracle configuration tools.*

    ORACLR_CONNECTION_DATA =
    *(DESCRIPTION =*
    *(ADDRESS_LIST =*
    *(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))*
    *)*
    *(CONNECT_DATA =*
    *(SID = CLRExtProc)*
    *(PRESENTATION = RO)*
    *)*
    *)*

    ORCL =
    *(DESCRIPTION =*
    *(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))*
    *(CONNECT_DATA =*
    *(SERVER = DEDICATED)*
    *(SERVICE_NAME = orcl)*
    *)*
    *)*
  • 6. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    in your tnsnames.ora you are using host Name = localhost but in listener.ora you are using wayne which one is the right ???


    if the wayne is Right then modify tnsnames.ora
  • 7. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    Sunny kichloo Expert
    Currently Being Moderated
    As suggested above update your tnsnames.ora file with correct hostname and share the output.
  • 8. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    Sunny kichloo wrote:
    As suggested above update your tnsnames.ora file with correct hostname and share the output.
    you always repeating , what is the point of repeat the post ?!!!
  • 9. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    Sunny kichloo Expert
    Currently Being Moderated
    Not repeating only suggesting :-)

    Not always
  • 10. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    970316 Newbie
    Currently Being Moderated
    Hi Osama,
    My computer name is wayne.
    I check my listener.ora from C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN, the HOST is localhost, why different from the one I shown to you in previous post ?
    *# listener.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora*
    *# Generated by Oracle configuration tools.*

    SID_LIST_LISTENER =
    *(SID_LIST =*
    *(SID_DESC =*
    *(SID_NAME = CLRExtProc)*
    *(ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)*
    *(PROGRAM = extproc)*
    *(ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")*
    *)*
    *)*

    LISTENER =
    *(DESCRIPTION_LIST =*
    *(DESCRIPTION =*
    *(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))*
    *(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))*
    *)*
    *)*

    ADR_BASE_LISTENER = C:\app\Administrator
    So, I change HOST to wayne from listener.ora, tnsname.ora,
    but i received error message as below,
    Unable to connect SQLState=S1000 [Oracle][ODBC][Ora]ORA-12541:no listener

    Please give me a help on this, thanks.
    Let me know if you want to access my PC by logmein.com.

    wayne
  • 11. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    sb92075 Guru
    Currently Being Moderated
    967313 wrote:
    "Unable to connect SQLState=08004 Oracle ODBC Ora-12154: TNS:could not resolve the connect identifier specified"
    ORA-12154 ALWAYS only occurs on SQL Client & no SQL*Net packets ever leave client system
    ORA-12154 NEVER involves the listener, the database itself or anything on the DB Server.
    ORA-12154 occurs when client requests a connection to some DB server system using some connection string.
    TNS-03505 is thrown by tnsping & is same error as ORA-12154 thrown by sqlplus or others.
    The lookup operation fails because the name provided can NOT be resolved to any remote DB.
    The analogous operation would be when you wanted to call somebody, but could not find their name in any phonebook.
    The most frequent cause for the ORA-12154 error is when the connection alias can not be found in tnsnames.ora.
    The lookup operation of the alias can be impacted by the contents of the sqlnet.ora file; specifically DOMAIN entry.
    TROUBLESHOOTING GUIDE: ORA-12154 & TNS-12154 TNS:could not resolve service name [ID 114085.1]
    http://edstevensdba.wordpress.com/2011/02/26/ora-12154tns-03505/
  • 12. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    not seems you are changing anything
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    )
    use netca to delete old listener.ora and create new one
  • 13. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    970316 Newbie
    Currently Being Moderated
    Hi Osama,
    I did according to your guide, thanks.

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\Administrator>del listener.ora
    Could Not Find C:\Users\Administrator\listener.ora

    C:\Users\Administrator>netca

    Oracle Net Services Configuration:
    Stopping Oracle Net Listener:
    Running Listener Control:
    C:\app\Administrator\product\11.2.0\dbhome_1\bin\lsnrctl stop LISTENER
    Listener Control complete.
    Listener stopped successfully.
    Deleted Listener service: LISTENER
    Deleted listener: LISTENER
    Oracle Net Services configuration successful. The exit code is 0

    C:\Users\Administrator>netca

    Oracle Net Services Configuration:
    Configuring Listener:LISTENER
    ServiceAliasException: Could not save Service Alias: TNS-04406: Object already e
    xists
    Default local naming configuration complete.
    Listener configuration complete.
    Oracle Net Listener Startup:
    Running Listener Control:
    C:\app\Administrator\product\11.2.0\dbhome_1\bin\lsnrctl start LISTENER
    Listener Control complete.
    Setting Listener service to start automatically.
    Listener started successfully.
    Oracle Net Services configuration successful. The exit code is 0

    C:\Users\Administrator>

    Thanks, the test connection is successful for oradb11g_home1 in data source, ODBC.
    But, I encountered one error message in VB(visual studio2010) as below, Data Connections, Add Connection, Data Provider, .NET Framework Data Provider for Oracle.
    Attempt to load oracle client libraries threw badimageformatexception.
    This problem will occur when running in 64 bit mode with 32 bit oracle client components installed.

    Kindly assist me on this, thanks.

    I use Oracle 11g Personal Edition, 64 bit,
    VB, visual studio 2012,
    OS, Windows 7 64 bit,
1 2 3 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points