Python, unix and mssql

Discussion in 'Python' started by francisl, Dec 22, 2004.

  1. francisl

    francisl Guest

    We have to build some script were I work to make a dynamic server inventory.

    But, the project team, a windows crew, start it all in vbscript and on
    mssql. Note, due to political reason, we can not use mysql or anyother
    one that are not *authorize*, it's oracle or mssql. Now we have to make
    it work also with our sun and HP unix server(plus one Linux).

    So I propose to use python, and after they see my litle python/wxwindow
    program, that list windows registry value relate to SUS automatic update
    and that let it remotely force a check. They were amaze on how short it
    took to make us save a lot of time. - Windows by default put a static
    value in its LastWaitTimeout key, in their doc they said 48 hrs. But 48
    hrs is to long for a good schedule on production server. Plus it give us
    headaches to validate all the update on our network. (~75 winnt/2k/2k3
    servers)

    back to subject
    Question.
    Can we, directly from unix select and insert data in a remote mssql
    database?

    if not, my second though was to put a litle python server on the server
    holding the mssql database, which will accept request and insert it in
    the database. But is that possible?

    Thank you
     
    francisl, Dec 22, 2004
    #1
    1. Advertising

  2. francisl

    Peter Hansen Guest

    francisl wrote:
    > Can we, directly from unix select and insert data in a remote mssql
    > database?


    Sorry, I can't answer that one.

    > if not, my second though was to put a litle python server on the server
    > holding the mssql database, which will accept request and insert it in
    > the database. But is that possible?


    Definitely possible. You could, for example, use Pyro
    quite effectively for something like that.

    -Peter
     
    Peter Hansen, Dec 23, 2004
    #2
    1. Advertising

  3. francisl

    Steve Holden Guest

    francisl wrote:

    > We have to build some script were I work to make a dynamic server
    > inventory.
    >
    > But, the project team, a windows crew, start it all in vbscript and on
    > mssql. Note, due to political reason, we can not use mysql or anyother
    > one that are not *authorize*, it's oracle or mssql. Now we have to make
    > it work also with our sun and HP unix server(plus one Linux).
    >
    > So I propose to use python, and after they see my litle python/wxwindow
    > program, that list windows registry value relate to SUS automatic update
    > and that let it remotely force a check. They were amaze on how short it
    > took to make us save a lot of time. - Windows by default put a static
    > value in its LastWaitTimeout key, in their doc they said 48 hrs. But 48
    > hrs is to long for a good schedule on production server. Plus it give us
    > headaches to validate all the update on our network. (~75 winnt/2k/2k3
    > servers)
    >
    > back to subject
    > Question.
    > Can we, directly from unix select and insert data in a remote mssql
    > database?
    >
    > if not, my second though was to put a litle python server on the server
    > holding the mssql database, which will accept request and insert it in
    > the database. But is that possible?
    >
    > Thank you


    If ODBC access is permissible then you could, for example, use mxODBC on
    top of one of the generic ODBC drivers for Unix.

    Since Oracle is also an "approved" database you might also want to think
    about using the cxOracle module, which AFAIK is available on both
    Windows and Unix-like platforms.

    There are several ways you could have remote Python processes talking to
    each other. Pyro is a package that would let you handle this situation
    relatively easily, and I'm sure others will chime in with their favored
    solutions.

    regards
    Steve
    --
    Steve Holden http://www.holdenweb.com/
    Python Web Programming http://pydish.holdenweb.com/
    Holden Web LLC +1 703 861 4237 +1 800 494 3119
     
    Steve Holden, Dec 23, 2004
    #3
  4. francisl wrote:

    > Can we, directly from unix select and insert data in a remote mssql
    > database?
    >

    In some sense you can. I used python and mxODBC to talk ODBC protocol
    to DB2 / MS SqlServer / Access. It was quite a while ago, and I may
    have had to use an odbc-on-linux piece I don't know about. But the
    upshot was that my (large, data and CPU-intensive) program ran portably
    on both Win2K and Linux. The mxODBC solution will cost money, but not
    a lot (and MAL has done a great job letting you discover things about
    the far end of the ODBC connection -- development is simple). The
    switch between databases was really minimal effort on my part -- the
    sysadmin who had to create and backup the DBs was not as sanguine about
    the changes. Check with Marc-Andre about the current state of the art
    for linux ODBC drivers.

    > if not, my second though was to put a litle python server on the server
    > holding the mssql database, which will accept request and insert it in
    > the database. But is that possible?

    This is also easy, and you can simply design a little socket watcher to
    get commands, execute them, and return results.

    > Thank you
     
    Scott David Daniels, Dec 23, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Josh Close
    Replies:
    2
    Views:
    360
    Elbert Lev
    Sep 30, 2004
  2. Josh Close
    Replies:
    5
    Views:
    1,684
    Benji York
    Oct 4, 2004
  3. Brane

    python to mssql

    Brane, Jan 14, 2005, in forum: Python
    Replies:
    3
    Views:
    318
    Peter A. Schott
    Jan 17, 2005
  4. Robert Brewer

    RE: python to mssql

    Robert Brewer, Jan 14, 2005, in forum: Python
    Replies:
    2
    Views:
    293
    Brane
    Jan 15, 2005
  5. -bonn.de

    python, mssql and unicode

    -bonn.de, Nov 3, 2005, in forum: Python
    Replies:
    2
    Views:
    632
    -bonn.de
    Nov 4, 2005
Loading...

Share This Page