[firebird-support] Temporarily stop and disable garbage collection

2013-04-25 Thread Robert martin
Hi

We have a need to ensure garbage collection is not running in a given 
database.  Ideally we would stop / cancel any garbage collection in 
progress, do our stuff, then turn garbage collection back on.

Is this possible?

Thanks
Rob


Re: [firebird-support] Temporarily stop and disable garbage collection

2013-04-25 Thread eMeL

> Is this possible?

http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/gfix-cmdline.html

Sure.

see parameter: -housekeeping   set sweep interval 

usage: gfix [options] 
plausible options are:
 -activate   activate shadow file for database usage
 -attach shutdown new database attachments
 -buffersset page buffers 
 -commit commit transaction 
 -cache  shutdown cache manager
 -full   validate record fragments (-v)
 -force  force database shutdown
 -fetch_password fetch_password from file
 -housekeeping   set sweep interval 
 -ignore ignore checksum errors
 -kill   kill all unavailable shadow files
 -list   show limbo transactions
 -mend   prepare corrupt database for backup
 -mode   read_only or read_write
 -no_update  read-only validation (-v)
 -online database online 
 -prompt prompt for commit/rollback (-l)
 -password   default password
 -rollback   rollback transaction 
 -sql_dialectset database dialect n
 -sweep  force garbage collection
 -shut   shutdown 
 -two_phase  perform automated two-phase recovery
 -tran   shutdown transaction startup
 -useuse full or reserve space for versions
 -user   default user name
 -validate   validate database structure
 -write  write synchronously or asynchronously
 -z  print software version number

http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/gfix-housekeeping.html

Disabling Automatic Sweeping

If you set the sweep interval to zero then automatic sweeping will be 
disabled. This implies that there will be no automatic housekeeping done 
so your database performance will not suffer as a result of the 
processing requirements of the automatic sweep.


bye...
eMeL


Re: [firebird-support] Temporarily stop and disable garbage collection

2013-04-25 Thread Robert martin
>
> > Is this possible?
>
> http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/gfix-cmdline.html
>
> Sure.
>
> see parameter: -housekeeping set sweep interval 
>

Hi

I was probably not specific enough in my problem description :)

I know that I can disable garbage collection via the cmd line.  What I 
am looking for is the ability to...

1. Cancel any existing garbage collection
2. Disable garbage collection
3. Do my stuff
4. Re enable garbage collection.


I know I can to 2 and 4 via gFix but item 1 is the issue.   Also I would 
want to use the services manager rather than command line tools.

Thanks
Rob


Re: [firebird-support] Temporarily stop and disable garbage collection

2013-04-25 Thread Alexandre Benson Smith
Em 25/4/2013 21:58, Robert martin escreveu:
>>> Is this possible?
>> http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/gfix-cmdline.html
>>
>> Sure.
>>
>> see parameter: -housekeeping set sweep interval 
>>
> Hi
>
> I was probably not specific enough in my problem description :)
>
> I know that I can disable garbage collection via the cmd line.  What I
> am looking for is the ability to...
>
> 1. Cancel any existing garbage collection
> 2. Disable garbage collection
> 3. Do my stuff
> 4. Re enable garbage collection.
>
>
> I know I can to 2 and 4 via gFix but item 1 is the issue.   Also I would
> want to use the services manager rather than command line tools.
>
> Thanks
> Rob
>
>
>

GFIX will disable sweep.

Garbage Collection and Sweep is not the same thing.

There is a lot of detailed explanations about it, search for Ann 
messages and you will see the diference.

Besides the diference between Garbage Collection and Sweep, there are 
diferent modes of Garbage Collection in SuperServer x Classic Server.

AFAIR there is a parameter that you could use in your transaction (TPB 
parameter) that will disable garbage collection, this is the trick that 
gbak does when using the -g swiitch

see you !



Re: [firebird-support] Temporarily stop and disable garbage collection

2013-04-25 Thread Ann Harrison
Here's the discussion:

> >
> > I know that I can disable garbage collection via the cmd line.  What I
> > am looking for is the ability to...
> >
> > 1. Cancel any existing garbage collection
> > 2. Disable garbage collection
> > 3. Do my stuff
> > 4. Re enable garbage collection.
>

That's an odd request.  It could reflect one of two things:  a desire to
maintain
db_key stability or a misunderstanding of garbage collection.  The first is
possible.  The second is likely.  I'm going to assume the second, but would
like to understand what it is you think you're going to accomplish.

> >
> >
> > I know I can to 2 and 4 via gFix but item 1 is the issue.   Also I would
> > want to use the services manager rather than command line tools.
>
> You can't do 2 or 4 with gfix or anything else.  There is a TPB parameter
which gbak uses that tells the current transaction not to participate in
garbage collection, but that's probably not what you want.

Before I repeat my explanation of the purpose and implementation of
garbage collection, why don't you explain what you're trying to do.

Good luck,

Ann


[Non-text portions of this message have been removed]



Re: [firebird-support] Temporarily stop and disable garbage collection

2013-04-25 Thread Robert martin

> That's an odd request. It could reflect one of two things: a desire to
> maintain
> db_key stability or a misunderstanding of garbage collection. The first is
> possible. The second is likely. I'm going to assume the second, but would
> like to understand what it is you think you're going to accomplish.
>

Hi

Actually neither.  We have a process where the system does an backup and 
then restores back.  The process actually renames the source DB file, 
does the backup and then restores the backup with the initial file 
name.  We know that users are logged off because the application doing 
the process is the server part of a client/server system.

We have recently discovered this process sometimes fails because the 
file is in use.  My suspicion is that it is in use by the sweep process 
(which I apparently been incorrectly referring to as garbage 
collection).  Although all applications have disconnected from the 
database, the FDB file cannot be renamed.  Stopping the FB service 
allows a rename.

So It is something that FB is doing.


I don't really want to re design the above functionality if It can be 
avoided, so I thought I might be able to cancel the internal FB process 
before running the process !

Thanks
Rob



Re: [firebird-support] Temporarily stop and disable garbage collection

2013-05-01 Thread Ann Harrison
On Thu, Apr 25, 2013 at 11:53 PM, Robert martin  wrote:

>
> > ... a desire to
> > maintain
> > db_key stability or a misunderstanding of garbage collection.
> >
>
> Hi
>
> Actually neither.  We have a process where the system does an backup and
> then restores back.  The process actually renames the source DB file,
> does the backup and then restores the backup with the initial file
> name.  We know that users are logged off because the application doing
> the process is the server part of a client/server system.
>
> We have recently discovered this process sometimes fails because the
> file is in use.  My suspicion is that it is in use by the sweep process
> (which I apparently been incorrectly referring to as garbage
> collection).  Although all applications have disconnected from the
> database, the FDB file cannot be renamed.  Stopping the FB service
> allows a rename.
>

OK - the only safe thing to do is to shut down the server.  My recollection
is that the Firebird server keeps a database open for some period of time
after the last connection closes to avoid the cost of reconnection in an
environment where connections are short and frequent.

Sorry to be so long in answering - life intervened

Good luck,

Ann


[Non-text portions of this message have been removed]



Re: [firebird-support] Temporarily stop and disable garbage collection

2013-05-01 Thread Robert martin

>
> OK - the only safe thing to do is to shut down the server. My recollection
> is that the Firebird server keeps a database open for some period of time
> after the last connection closes to avoid the cost of reconnection in an
> environment where connections are short and frequent.
>
> Sorry to be so long in answering - life intervened
>


Hi

No problem Ann.  I appreciate your help with this !

I guess I will add that as an option to users experiencing the problem.  
The danger in shutting FB down is that any other databases that are in 
use will also be unavailable.

What about the shutdown option offered in gFix.  Would shutting a 
database down also cause FB to stop accessing it?  Could I 
programmatically shutdown the database (how?) copy my file and then mark 
it back as online ?

Cheers
Rob




Re: [firebird-support] Temporarily stop and disable garbage collection

2013-05-01 Thread Alan McDonald
If you set garbage collection to zero. Installed a scheduled sweep when you
know its a good time to do it and then do your back up well away from this
sweep. Wouldn't you avoid this whole issue?
Alan
On 26/04/2013 7:54 AM, "Robert martin"  wrote:

> Hi
>
> We have a need to ensure garbage collection is not running in a given
> database.  Ideally we would stop / cancel any garbage collection in
> progress, do our stuff, then turn garbage collection back on.
>
> Is this possible?
>
> Thanks
> Rob
>
>
> 
>
> ++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu.  Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++
> Yahoo! Groups Links
>
>
>
>


[Non-text portions of this message have been removed]



Re: [firebird-support] Temporarily stop and disable garbage collection

2013-05-01 Thread Robert martin
On 2/05/2013 10:36 a.m., Alan McDonald wrote:
>
> If you set garbage collection to zero. Installed a scheduled sweep 
> when you
> know its a good time to do it and then do your back up well away from this
> sweep. Wouldn't you avoid this whole issue?
> Alan
>


Hi Alan

Yes it might (and I may do that).  However others have implied their is 
a difference between garbage collection and a sweep.  Disabling a sweep 
might help but not fix the problem.

Cheers
Rob