cancel
Showing results for 
Search instead for 
Did you mean: 

database repair (remove empty pages)

Baron
Participant
1,770

I know that in Microsoft Access there is a mechanism called Repair Database, which as result optimizes the performance and the size of the database.

Is there any similar mechanism in SQL Anywhere?

We have currently problems of database size (some gigabytes), and we know that the actual data is not that big, but the most of size is 'debris' remaining from INSERT and DELETE

Accepted Solutions (0)

Answers (2)

Answers (2)

chris_keating
Product and Topic Expert
Product and Topic Expert

In many cases, space that has been used in the database and freed will get reused. If that is not the case in your environment (the growth is an one-time event), rebuilding the database makes sense. Otherwise, the cost of rebuilding a database that will grow again may not provide much benefit.

There are two approaches to rebuilding a database that is involved in replication or synchronization.

VolkerBarth
Contributor

You can use dbinfo or various system procedures to check for free pages, and you can use reorganize table for a running database or a complete reload to minimize size. There are many FAQ here related to this topic.

Aside: Having used MS Access as a database in former times, I would really refrain from comparing it and its "repair mode" to a "real" database system like SQL Anywhere...

Baron
Participant
0 Kudos

Thanks for the comment.

What you mean exactly with Reload? Do you mean Unload + Load into a new empty database?

VolkerBarth
Contributor

Yes. That's the only way to reduce the database size.

Baron
Participant
0 Kudos

This process we do sometimes.

But this process does not always result a new product DB which can functionally replace the original one!

An example is a DB with SQL Remote, or even with Mobilink!

VolkerBarth
Contributor

You certainly CAN reload databases for SR or ML - you just have to do this as required, see the docs - it's easiest via dbunload -ar directory...