none
how to remove/delete an orphan package? RRS feed

  • Question

  • In a multi-tiered hierarchy one primary server has an orphan package (winpex86). The package was replicated from its parent, but obviously it was deleted from parent site some time in the past. For some reason the package still appears on this site server. Each day system logs 50k+ messages saying the DP starts install this package and installed successfully ... repeatedly. I think this busy activity prevents other packages being replicated from parent as I can see some other packages stay in "install pending" for a long time. I think I need to delete this orphan package before resolve other "install pending" issues. Since the package does not exist on parent site I can't remove it from original parent site by just remove the DP from the package. Right-click the package I can see "cut"operation but not sure what this does.

    Can someone help me how I can remove/delete this orphan package? Any SQL query can do this?

    thanks

     

    Saturday, July 23, 2011 8:15 AM

Answers

  • Hi,

     

    Packages that are deleted at a parent site can be orphaned at a child site if the child site is down at the time of deletion (temporarily), or the replication process is unsuccessful. You won’t be able to delete those packages from child site because they appear as “locked” in the console. In this case, we will need to manually fix the problem by modifying the package record from the child site database, so that we will be allowed to delete the package from the child site console.

     

    Here’re the steps of doing so:

     

    Removing Orphan Packages

    ========================

    To remove orphan packages from the SQL Server database, use the following steps:

     

    1. Open SQL Server Management Studio, and use the site database of the child site cs1(SMS_cs1). 

     

    2. Type and run the following command in the query window:

    select PkgId, Name, SourceSite from SMSPackages 

     

    3. Search for the PkgID file that you want to remove. 

    You should be able to find this package in the result of this query. If the PkgID is not found, it shouldn’t have been displayed in the cs1 console in the first place – close and re-open the cs1 SCCM console if this is the case.

     

    4. Type and run the following command in the query window:

    Update SMSPackages Set SourceSite ='cs1' Where PkgID= '<Your PkgID>' 

     

    5. The package is now set to a local package and you can delete it from within the SCCM Administrator console.  Please delete it from the cs1 console, and then the deletion will be gracefully replicated to all sites below cs1 as if it were a packages created on child site.

     

    Regards,

     

    Sabrina


    This posting is provided "AS IS" with no warranties or guarantees, and confers no rights. |Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by TreeLeafs Tuesday, July 26, 2011 9:58 AM
    Monday, July 25, 2011 8:05 AM

All replies

  • You can use this script - http://blogs.msdn.com/b/rslaten/archive/2006/03/01/removing-a-retired-dp-from-all-your-packages.aspx
    Kent Agerlund | My blogs: http://blog.coretech.dk/author/kea/ and http://scug.dk/ | Twitter @Agerlund | Linkedin: /kentagerlund
    Saturday, July 23, 2011 8:22 AM
    Moderator
  • Thanks for the reply.

    But the DP role is not retired and I only need to remove one package and that the manage DP wizard does not work for this scenario.

     

    Saturday, July 23, 2011 12:08 PM
  • Any chance that you are running into this distmgr issue: http://support.microsoft.com/kb/978021/en-us
    Torsten Meringer | http://www.mssccmfaq.de
    Saturday, July 23, 2011 12:26 PM
    Moderator
  • thanks Torston,

    I am not sure if this is the case mentioned in the above KB.

    May I state my problem again:

    The package (say pk01) created on parent server (say ps1) and pk01 is replicated to child server (say cs1).

    Do not know what exactly happened but the package pk01 disappeared from server ps1. I guess it was deleted. The deletion may not be performed properly, or the server cs1 might lost connection when deletion occurred. Anyway the end result is the package pk01 no longer exists on server ps1 but still appear on server cs1 with the package ID showing it was from the parent.

    How can I delete/remove this package pk01 from server cs1?

     

    Sunday, July 24, 2011 10:11 AM
  • Hi,

     

    Packages that are deleted at a parent site can be orphaned at a child site if the child site is down at the time of deletion (temporarily), or the replication process is unsuccessful. You won’t be able to delete those packages from child site because they appear as “locked” in the console. In this case, we will need to manually fix the problem by modifying the package record from the child site database, so that we will be allowed to delete the package from the child site console.

     

    Here’re the steps of doing so:

     

    Removing Orphan Packages

    ========================

    To remove orphan packages from the SQL Server database, use the following steps:

     

    1. Open SQL Server Management Studio, and use the site database of the child site cs1(SMS_cs1). 

     

    2. Type and run the following command in the query window:

    select PkgId, Name, SourceSite from SMSPackages 

     

    3. Search for the PkgID file that you want to remove. 

    You should be able to find this package in the result of this query. If the PkgID is not found, it shouldn’t have been displayed in the cs1 console in the first place – close and re-open the cs1 SCCM console if this is the case.

     

    4. Type and run the following command in the query window:

    Update SMSPackages Set SourceSite ='cs1' Where PkgID= '<Your PkgID>' 

     

    5. The package is now set to a local package and you can delete it from within the SCCM Administrator console.  Please delete it from the cs1 console, and then the deletion will be gracefully replicated to all sites below cs1 as if it were a packages created on child site.

     

    Regards,

     

    Sabrina


    This posting is provided "AS IS" with no warranties or guarantees, and confers no rights. |Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by TreeLeafs Tuesday, July 26, 2011 9:58 AM
    Monday, July 25, 2011 8:05 AM
  • Thanks very much Sabrina. I'll try it tomorrow.

    However, to make it clear, say the package pk01 curently has an ID ps1008 where ps1 indicating it was from ps1.

    The first query should return, among others, something like ps1008, pk01, ps1.

    And the second query would be something like

    Update SMSPackages Set SourceSite = 'cs1' where PkgID='ps1008'

    Is this correct?

    Thanks again

    Monday, July 25, 2011 10:17 AM
  • Update SMSPackages Set SourceSite = 'cs1' where PkgID='ps1008'


    Yes, setting the sourcesite from "central site" to "child site" (on the child site) will remove the lock so that the package can be deleted using the console.
    Torsten Meringer | http://www.mssccmfaq.de
    Monday, July 25, 2011 10:24 AM
    Moderator
  • I had something similar where I don't have the package by name in the console.  Initially, it was looking for the source directory, which wasn't present, I created the source directory to stop the propagation of the error below:

    SMS Distribution Manager failed to access the source directory "\\<siteserver>\SMSSource\<packageName>" for package "WCM00621". The operating system reported error 2: The system cannot find the file specified.

    I ran the update command listed above, however I'm not seeing the package to delete within the console.  Any help would be appreciated.

    Thanks,

    Al

    Monday, April 15, 2013 9:39 PM