Skip to main content

Update files and shrink database

This page explains two items of Files Maintenance in alameen ERP 10 and an option page. Shrink Database rewrites the data of the tables and releases the unused space. Upgrade Database does not open its own maintenance wizard in this version. The Shrink Database page of the program options holds three saved settings. For the steps see Shrink the database and Update files.

Opening the windows​

  • Click File > Tools > Files Maintenance, select Shrink Database or Upgrade Database, and click Run. The Files Maintenance window opens after the program closes the open windows and reserves the file for you alone. Both items always show when your key includes accounting, even in multi-file mode (Available maintenance).
  • The program checks no permission of its own for each item when you run it from the Files Maintenance window; the Files Maintenance permission guards the window. The desktop tile of an item shows only for a user who has a permission of the same name on the Operations page of Users Management.
  • Shrink Database also starts from the favorites menu on the Tools page, from Quick Launch search and from a Maintenance tile on the desktop; these routes check no permission of the operation either. The warning frame shows for every operation whose severity is above low, and this one has high severity.
  • The description of Shrink Database in the list reads: "This operation will compress the size of the database and remove gaps resulting in making program files taking less space on hard disk." The item shows inside the warning frame "This operation is dangerous …".
  • The description of Upgrade Database in the list reads: "This operation enables you to update files in the database of the program or to restore default files in case any was deleted by mistake."
  • Neither wizard shows a backup page before it runs. Take a backup before you start (Make a backup, When to use files maintenance).

Upgrade Database​

This item does not open the registered "Update Files" wizard. When you choose it from the Files Maintenance window, from the favorite maintenance menu, from quick launch, from the command search, or from a tile on the desktop, the program opens the update page of the login window instead, titled Database Update. It works on the open file. The page, its fields and its messages are explained in The login window, and the steps to update a file are in Check for program updates.

What you see when it opens from maintenance:

  • If the file is already at the version of the program, the question "This file belongs to an older version of alameen and it needs to be upgraded. Are you sure to upgrade it now?" does not show. You see only the warning "Once it's upgraded, it can't be opened in any version that is older than this version (to which it's upgraded). This operation might take long time depending on the size of the file." and the table of versions, and the Update button stays.
  • The program does not close the open file and does not go back to the login page after success. The window stays with the message "Database updated successfully." and only the Close button.
  • If the SQL Server of the file has a system administrator, the window asks for the name and password before it updates.

The registered maintenance wizard​

The program contains a wizard named "Update Files" whose window does not appear by these routes. Its page has a title band "Update Files", the instruction "Click "Start" to begin updating database.", a stage line and a progress bar. Its buttons are Start, Cancel, Next and Back (the last two are disabled). It starts the update when you click Start and ends with "Operation successfully completed". It has no picture because it does not open.

Shrink Database​

This page rewrites the data of the tables and then shrinks the database files to release space they do not use. It shows the current sizes before you start.

The window title is "Shrink Database". Under it: "This operation will compress the size of the database and remove gaps resulting in making program files taking less space on hard disk."

The sizes table​

The program calculates the sizes when the page opens only, and does not refresh them during the run. They show with two decimals, in megabytes if the database is under one gigabyte and in gigabytes otherwise. A line at the bottom of the table gives the unit: "Size in MB *" or "Size in GB *".

SectionItemWhat it shows
Database InformationDatabase SizeThe total size of the database.
Free SpaceThe space in it that is not allocated to any table.
Tables InformationData SizeThe space taken by the data of the tables.
Index SizeThe space taken by the indexes.
Unused SpaceThe space reserved for the tables that they do not use, with its percentage of Database Size, in the form "15.50% = 1.20".

Fields​

FieldDescriptionRequiredValues and rules
Modify Data Alignment MethodWhen ticked, the program rebuilds all the tables of the file with the chosen method before the shrinking. When cleared, it only shrinks the files.NoTicked when the page opens. Clearing it disables the Alignment method list.
Alignment methodHow the data of the tables is written again.When the box is tickedWithout (selected when the page opens): rebuilds the tables with no data compression, so it removes earlier compression. Row: compresses the data in each row. Page: compresses it at the level of storage pages, which is stronger compression.
note

The program reads the chosen method when you click the Modify Data Alignment Method box, not when you change the list. To run Row or Page, choose the method in the list first, then clear the box and tick it again before you click Start. If you change the list afterward without clicking the box, the method that was selected at the last click on the box runs.

ButtonWhat it does
StartStarts the shrinking with no confirmation question. It is disabled while it runs.
CancelBefore the start, asks "Are you sure you want to exit and cancel the maintenance operation?". It is disabled during the run, so you cannot stop the operation.
Next and BackBoth are disabled, because the wizard is one page.
HelpOpens the help topic when one is available.

What the operation changes​

  1. If Modify Data Alignment Method is ticked, the program rebuilds every table with the chosen method, then records today's date in the file as the date of the last shrink.
  2. It shrinks the database files and releases the space they do not use.

The progress bar moves halfway, then fills before the long command runs, so it does not show the percentage done. When it ends, the message "Operation successfully completed" appears, then a window titled "New Sizes" shows the sizes after the shrink with the button Close Window:

Database 1.20
Space Available 0.10
Database Size 0.55
Index Size 0.40
Size Available 0.05

The numbers are only an illustration. The values come with two decimals and in the same unit that the page showed (megabytes or gigabytes), and the unit is not written in the message. In the English text the third line reads "Database Size" although it gives the size of the data.

Shrink Database options​

A page of the Program Options named Shrink Database. It shows when a file is open and you have the permission of the page of the same name on the Operations page of Users Management. Its values are saved in the file. How to open it and its OK, Apply and Cancel buttons are in the overview of program options.

FieldDescriptionRequiredValues and rules
Stop free space verification processAn option that the program saves in the file.NoNot ticked when the page opens. When ticked, the program disables the next three fields and does not save their values.
Days count after ReducingA number of days that the program saves in the file.When the box is not tickedWhole number. Default 10.
Days count after no need to shrinkA number of days that the program saves in the file.When the box is not tickedWhole number. Default 7.
Allowed waste percentA percentage that the program saves in the file. A % sign shows beside it.When the box is not tickedWhole number from 0 to 100. Default 75.
  • If the box is ticked when the page opens, the fields are empty, and they fill with 10, 7 and 75 when you clear the box.
  • If you enter in Allowed waste percent a number below 0 or above 100, the message "Allowed Wastage Percentage, whole number between 0 - 100" appears and the entry is refused. The same message appears on OK and Apply.
  • On OK or Apply: if the box is not ticked, the three values are saved. In both cases the state of the box is saved. If you do not have the permission to modify the page, "You don't have the permission to modify the options" appears and nothing is saved.
  • The Shrink Database window does not read these values.

Messages​

MessageWhy it appearsWhat to do
Are you sure you want to exit and cancel the maintenance operation?You clicked Cancel before the start.Yes closes the wizard, and No keeps you on the page.
Operation successfully completedThe shrink finished.Click OK, then read "New Sizes" and click Close Window.
An error was encountered while performing the operation.The shrink command or the rebuild of the tables failed in SQL Server.Check that nobody else is working on the file, then try again. If the error repeats, contact technical support.
Allowed Wastage Percentage, whole number between 0 - 100You entered a value outside the range in the options.Enter a number from 0 to 100.
You don't have the permission to modify the optionsYou clicked OK or Apply and you lack the permission of the page.Ask the file administrator for the permission.

This page applies to alameen ERP 10, version 10.1.79.764.