Pages

Thursday, 24 September 2015

Latest Firebird Interview Questions and Answers

21. how to extract metadata for the entire database? 
It’s quite simple, use isql with -x or -a options. Please be careful and test if it works. Some commercial administration tools like to play with system tables directly, and isql isn’t always able to understand their hacks
You can also extract DDL with FlameRobin Open the properties page for the database and select DDL option at the top.

22. How to export data from database and import into another? 
If your databases are on-line, i.e. visible to each other via network, then you can use some data pump tool like freeware lB Pump or some of advanced commercial administration tools which have this option integrated.
If your databases are offline, you should first export the data and then import it on the other end. Most admin. tools can do export to CVS,XML or INSERT statements. If efficiency is important, or your have data with BLOB column, you can use the open source FBExport tool.
If you are looking for a way to easily import CS\’ or XML data into Firebird, take a look at XMLWizard tool. You can also use it to import data from Microsoft Excel or OpenOffice by saving the sheet to .csv format and then importing via XMLWizard

23. how lo drop all foreign keys in database? 
Deleting all foreign keys can be done by querying the system tables and droping them one by one. If you use Firebird 2 or higher, it can be done with a single SQL statement:
set term!!;
EXECUTE BLOCK RETURNS (stmt VARCHAR(1 000)) AS
BEGIN
FOR
select ‘alter table ‘||r.rdb$relation_name ||’ drop constraint’|| ‘ r. rdb$constraint_name||’;’ from rdb$relation _constraints r
where (r. rdb$constraint_type=’FORETGN KEY’)
into :stmt
DO begin suspend; execute statement :stmt; end
END!!
set term; !!
If you use Firebird i .x, you can run the following query to get statements to execute and then copy/paste the result and execute:
select ‘ALTER TABLE’ ||r. rdb$relat ion_name
||’DROP CONSTRAINT’|| r. rdb$constraint_name||’:’
from rdb$relation_constraints r
where (r.rdb$constraint_type=’FORETGN KEY’)

24. how to do replication of Firebird databases? 
Firebird does not offer replication out-of-the-box, you need to use some 3rd party tools. Those external tools add specific triggers that log all the changes in database and
replicate to other databases.

25. How to disconnect the user connection? 
Currently there is no easy way of doing it. You can bring database to some of shutdown modes, but it affects all users. If you use Classic you can (with some effort) find the users process by detecting the IP address and open database files of that process and simply kill that process. With Super Server it is not possible as the connection is run in a thread of’
multithreaded SuperServer process.
There are plans for future versions of Firebird to address this. For example. version 2.1 introduces ability to cancel running queries (by deleting the relevant records from
MON$STATEMENTS table).

More Questions & Answers:-

No comments:

Post a Comment