Topic
4 replies Latest Post - ‏2012-01-16T01:48:38Z by SystemAdmin
Mesan
Mesan
38 Posts
ACCEPTED ANSWER

Pinned topic PowerShell support for DB2

‏2007-06-06T17:49:39Z |
Is there anyone else that thinks it would be useful for IBM to develop some PowerShel cmdlets for DB2 (and make them available for Express-C, unlike MQTs... <grumble />))?

Would anyone else see value in saying something like

[i]get-content c:\db_change_script.txt | change-database -dbname MyDB -host dbserver -port 50000 | format-table sqlcode, message[/i]

Wouldn't being able to do stuff like that be HUGE! You know the SQL Server team is going to be adding functionality like that eventually, wouldn't that be sweet if DB2 beat them to the punch AGAIN, like they did with CLR Sprocs?

DB2 has such a great reputation for being a market leading database, I sure hope that the community can gather a big enough voice to help them realize that PowerShell support would be enormously beneficial.

For anyone unfamiliar with PowerShell - every other scripting language pipes [u]text[/u] between commands, which means that every command has to parse the previous command's output before it can do anything useful. For example, in order to to run a bunch of changes against the database and then only show the errors I'd have to parse each line and figure out where the error number is, and then show that line. PowerShell pipes actual objects back and forth, so there's no need to parse for the error number, you just access the Error property. With PowerShell you'd be able to say:

[i]get-content c:\changes.txt | change-database -name mydb | select-object error -ne 0 | export-clixml errors.xml[/i]
(that gets al the results that have an error not equal to 0 and exports those errors to errors.xml)

Isn't that so much more useful? That's just the begnning, I'm sure if a coupe of smart IBM devs that "got" PowerShell were given a bit of time they could come up with all SORTS of really engaging, exciting ways to make DB2 that much better (for windows DBAs at least).

Have I just had too much of the PowerShell kool-aid or is there anyone else that also thinks DB2 could really benefit by adding PowerShell support?
Updated on 2012-01-16T01:48:38Z at 2012-01-16T01:48:38Z by SystemAdmin
  • rchase
    rchase
    364 Posts
    ACCEPTED ANSWER

    Re: PowerShell support for DB2

    ‏2007-06-12T22:37:27Z  in response to Mesan
    Hi,

    Thanks for your input ... to be honest, I'm not familiar with PowerShell, but I tend to do most of my scripting on Linux and I prefer scripts that use the basic OS scripting built-in function for max portability.

    I've passed your suggestion onto our development group to see what they think.

    Ryan Chase
    DB2 Express Community team
    DB2 Express-C home page: http://www.ibm.com/db2/express
    Download DB2 Express-C for free: http://www.ibm.com/db2/express/download.html
    • SystemAdmin
      SystemAdmin
      5837 Posts
      ACCEPTED ANSWER

      Re: PowerShell support for DB2

      ‏2008-07-21T20:14:05Z  in response to rchase
      Just wondering if you have heard anything back from the product team regarding native support for PowerShell in DB2.

      Thanks!!!
      • Mesan
        Mesan
        38 Posts
        ACCEPTED ANSWER

        Re: PowerShell support for DB2

        ‏2011-12-19T23:50:45Z  in response to SystemAdmin
        Anyone? PowerShell & DB2?
        Will it ever happen? Helloooooooooo....
        • SystemAdmin
          SystemAdmin
          5837 Posts
          ACCEPTED ANSWER

          Re: PowerShell support for DB2

          ‏2012-01-16T01:48:38Z  in response to Mesan
          We'll, I couldn't find much but here is a simpe example... http://myblog4fun.com/archive/2012/01/14/using-powershell-to-access-db2.aspx