Is possible to remove Firebird deleted records from database

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

sfxcc
Senior Boarder
Senior Boarder
Posts: 95
Joined: 13.05.2010, 18:48

Is possible to remove Firebird deleted records from database

Postby sfxcc » 17.06.2011, 18:08

Is possible to remove Firebird deleted records from database????

i inserted records on a db till 130 MB

I deleted 100 mB .
I used Sweep from IBO but file still haves 130 MB.

How can i remove it from File ?????

And How can i change transact isolation to READ COMMIT on ZeosLib ????
where's the code ..

User avatar
Pitfiend
Senior Boarder
Senior Boarder
Posts: 65
Joined: 12.12.2009, 07:27

Postby Pitfiend » 17.06.2011, 20:07

As long as I know that kind of operation depends on the engine features. For example in SQLite you have vacuum that remove unused space. I think that you need to take a look into the firebird sql dialect to find an equivalent. Take in mind that there's no guarantee to have one.

sfxcc
Senior Boarder
Senior Boarder
Posts: 95
Joined: 13.05.2010, 18:48

Postby sfxcc » 18.06.2011, 14:40

I have use Sweep from IBO doesnt this a firebird internal function ????
where's the code ..

User avatar
Pitfiend
Senior Boarder
Senior Boarder
Posts: 65
Joined: 12.12.2009, 07:27

Postby Pitfiend » 18.06.2011, 20:42

Don't know, never used Firebird before.

seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Postby seawolf » 20.06.2011, 22:20

At the moment Zeos does not support this kind of command.
I mean this command are very specific so they are called by the firebird dll
but, are currently not supported

User avatar
Pitfiend
Senior Boarder
Senior Boarder
Posts: 65
Joined: 12.12.2009, 07:27

Postby Pitfiend » 22.06.2011, 04:10

I think that even if not supported by Zeoslib, you can still use that kind of specific commands through a zquery, don't you?

duzenko
Junior Boarder
Junior Boarder
Posts: 32
Joined: 17.06.2009, 11:24

Postby duzenko » 22.06.2011, 08:59

I think firebird developers suppose that you should backup the database and then restore from the backup

seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Postby seawolf » 22.06.2011, 16:50

Is not so simple as you supporse.
Sweep command is a service command, so you need initialize it and then
execute it.
You can call the dlls, but it is not so simple becuse it is necessary call several
methods

sfxcc
Senior Boarder
Senior Boarder
Posts: 95
Joined: 13.05.2010, 18:48

Postby sfxcc » 01.07.2011, 11:46

Ok, but i uses the IBO program sweep (Pressd the button) so i should do the job and it still the same size.


???? not a backup.. because if is working on the client it should work all day (add remove records)
Who can i do remove the records without recreate and coping it "manually" (from one to other new database )
where's the code ..

seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Postby seawolf » 01.07.2011, 14:26

Ok, you can call the gfix program instead of the dlls. Sounds good.
Eventually try this example

Sweep Database now

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -sweep

Set Sweep Interval to 50000 transactions

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -h 50000

Or call it every night :wink:

marsupilami
Gold Boarder
Gold Boarder
Posts: 581
Joined: 17.01.2011, 14:17

Postby marsupilami » 03.07.2011, 09:11

Hello sfxcc,

as far as I understand firebird, sweeping is not for actually shrinking the size of the database file. Sweeping checks the internal DB structures for outdated records and marks the space they occupy to be usable again. This way the engine can reuse the space for newly inserted records.
This means in normal operation the database file will only grow but never shrink. But normally the size of the file stabilizes after some time and only grows if you insert more records than you delete.
The only way of actually shrinking the size of the database file is to have a full backup - restore cycle.


Return to “Firebird”

Who is online

Users browsing this forum: No registered users and 1 guest