Kbase P87637: Does procopy copy empty blocks?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  22/11/2006 |
|
Status: Unverified
SYMPTOM(s):
Does procopy copy empty blocks?
Does procopy return empty space in the database to the operating system?
FIX:
procopy copies databases as far as the hiwater mark in each area. Empty blocks, i.e. blocks above the hiwater mark, are not backed up.
The following example was done on HP-UX 11 with 9.1D09.
1. prodb sports sports
2. prostrct add sports add.st
#add.st
#
d "New Area":9,32 .
This adds a variable extent to the database.
3. ls -l shows that the new extent sports_9.d1 extent is 32768k in size.
4. proutil sports -C tablemove customer "New Area"
5. pro sports -p addrecord.p
/* addrecord.p */
/* for testing involving updates */
def var newnum as int.
find last cust no-error.
if available(cust) then
newnum = cust-num.
else
newnum = 1.
repeat:
newnum = newnum + 1.
create cust.
assign
cust-num = newnum.
display cust-num.
pause 0 no-message.
if cust-num = 10000 then leave.
end.
6. ls -l shows that sports_9.d1 grows to 622592k.
7. proutil sports ?C truncate area "New Area" - this simulates space being freed up in the database (e.g. by delete statements) and lowers the hiwater mark for the area. However, ls -l still shows that sports.d1 is still reported as 622592k.
8. mkdir copydir
9. procopy sports copydir/sports
10. ls -l copydir shows that sports_9.d1 is now back to 32768k.
If before procopying at step 9, records are added to the database, the hiwater mark is raised and the size of sports_9.d1 in the target database is correspondingly higher. That is -
9. proutil sports -C idxbuild and rebuild the indexes for the Customer table (Comments, Country-Post, Cust-Num, Name, Sales-Rep).
10. Under the Data Dictionary, disable the triggers for the Customer table.
11. pro sports -p addrecord.p but only create 5000 records this time.
12. ls -l still shows 622592 for sports_9.d1.
13. procopy sports copydir/sports
14. ls -l copydir shows 311296k for sports_9.d1.
So it can be seen that the space (empty blocks) above the hiwater mark is returned to the operating system by a procopy.