Shrinking Ensemble/Cache Database

351 views
Skip to first unread message

Alex Wildes

unread,
Jan 7, 2008, 12:05:49 PM1/7/08
to intersystems.public.cache
Hello,

I am a SQL Server DBA and I know that there is a command to shrink a
database in SQL. However, with my research within this newsgroup as
well as other Web forums, I have not found a command to shrink a
datababase within Ensemble/Cache. Does anyone know if such a command
was created within Ensemble 2007 or are we left with the CREATE NEW
DATABASE/Export Old database data into NEW database routine? Thanks

Always
Alex

Benjamin Spead

unread,
Jan 7, 2008, 12:21:54 PM1/7/08
to intersystems...@googlegroups.com
See the options under ^DATABASE:

http://docs.intersystems.com/cache20071/csp/docbook/DocBook.UI.Page.cls?KEY=ACHUI_Mgmt

WARNING: Caché optimizes the amount of data in the DB blocks. If you compact a DB and then insert a lot of data, you will see lowered performance due to an increase of block splits.

HTH,
Ben

Alex Wildes

unread,
Jan 11, 2008, 10:16:46 AM1/11/08
to intersystems.public.cache
Thank you for the response. I will stick with creating a new database
and exporting globals from old database and import them into the new.

On Jan 7, 12:21 pm, "Benjamin Spead" <Benjamin.Sp...@intersystems.com>
wrote:
> See the options under ^DATABASE:
>
> http://docs.intersystems.com/cache20071/csp/docbook/DocBook.UI.Page.c...

Chip Humphreys

unread,
Jan 20, 2008, 12:32:22 PM1/20/08
to intersystems...@info2.kinich.com
Although it will still require the creation of a new DB there is not really
a need to pull all the code/routines out and then load them in to another
DB. You could use ^GBLOCKCOPY. Although they spoeak of it as converting
legacy DBs it works wonderfully for copying the data.code from a current DB
in to a smaller one.

All you do is set up a new DB and then use ^GBLOCKCOPY to convert. The
fastest way is to prep the new DB to the size you expect you will need.
Assuming your current DB is 100GB and you anticipate that the actual space
you need is 30GB. Then you would create your DB as say 28 GB and leave the
max size as unlimited. Run ^GBLOCKCOPY and when it is done you can set a
max size if you so please. Of course you could just create the new DB to be
1MB, which is the default and let the process grow it as needed but I have
found that that does slow down the process a bit.

http://docs.intersystems.com/cache20071/csp/docbook/DocBook.UI.Page.cls?KEY=AGBC_Gblockcopy#AGBC_upgrade_tasks

Hope this helps.

--
Chip

Reply all
Reply to author
Forward
0 new messages