hfcs19 - timestamp of files

Startbeitrag von Arie am 29.01.2015 11:00

Hi,
I have a hfsql server holding a database of one of my projects.
Every day new info is added by users. But the corresponding FIC file still has a "changed date" of 20 january 2015.
How is that possible?
When I use WDMAP to look into the file, without shutting down the hfcs, it opens the file in read-only, because it i still in use by the hfcs-server. But I can see all data of today and yesterday and so on.

So the data definitely IS in the file. But when using the windows file explorer the FIC,NDX and MMO files have a timestamp of a week ago?!?!
This way my backup-tool, doing differential backups, skips these files.

note: I think if I restart the server the timestamps will change, but at the moment that is not an option

Antworten:

Hi Arie

I haven't tested that point, so the following are just my thought on the subject:

1. it's probably an optimisation... An other way would oblige the system to update the datetime of the file each time something is written in the DB (and may means several hundreds of times per second), thus DOUBLING the writing operations, and making the harddrive heads doing a continuous back and forth between the data position and the date/time position... I would think that this is something a DB engine would avoid at all cost.

2. It's a bad idea to try to backup the LIVE files of a database, as the engine is writing in those at the same time the backup is being done, thus resulting into a potentially incorrect content... A better idea would be to setup an automatic local backup of the DB made by the HFSQL engine itself, THEN run the external tool to backup the BACKUP files somewhere else...

Best regards

von Fabrice Harari - am 29.01.2015 13:42
OK, both point makes sense. About 1, I thought the timestamp would at least change every now and then. I have a file now changing numerous time per day, but still having a file-timestamp 7 days old.

In this particular situation the backup is at night and users are only working during daytime. So that gives me a consistent backup, or not?

Backup by HFSQL is very, very slow though, because it does a record-by-record backup. (most probably because of the way the HOT backup feature is implemented?). I'm talking about 50GB+ files holding photos.

That;s why I'm looking for ways of getting a faster backup. Another option would be to start a script which shuts down the hfsql, copies all files and then restarts the engine again.

von Arie - am 29.01.2015 14:41
Arie,

After you write content to the file do you close the file or is it open all the time? I suspect the stamps are only updated when the application releases them.

j

von JP - am 29.01.2015 15:02
Hello again

if nobody is working on the files during the backup then yes, data should be consistent and yor backup too...

HF backup is done that way in order to make sure DB is consistent (as it is basically the only way with a LIVE db)

So, yes, if you can stop the HF engine, then the correct solution would be to stop it, copy the whole DB, then restart it... You would still have the whole 50 GB to copy though...

Another solution would be to implement a replication system, with one or several other servers just being the backups..

Best regards

von Fabrice Harari - am 29.01.2015 15:18
Hi Arie,

that´s the reason why I never put files in the DB (only the path and the filename)
You can use the HF SQL Hot Backup and your Backup-Tool can make a extra backup from the files.
Both is then very fast.

von Michael Drechsel - am 29.01.2015 15:44
Michael,
you have a good point. When fist designing this application I have thought about it either. After all pros and cons I made up my mind.
The good thing about images in the database is, that I only need to communicate over a tcp/ip port to get ALL data i need, inlucding the images. No need for file access what so ever. That's important in my situation where there are a number of people working form home. And setting up a VPN wasn't an option for my client.
I do BTW save the images as local files on the as well, using a stored proc. But that's just to have a backup for that very one moment where the MMO file gets completely corrupt. Which after a few years never did.

von Arie - am 29.01.2015 18:09
JP,
that could very well be it!
I have a scheduler running, exporting data every hour. It looks like it keeps an open connection for ever.
Thanks

von Arie - am 29.01.2015 18:58
>The good thing about images in the database is, that I only need to communicate over a tcp/ip port to get ALL data i need

We use FTP for filetransfer, but in my new application we will do this with a webservice. A little bit slower, but very Firewall friendly ...

von Michael Drechsel - am 29.01.2015 21:04
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.