4 Replies Latest reply on Dec 19, 2014 8:00 PM by Dan Fishman

    Compressing SQL Database


      After deleting database(s) through the PI System Explorer, is there a way to schrink the SQL Server Database containing the AF configuration

        • Re: Compressing SQL Database
          Dan Fishman


          Please see this thread that discusses this.  Basically, you have to manually shrink the PIFD database.  If you decide to do this I highly recommend that you build all indexes since shrinking will increase the index fragmentation level. Generally, it is fine to shrink a database as long as you build the indexes after.  You should be able to use AFDiag /reindex to rebuild every index in the AF Server SQL database.  I would recommend doing this when there is low activity on the AF Server.  See KB 00674 for more OSIsoft comments on re-indexing.



          • Re: Compressing SQL Database

            You can use SQL Server Management Studio to shrink the DB.

            • Right click on PIFD (or whatever your DB is named)
            • Go to Tasks > Shrink > Database
            • You'll see how much of the currently allocated space is available, click OK to release unused space.
            • Re: Compressing SQL Database
              Marcos Vainer Loeff

              Hello Karen,


              I just want to add some comments about how PI AF Server works.


              Direct delete of an element, will probably be removed synchronously. Deleted AFDatabases get removed asynchronously, and could take hours to get completely removed, depending upon the number of objects. Therefore, you need to wait for some hours until PI AF service finish cleaning up the deleted data stored on PIFD.


              Hope it helps!