Consultor Eletrônico



Kbase P96440: How to restore as a "smaller" database
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

How to "shrink" a database using probkup and prorest

GOAL:

How to restore as a "smaller" database

GOAL:

How to "shrink" a database using probkup and prorest

GOAL:

How to restore as a "smaller" database

FIX:

If you have no area which is over 2Gig (or a V8 database less than 2 Gig), then a simple prorest without an existing structure file (<db>.st) in the directory where you restore the database will make each area sized up to its hiwater mark within the current directory. Should you need to restore within different directory, then you can have a structure file with a non fixed extent for each area, as per example:

b .
d "Schema Area":6,32 .
d "Area1":7,32 .
d "Area2":8,32 .

If you do have a database with areas over 2 Gig then there are two different solutions described below.

** Solution based on "Large Files", applicable if you do have a Progress Enterprise license on each machine where you run the backup and the restore and if the OS where you restore the database supports files as big as the largest area.
Step 1. (Optional)
If the database has not Large Files Support enabled already, then do it prior to running "probkup", using the command
proutil <db> -C EnableLargeFiles
Step 2 (where the db resides)
probkup <db> <path+delimiter>db.bkup
Step 3 (where you restore)
Within a directory where no <db>.st file exists:
prorest <db> <path+delimiter>db.bkup

** Solution based on a new .st file
Step 1 (where the db resides)
Find out how large each area needs to be by checking its hiwater mark. Run for example the following code:
FOR EACH _Areastatus WITH SIDE-LABELS:
DISPLAY _AREASTATUS._AREASTATUS-AREANUM SKIP
_AREASTATUS._AREASTATUS-AREANAME SKIP
_AREASTATUS._AREASTATUS-TOTBLOCKS SKIP
_AREASTATUS._AREASTATUS-HIWATER SKIP .
END.

Step 2 (where the db resides)
probkup <db> <path+delimiter>db.bkup
Step 3 (where you restore)

Create a <db>.st file where each area is large enough for all its DB blocks (up to the hiwater mark), as per example:
b /usr4/biextent
d "Schema Area":6,32 .
d "Area1":7,32 /usr1/dbextent f 2097152
d "Area1":7,32 /usr2/dbextent f 2097152
d "Area1":7,32 .
d "Area2":8,32 /usr3/dbextent f 2097152
d "Area2":8,32 /usr1/dbextent

Step4 (where you restore)

Within the directory where the structure file <db>.st is:
prorest <db> <path+delimiter>db.bkup