Knowledge Base Article
Article Type: How To
Product: Symphony
Product Version:
Component: Symphony Server
Device Brands:
Created: 28-Feb-2013 2:21:49 PM
Last Updated:

How to shrink the database

Issue

SQL express has a size limit. Once the limit is reached, you must shrink the database.

Solution

Task 1: Shrink the Database

  1. Download and install Microsoft SQL Server Management Studio Express (SMSE) from Microsoft: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=8961
  2. Launch Microsoft SQL Server Management Studio Express.
  3. Back up the database: Right-click on the database, select Tasks>Back Up.
  4. SQL server mangement studio express

     

  5. Run Shrink on both the database and the log file: Right-click on the database, select Tasks>Shrink>Database and Files.
  6. shrink database

     

Task 2: Manually purge the archive logs

For Symphony Server 7.1 and earlier, run the following SQL to delete all archives older than September 1st (from a command line):

dbupdater "sp_DeleteEventLogArchive '2012-09-01'"

For Symphony 7.2 and later, complete the following tasks:

  1. Open a command prompt as an admistrator and run the following command:

    dbupdater "select 'dbupdater \"drop table ' + EventLogDataTable + '; drop table ' + EventLogTable + '\"' from EventLogArchive"

  2. Copy the output from the command above, paste it into a new file, and save the file as a .bat file.
  3. Run the .bat file to delete the archived events.

Task 3: Truncate the tables eventlog and eventlogdata

For Symphony 6.x

From a command prompt on the Symphony server, enter:

dbupdater "truncate table eventlogdata"

Then enter:

dbupdater "truncate table eventlog"

For Symphony 7.0

From the command prompt on the Symphony server, enter:

dbupdater "ALTER TABLE EventLogData DROP CONSTRAINT FK_EventLogData_EventLog;TRUNCATE TABLE EventLogData;TRUNCATE TABLE EventLog;ALTER TABLE EventLogData WITH CHECK ADD CONSTRAINT FK_EventLogData_EventLog FOREIGN KEY (EventID) REFERENCES EventLog (ID);"

Task 4: Re-run the shrink command on the database again

Using Microsoft SQL Server Management Studio Express, run Shrink on the database: Right-click on the database, select Tasks>Shrink>Database.

Task 5: Run Setup Wizard again to complete the upgrade

In Windows, select All Programs>Aimetis>Setup Wizard.

Average rating:
Please log in to rate.
Rated by 1, Viewed by 5247