locked
Deleting all incident data from the database RRS feed

  • Question

  • We are still in a testing phase with SCSM.  When we are ready to move to production, I would like to clear the database of all incident so that we can start fresh.  I am not a SQL code kind of guy...can someone tell me the easiest way to accomplish this?

     

    Thanks

    Thursday, July 7, 2011 5:08 PM

Answers

  • Hey

    Don't use SQL to do this. Use the smlets Powershell module (smlets.codeplex.com) and use the following script:

    get-scsmobject -class (get-scsmclass system.workitem.incident$) | remove-scsmobject -force

    Take care with that script in a production environment as it can delete productive Information from the Service Manager database! Hope that helps you ...

    regards
    Marcel


    SCSMfaq - http://blog.scsmfaq.ch ##### Microsoft Virtualization and Systems Management Partner - http://www.itnetx.ch
    • Marked as answer by DMcGarvey Friday, July 8, 2011 5:32 PM
    Thursday, July 7, 2011 6:57 PM

All replies

  • Hey

    Don't use SQL to do this. Use the smlets Powershell module (smlets.codeplex.com) and use the following script:

    get-scsmobject -class (get-scsmclass system.workitem.incident$) | remove-scsmobject -force

    Take care with that script in a production environment as it can delete productive Information from the Service Manager database! Hope that helps you ...

    regards
    Marcel


    SCSMfaq - http://blog.scsmfaq.ch ##### Microsoft Virtualization and Systems Management Partner - http://www.itnetx.ch
    • Marked as answer by DMcGarvey Friday, July 8, 2011 5:32 PM
    Thursday, July 7, 2011 6:57 PM
  • This may seem like a dumb question, but I'm not a DBA - which server do I run this command on?  We have a two-server setup:

    Server #1 - SCSM Management Server, houses the ServiceManager database

    Server #2 - SCSM Data Warehouse server, houses SSRS and the DWDataMart, DWRepository, and DWStagingAndConfig databases.

    Thursday, July 7, 2011 7:29 PM
  • Hey

    Do it on the SCSM Server (Server #1 in your environment). If really needed you can also run it from another system, but this would mean some more requirements ...

    Regards
    Marcel


    SCSMfaq - http://blog.scsmfaq.ch ##### Microsoft Virtualization and Systems Management Partner - http://www.itnetx.ch
    Thursday, July 7, 2011 9:21 PM
  • Marcel,

     

    Thanks - this worked fine.  I appreciate the help!

    Friday, July 8, 2011 5:33 PM