Accessing Oracle from Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan Ellis

    Accessing Oracle from Python

    Hi,

    I've been down so many dead ends trying to get something working, so
    I'm really hoping someone can help out.

    I need to access an Oracle database running on a Windows server from
    Python running on Linux. I've tried building DCOracle2, but it seems
    that the 'oracle-installclient-basic' thing I downloaded from the
    Oracle site doesn't contain enough. I've tried various other
    approaches, such as mxODBC/iODBC, but without much luck. I'm hoping to
    not have to resort to a Windows solution.

    Can someone help me figure out what combination of Python module,
    Oracle download and/or ODBC driver will work?

    Thanks,
    Dan.

    --
    Dan Ellis, Computer Officer
    North Lindsey College
  • Larry Bates

    #2
    Re: Accessing Oracle from Python

    You don't want to use ODBC as that is a Windows interface
    that doesn't natively exist on Linux. You can purchase
    Linux ODBC interfaces from companies like EasySoft, but
    if your program is running on Linux you will be much better
    off with a native interface. ODBC overhead is quite large
    and should be avoided whenever possible. You didn't say
    which version of Oracle, but for 7 and 8 you can use



    8i and above can be accessed using



    Access to remote Oracle databases is just done via TCP
    connections.

    Note: Our experience is that Oracle runs MUCH better
    on Linux than Windows (as much as 5 times faster on
    equivalent hardware). Are you sure you want the database
    on Windows?

    HTH,
    Larry Bates
    Syscon, Inc.

    "Dan Ellis" <usenet@electri cwords.org> wrote in message
    news:bf9b9a98.0 407150751.1ffa2 18b@posting.goo gle.com...[color=blue]
    > Hi,
    >
    > I've been down so many dead ends trying to get something working, so
    > I'm really hoping someone can help out.
    >
    > I need to access an Oracle database running on a Windows server from
    > Python running on Linux. I've tried building DCOracle2, but it seems
    > that the 'oracle-installclient-basic' thing I downloaded from the
    > Oracle site doesn't contain enough. I've tried various other
    > approaches, such as mxODBC/iODBC, but without much luck. I'm hoping to
    > not have to resort to a Windows solution.
    >
    > Can someone help me figure out what combination of Python module,
    > Oracle download and/or ODBC driver will work?
    >
    > Thanks,
    > Dan.
    >
    > --
    > Dan Ellis, Computer Officer
    > North Lindsey College[/color]


    Comment

    • Walter Dörwald

      #3
      Re: Accessing Oracle from Python

      Dan Ellis wrote:
      [color=blue]
      > Hi,
      >
      > [...]
      >
      > I need to access an Oracle database running on a Windows server from
      > Python running on Linux. I've tried building DCOracle2, but it seems
      > that the 'oracle-installclient-basic' thing I downloaded from the
      > Oracle site doesn't contain enough. I've tried various other
      > approaches, such as mxODBC/iODBC, but without much luck. I'm hoping to
      > not have to resort to a Windows solution.
      >
      > Can someone help me figure out what combination of Python module,
      > Oracle download and/or ODBC driver will work?[/color]

      Try cx_Oracle:
      Workflow automation solutions for the government enterprise. Robust government software solutions for permitting, licensing, ABC mgmt. & more.

      (and of course you need an Oracle client installation on your Linux
      machine)

      HTH,
      Walter Dörwald

      Comment

      • Walter Dörwald

        #4
        Re: Accessing Oracle from Python

        Dan Ellis wrote:
        [color=blue]
        > Hi,
        >
        > [...]
        >
        > I need to access an Oracle database running on a Windows server from
        > Python running on Linux. I've tried building DCOracle2, but it seems
        > that the 'oracle-installclient-basic' thing I downloaded from the
        > Oracle site doesn't contain enough. I've tried various other
        > approaches, such as mxODBC/iODBC, but without much luck. I'm hoping to
        > not have to resort to a Windows solution.
        >
        > Can someone help me figure out what combination of Python module,
        > Oracle download and/or ODBC driver will work?[/color]

        Try cx_Oracle:
        Workflow automation solutions for the government enterprise. Robust government software solutions for permitting, licensing, ABC mgmt. & more.

        (and of course you need an Oracle client installation on your Linux
        machine)

        HTH,
        Walter Dörwald


        Comment

        • M.-A. Lemburg

          #5
          Re: Accessing Oracle from Python

          Larry Bates wrote:[color=blue]
          > You don't want to use ODBC as that is a Windows interface
          > that doesn't natively exist on Linux. You can purchase
          > Linux ODBC interfaces from companies like EasySoft, but
          > if your program is running on Linux you will be much better
          > off with a native interface. ODBC overhead is quite large
          > and should be avoided whenever possible.[/color]

          I don't quite agree with this statement: it's an old myth
          that was based on poor ODBC drivers. If you connect to a
          database over a network, the network latency is what matters,
          not the additional layering you do on the client or server.

          ODBC gives you much more flexibility in terms of setting up
          your database client - server and backend structure.

          Tools like mxODBC let you tap into this flexibility from
          Windows, Linux, Solaris, AIX, etc. with the additional
          benefit of having to only write against one API for all
          databases and on all platforms.

          --
          Marc-Andre Lemburg
          eGenix.com

          Professional Python Services directly from the Source (#1, Jul 16 2004)[color=blue][color=green][color=darkred]
          >>> Python/Zope Consulting and Support ... http://www.egenix.com/
          >>> mxODBC.Zope.Dat abase.Adapter ... http://zope.egenix.com/
          >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/[/color][/color][/color]
          _______________ _______________ _______________ _______________ ____________

          ::: Try mxODBC.Zope.DA for Windows,Linux,S olaris,FreeBSD for free ! ::::

          Comment

          • M.-A. Lemburg

            #6
            Re: Accessing Oracle from Python

            Dan Ellis wrote:[color=blue]
            > Hi,
            >
            > I've been down so many dead ends trying to get something working, so
            > I'm really hoping someone can help out.
            >
            > I need to access an Oracle database running on a Windows server from
            > Python running on Linux. I've tried building DCOracle2, but it seems
            > that the 'oracle-installclient-basic' thing I downloaded from the
            > Oracle site doesn't contain enough. I've tried various other
            > approaches, such as mxODBC/iODBC, but without much luck. I'm hoping to
            > not have to resort to a Windows solution.
            >
            > Can someone help me figure out what combination of Python module,
            > Oracle download and/or ODBC driver will work?[/color]

            The EasySoft Oracle drivers works nicely with mxODBC/unixODBC.
            Other vendors of ODBC drivers for Oracle are: DataDirect,
            OpenLink and a few others:



            There's also an open-soruce Oracle ODBC driver:



            Naturally, the EasySoft driver works best with unixODBC and
            the OpenLink one with iODBC (simply because those two companies
            took over development of these ODBC managers).

            --
            Marc-Andre Lemburg
            eGenix.com

            Professional Python Services directly from the Source (#1, Jul 16 2004)[color=blue][color=green][color=darkred]
            >>> Python/Zope Consulting and Support ... http://www.egenix.com/
            >>> mxODBC.Zope.Dat abase.Adapter ... http://zope.egenix.com/
            >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/[/color][/color][/color]
            _______________ _______________ _______________ _______________ ____________

            ::: Try mxODBC.Zope.DA for Windows,Linux,S olaris,FreeBSD for free ! ::::

            Comment

            • Dan Ellis

              #7
              Re: Accessing Oracle from Python

              Thanks to everyone who replied. I finally managed to get cx_Oracle
              built against Oracle 9i, and it's now working sweeter than a sweet
              thing with extra sugar on.

              Comment

              Working...