Re: [firebird-support] detect if database has changed

2018-01-02 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
There are several ways for doing that.

One of them, is to create a table, called CHANGES, by example, and with the
columns: TABLENAME, USERNAME, DATEANDTIME, etc.

Then, for each table of your interest, you create a trigger which inserts a
row in the table CHANGES when a user do an INSERT, UPDATE, or DELETE in
such table.

This way, you can always know when was the last time someone did an INSERT,
UPDATE, or DELETE in the interesting tables.

If you want a table with few rows, then you can have in your table CHANGES
a row for each table and the columns LASTINSERT, LASTUPDATE, LASTDELETE.
So, if you are interested in 20 tables, your table CHANGES will have 20
rows. The problem will be the frequents deadlocks if you don't manage well
your transactions.

Greetings.

Walter.

On Mon, Oct 9, 2017 at 5:06 AM, liviuslivius liviusliv...@poczta.onet.pl
[firebird-support]  wrote:

>
>
> Hi,
>
> You can also look at sample at
>
> http://itstop.pl/pl-pl/porady/Firebird/FAQ1/czas-ostatniej-
> modyfikacji-tabeli
>
> It is in PL lang but triggers are fully descriptive. I prefer generator
> based approach
>
>
> Regards,
> Karol Bieniaszewski
>
> 
>


Re: [firebird-support] detect if database has changed

2017-10-09 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi,
You can also look at sample at
http://itstop.pl/pl-pl/porady/Firebird/FAQ1/czas-ostatniej-modyfikacji-tabeli
It is in PL lang but triggers are fully descriptive. I prefer generator based 
approach

Regards,Karol Bieniaszewski
null

Re: [firebird-support] detect if database has changed

2017-10-09 Thread Alexey Kovyazin a...@ib-aid.com [firebird-support]

Hi,

Look at System Audit feature.

Regards,
Alexey Kovyazin
IBSurgeon HQbird
www.ib-aid.com

On 09.10.2017 2:49, Hamish Moffatt ham...@risingsoftware.com 
[firebird-support] wrote:


Is there an official way to detect if a database has changed?

I have some expensive reports and backups to run, but if I know that the
database has not changed since I last ran them I can skip those.

fbstat (gstat) shows the next transaction number, but that changes even
when only read-only transactions have run.

Currently I am looking at the timestamp of the .fdb file, which also
changes when only read-only transactions run.

I would like to know if the data or schema actually changed, not just a
transaction has run that didn't change anything.

Thanks

Hamish