locked
Lost Packages... RRS feed

  • Question

  • Hi,

    Due to a Disk Failure, we have lost all the Uncompressed packages on a Secondary Site Server.

    We still have the Compressed PKG files (On another Drive) and don't want to send the compressed over the Network again.

    When I try and run a PreloadPkgOnSite I get the following Error...

    ****** Preload Package On Site ******
    The compressed package path for package <PackageID> is already set in the database OR this is the site where the package was created.
    There is no need to use this tool for this package on this site.

    Is there any way round this without causing too much disruption by either Refreshing all the packages (Sends Compressed over Network) or Re-Installing Secondary Site (Ties up Central for Hours)

    I'm sure there is a way of just updating a table somewhere to trick the PreloadPkgOnSite into sending the packages again.

    Thanks.
    Monday, March 4, 2013 12:43 PM

Answers

  • Hi,

    Due to a Disk Failure, we have lost all the Uncompressed packages on a Secondary Site Server.

    We still have the Compressed PKG files (On another Drive) and don't want to send the compressed over the Network again.

    ****** Preload Package On Site ******
    The compressed package path for package <PackageID> is already set in the database OR this is the site where the package was created.
    There is no need to use this tool for this package on this site.



    Thanks.

    Just tell me one thing, previouslly you had un compressed packages on DP, if yes, then execute the following script on SMS Primary server, you need to change the valuse,

    <?xml version="1.0" ?>
    <package>
    <comment><![CDATA[
    =====================================================================
    Title:  DPRefresh.wsf
    Author:  David Wheater
    Date:  15-Sep-2008
    Version: 1.0
    =====================================================================
    ]]></comment>
    <job>
    <runtime>
    <description>
    DPRefresh.wsf
    =============

    Refreshes the packages On a Distribution Point.
    </description>
    <example><![CDATA[
    Example:
    cscript dprefresh.wsf /sms:'Primary Server name' /dp:'DP Name' /site:'Site Code'

    ]]></example>
     <named name="sms" type="string" required="true" helpstring="The name of the Primary SMS server that hosts the packages." />  
     <named name="dp" type="string" required="true" helpstring="The name of the DP server." />
     <named name="site" type="string" required="true" helpstring="The name site that the DP is in." />
    </runtime>
     
     <object id="objShell" progid="Wscript.Shell" reference="TRUE" />
     <object id="objFSO" progid="Scripting.FileSystemObject" reference="TRUE" />
     <object id="objNetwork" progid="Wscript.Network" reference="TRUE" />

    <script language="vbscript">
    <![CDATA[

    Const LogFile = "DPRefresh.log"

    'Cursor Type values
    Const adOpenForwardOnly = 0
    Const adOpenKeyset  = 1
    Const adOpenDynamic  = 2
    Const adOpenStatic  = 3

    'Command Type Values
    Const adCmdUnknown  = &H0008
    Const adCmdText   = &H0001
    Const adCmdTable  = &H0002
    Const adCMDStoredProc = &H0004

     UpdateFile "Script started."
     
     
     If Wscript.Arguments.Named.Exists("/?") Then
      Wscript.Arguments.ShowUsage
      Wscript.Quit
     ElseIf Not (Wscript.Arguments.Named.Exists("sms") And Wscript.Arguments.Named.Exists("dp") And Wscript.Arguments.Named.Exists("site")) Then
      Wscript.Arguments.ShowUsage
      Wscript.Quit
     End If

     SmsServer = Wscript.Arguments.Named("sms")
     SmsSite = Wscript.Arguments.Named("site")
     DpServer = Wscript.Arguments.Named("dp")
     
     UpdateFile "SmsServer: " & SmsServer
     UpdateFile "SmsSite: " & SmsSite
     UpdateFile "DpServer: " & DpServer

     On Error Resume Next

     

     'Update PkgServers table
     strQuery = "UPDATE PkgServers set RefreshTrigger=1, UpdateMask=4, Action=1 where NalPath like '%' + RTRIM(LTRIM(UPPER('" & DPServer & "'))) + '%'"
     UpdateFile "Run query: " & strQuery

     Err.Clear
     DoQuery strQuery
     If err.Number <> 0 Then
      UpdateFile "Error running query. " & err,Number & " - " & err.Description
     Else
      UpdateFile "Query executed OK"
     End If 

     'Add packages to the PkgNotification table
     strQuery = "SELECT PkgID, 2 as Priority, GETDATE() as TimeKey from PkgServers where NalPath like '%' + RTRIM(LTRIM(UPPER('" & DPServer & "'))) + '%'"
     UpdateFile "Run query: " & strQuery
     
     Err.Clear
     Set RS = DoQuery(strQuery)
     If err.Number <> 0 Then
      UpdateFile "Error running query. " & err,Number & " - " & err.Description
     Else
      UpdateFile "Query executed OK"
      UpdateFile RS.RecordCount & " rows returned"
     End If

     RS.MoveFirst
     For X = 1 To RS.RecordCount
      strQuery = "INSERT INTO PkgNotification (PkgID, Priority, TimeKey) VALUES('" & RS.Fields.Item("PkgID") & "','" & RS.Fields.Item("Priority") & "',GETDATE())"
      UpdateFile "Run query: " & strQuery
      
      Err.Clear
      Set RS2 = DoQuery(strQuery)

      If err.Number <> 0 Then
       UpdateFile "Error running query. " & err,Number & " - " & err.Description
      Else
       UpdateFile "Query executed OK"
      End If

      RS.MoveNext
     Next

     UpdateFile "Script finished" & vbcrlf & vbcrlf

     

     Function DoQuery(query)
      Set objCN = CreateObject("ADODB.Connection")
      Set objRS = CreateObject("ADODB.Recordset")

      cnString = "Provider=SQLOLEDB.1;Data Source=" & SmsServer & ";Integrated Security=SSPI;Initial Catalog=SMS_" & SmsSite & ";"
      objCN.Open  cnString
      objRS.Open query, objCN, adOpenKeySet
      Set DoQuery = objRS

      Set objCN = Nothing
      Set objRS = Nothing

     End Function

     

    Sub UpdateFile(strMsg)
     If objFSO.FileExists(LogFile) Then
      Set objTextFile = objFSO.OpenTextFile(LogFile, 8)
     Else
      Set objTextFile = objFSO.CreateTextFile(LogFile)
     End If
     objTextFile.WriteLine Now() & " - " & strMsg
     Wscript.Echo strMsg
     objTextFile.Close
     Set objTextFile = Nothing
    End Sub

     


    ]]>
    </script>

    </job>
    </package>

    for executing use the following command

    cscript dprefresh.wsf /sms:<servername> /dp:<servername> /site:<sitename>

    2-if those packages were not decompressed  before then you have to just refress the dp from console then you have to execute the preload.exe

    you can use batch file this activity


    Sharad Singh | My blogs: SharadTech | Twitter: @SinghSharaad |

    • Proposed as answer by Garth JonesMVP Monday, December 22, 2014 3:15 AM
    • Marked as answer by Garth JonesMVP Saturday, January 3, 2015 5:09 PM
    Tuesday, March 26, 2013 2:02 PM