Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need to know if interbase database file is in use or open

Posted on 2010-09-15
13
Medium Priority
?
763 Views
Last Modified: 2013-12-09
Hi

In my application i am using interbase database .gdb with firebird. Database file is on a local server. What i need to know before taking backup if the database file is in use from any other workstation.

If some application is using the database then i will display to user to close all instances first.

How can i figure that out...

Thanks,
Mahesh
0
Comment
Question by:ziorinfo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
  • +1
13 Comments
 
LVL 19

Expert Comment

by:NickUpson
ID: 33689533
a few things, if you are using a windows platform, the .gdb filename is not a good idea

it this an interbase or firebird database, if you are truly using an interbase database with firebird I strongly recommend you migrate the databse to firebird as well

do you realise that you can take a backup, using the gbak command, with other clients connected

what version (1.5, 2.0, 2.1, ...) and type (classic, super server) are you running?
0
 

Author Comment

by:ziorinfo
ID: 33690046
I am using 1.5 version of firebird...

Yes backing up while database is in use is ok...but during process i also need to restore database in current location...so for that if database is in use i won;t be able to do that.

I am not much familiar with firebird as such...but if  changing the db to firebird is a good option i would prefere to do that then.

Does firebird has any easy to use management GUI client tool.

0
 
LVL 19

Expert Comment

by:NickUpson
ID: 33690107
a common mistake is to backup & restore a database without testing that the backup is in fact restoreable, the sequence should be:

take backup
test backup restores ok
move restored database to original location

why are you actually doing this backup &  restore, I normally expect to this once or twice a year.

in fact I just thought if you are doing a backup, with the gbak tool of firebird, then the database is a firebird one now anyway. If you are using the gbak to of interbase then it is still interbase.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 33691402
On your question for GUI
For firebird database management you can use IBExpert.
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 33691535
there are several gui's, personally I like http://www.sqlly.com/
0
 
LVL 22

Expert Comment

by:8080_Diver
ID: 33692453
@NickUpson,
So , if you crash your database 10 days before your annual back up, you're okay with having to recover roughly 355 days worth of database transactions?  Or do you justt say, "The heck with it!", and then start over from the back up as though nothing had happened in between?
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 33692710
No, I take backups every night, and test that that can be recovered but that doesn't mean that you need to replace the live database every night - which was the part I refered to
0
 

Author Comment

by:ziorinfo
ID: 33695245
My requirement is something like this...

I have a dessktop application installed in two different location...when location one finishes the work....i have to upload the web location and then on second location i download that backup and restore it there..and do the same when on second location work is done....

so database goes back and form whenever needed. thats why i need to backup. And on one location this can be a local network setup...so before backing it up i need to know if it is in use...or even before restoring the database i again need to check if current local database is in use before overwriting that.
0
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 1000 total points
ID: 33698157
Try using TIBDatabaseInfo to check if there are any users currently active in your database, the UserNames property returns a list of users currently attached to the database

var
   IBDatabaseInfo: TIBDatabaseInfo;
 
   IBDatabaseInfo.UserNames
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 33699208
this depends upon you using classic or superserver version of firebird, classic does not track current users as each connection has it's own copy running.

I haven't tried this but I remember that attempting to rename the database will fail if a process is using it (on windows), so that could be your test
0
 

Author Comment

by:ziorinfo
ID: 33699796
NickUpson...you are right renaming is not allowed when database is in use...and i was doing that till now...but for that database folder has to be shared on network....if its not then this method fails...thats what happened in my situation...thats why i am looking at alternatives....

ewangoya: I will try IBDatabaseInfo i think this should work out for me,...

Thanks for your inputs..really appritiate it.

Mahesh
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 33699992
if superserver then checking the info should work, if classic then it cannot
0
 

Author Closing Comment

by:ziorinfo
ID: 33775719
Thanks for the good solution
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question