converting from oracle9i to 10G

Last post 07-03-2009 4:19 AM by ChriZ. 10 replies.

Sort Posts:

  • converting from oracle9i to 10G

    06-28-2009, 6:44 AM
    • Member
      35 point Member
    • MaherKhalil
    • Member since 04-19-2009, 1:23 PM
    • Posts 65


    i have an asp site working with oracle 9.2 with oracle data provider (oracle.dataaccess.dll)

    now i want to upgrade to oracle 10g 

    i have oracle 10g installed ODAC installed

    i Have my database working on 10g and can connect thought SQLPlus 

    but if i try to connect with my asp app it show as error 

    ORA-12154: TNS:could not resolve service name 

    what else do i need to do to connect to 10g from my app



  • Re: converting from oracle9i to 10G

    06-28-2009, 10:05 AM
    • Member
      270 point Member
    • sajid_ali
    • Member since 06-25-2009, 7:10 AM
    • India
    • Posts 50

    I would recommend to use managed provider such as System.Data.OracleClient

  • Re: converting from oracle9i to 10G

    06-29-2009, 12:59 AM
    • Contributor
      2,515 point Contributor
    • wmec
    • Member since 12-20-2007, 6:36 AM
    • China
    • Posts 1,568

     Are you able to do this?

    tnsping your_10g_db_tns_name

    Many Thanks & Best Regards,
    HuaMin Chen
    (If you mark it then it means the post is helpful/meaningful for other people's reference in the future!)
  • Re: converting from oracle9i to 10G

    06-29-2009, 1:10 AM
    • Member
      424 point Member
    • mamun22s
    • Member since 01-10-2008, 12:29 PM
    • Dhaka, Bangladesh
    • Posts 89

    1.  If you can connect using sqlPlus but not with your application then the problem is on your connection making.

    2. You have to use

    using Oracle.DataAccess.Client;

    3. The connection shoud make like this

     

    OracleConnection con = new OracleConnection();
    
    con.ConnectionString = "User Id="abc";Password="abc";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" localhost")(PORT=" 1521")))(CONNECT_DATA=(SID="test db")));";
    
    con.Open();
    
    OracleCommand cmd = new OracleCommand("", con);
    cmd.CommandText = "select * form xyz";
    cmd.ExecuteNonQuery();
    cmd.Dispose();
    con.Dispose();
    


     

    Moinul Hasan
    Senior Software Engineer
    Ennovia Technologies Limited


    (Mark it as answer if it does help you!)
  • Re: converting from oracle9i to 10G

    06-29-2009, 2:36 AM
    • Member
      35 point Member
    • MaherKhalil
    • Member since 04-19-2009, 1:23 PM
    • Posts 65

    Thanks for your replay

    i can

    using Oracle.DataAccess.Client

    and also can use oracleConnection and oracle command

    i have discovered the problem 

    here is the 9i connection string

    <add name="ConnectionString1" connectionString="Data Source=orcl;User ID=xxxx; Password=xxxx" providerName="System.Data.OracleClient" />


    this works with 9i

    in 10g i must include the computer name (server name)

    <add name="ConnectionString1" connectionString="Data Source=mas-2009/orcl;User ID=xxxxx; Password=xxx" providerName="System.Data.OracleClient" />


    that works with 10g

    is there any solution for that 

    can't i make the connection independant from the computer

  • Re: converting from oracle9i to 10G

    06-29-2009, 2:41 AM
    • Contributor
      2,515 point Contributor
    • wmec
    • Member since 12-20-2007, 6:36 AM
    • China
    • Posts 1,568

    Are you connecting to it by another machine? What's your problem now with 10g?

    Many Thanks & Best Regards,
    HuaMin Chen
    (If you mark it then it means the post is helpful/meaningful for other people's reference in the future!)
  • Re: converting from oracle9i to 10G

    06-29-2009, 2:47 AM
    • Member
      35 point Member
    • MaherKhalil
    • Member since 04-19-2009, 1:23 PM
    • Posts 65

    my problem is that i have to include the computer name before the service

    i want some way to connect without specifing the computer name in the connection string

    suppose i changed my server i have to  edit the web.config to change the server name in the connectin string

    i don't have to do that in 9i

  • Re: converting from oracle9i to 10G

    06-29-2009, 2:57 AM
    • Member
      424 point Member
    • mamun22s
    • Member since 01-10-2008, 12:29 PM
    • Dhaka, Bangladesh
    • Posts 89

    Connection String should be same for all machine. Whether it is server or local machine. You have to change providerName="System.Data.OracleClient" to Oracle.DataAccess.Client

    Moinul Hasan
    Senior Software Engineer
    Ennovia Technologies Limited


    (Mark it as answer if it does help you!)
  • Re: converting from oracle9i to 10G

    06-29-2009, 3:13 AM
    • Member
      35 point Member
    • MaherKhalil
    • Member since 04-19-2009, 1:23 PM
    • Posts 65

    mamun22s:

    Connection String should be same for all machine. Whether it is server or local machine

    it is loacl machine named X the connectin string is Data Source=x/service name

    if it changed to y the connectin string is Data Source=y/service name

    if i tried Data Source=service name it does not connect

    i want to connect without the machine name in the data source

    mamun22s:

     You have to change providerName="System.Data.OracleClient" to Oracle.DataAccess.Client

    when i did that if shows error

    Unable to find the requested .Net Framework Data Provider.  It may not be installed



  • Re: converting from oracle9i to 10G

    06-29-2009, 3:50 AM
    • Member
      424 point Member
    • mamun22s
    • Member since 01-10-2008, 12:29 PM
    • Dhaka, Bangladesh
    • Posts 89

    So far from your explanation I have realized that your problem is on connection or in ODAC. My suggestion is please review the connection string. There is several ways to connect with oracle. Secondly you have to check is ODAC installed properly

     

    Moinul Hasan
    Senior Software Engineer
    Ennovia Technologies Limited


    (Mark it as answer if it does help you!)
  • Re: converting from oracle9i to 10G

    07-03-2009, 4:19 AM
    • Member
      14 point Member
    • ChriZ
    • Member since 08-12-2008, 10:01 AM
    • Posts 23

    Hello, is on your IIS the tnsnames.ora set or a environment variable to the tnsnames.ora? When this is set, you can connect to the database with the name you give in the tnsnames.ora for the service. A tnsnames.ora looks like

    net_service_name=
    (DESCRIPTION=
    (ADDRESS=(protocol_address_information))
    (CONNECT_DATA=
    (SERVICE_NAME=service_name)))

    and then you can connect with the net_service_name

    ChriZ
Page 1 of 1 (11 items)