How to Shrink a Database

Right now our Navision 3.60 database is near 3GB size but it´s only use 10%. Do you know how can I shrink the database to 1GB? Kind regards and thanks in advance

Off the top of my head, would the solution be to back it up and restore it into a new database of the appropriate size?

Hello, Unfortunately, creating a new one is your only option, as there is no “shrink” option. You have is to back up (Using the Navision internal backup) the database, move the existing one (Do NOT delete until you have finished in case there was something wrong with the backup), create a new, smaller, blank database, and then retore the backup into the new file.

With The SQL Server option, you can shrink database directly with SQL SERVER by using a query tool like QUERY ANALIZER. You can shrink data file and log file(s) by using the command DBCC SHRINKFILE. Be careful, it’s important to make a safeguard of your database before (Navision and SQL SERVER) in case of… There’s a second precaution to take, don’t resize too small. If the resizing result is an occupation greater than 90 percent of navision’s space used, the performance will be a complete disaster.

quote:


Originally posted by mhuillier
With The SQL Server option, you can shrink database directly with SQL SERVER by using a query tool like QUERY ANALIZER. You can shrink data file and log file(s) by using the command DBCC SHRINKFILE.


You can also use the SQL Server Enterprise Manager and easily shrink the database. With this tool you can set the free space after shrinking and even shrink the database files individually so that for example you can shrink the logfile but not the database file. You also can move pages to beginning of the file before shrinking.