![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Naveen, When a record is deleted from a database the space from that record is generally available for use by records that would fall on the same page as the deleted record. If all records on a page are deleted that page is put on a free list in the file (unless it happens to be the last page of the file, in which case it is returned to the file system). Pages on the free list are availble to be used by any database in the file. The DB->compact method is available in release 4.4. I suspect you are using an eariler release. Michael Ubell Sleepycat Software. |
#4
| |||
| |||
|
|
Am using the latest version of Berkeley DB 4.4.20 and I found the compact member in the db.h header file. |
#5
| |||
| |||
|
|
* Naveen: Am using the latest version of Berkeley DB 4.4.20 and I found the compact member in the db.h header file. It's likely that your compiler picks up the wrong version of the file. Try to specify "-I/opt/BerkeleyDB4.2/include" (or whatever path you use) on the compiler command line. |
#6
| |||
| |||
|
|
Florian Weimer wrote: * Naveen: Am using the latest version of Berkeley DB 4.4.20 and I found the compact member in the db.h header file. It's likely that your compiler picks up the wrong version of the file. Try to specify "-I/opt/BerkeleyDB4.2/include" (or whatever path you use) on the compiler command line. Thanks Florian. It worked !!!!!!!!!! But I found another problem, when i execute the program the open database fails and shows unknown error !!!!! But when I remove compact() function and then compile as usual( gcc -ldb pgmname) it works. !!! Why is it like that ?? |
#7
| |||
| |||
|
|
* Naveen: Florian Weimer wrote: * Naveen: Am using the latest version of Berkeley DB 4.4.20 and I found the compact member in the db.h header file. It's likely that your compiler picks up the wrong version of the file. Try to specify "-I/opt/BerkeleyDB4.2/include" (or whatever path you use) on the compiler command line. Thanks Florian. It worked !!!!!!!!!! But I found another problem, when i execute the program the open database fails and shows unknown error !!!!! But when I remove compact() function and then compile as usual( gcc -ldb pgmname) it works. !!! Why is it like that ?? You probably need to specify the correct path to the Berkeley DB library, using "-L/opt/BerkeleyDB4.2/lib". |
#8
| |||
| |||
|
|
Yes, thats working .... But now I have found two files of db.h...One is the older version and other is the new one. |
#9
| |||
| |||
|
|
* Naveen: Yes, thats working .... But now I have found two files of db.h...One is the older version and other is the new one. You also need the correct copy of libdb.a. Usually, this means that you need to change the linker search path with "-L". |
![]() |
| Thread Tools | |
| Display Modes | |
| |