Pages

Thursday, 24 September 2015

Freshers Firebird Interview Questions and Answers pdf

11. How to detect the server version? 
You can get this via Firebird Service API. It does not work for Firebird Classic 1.0, so if you don’t get an answer you’ll know it’s Firebird Classic 1.0 or InterBase Classic 6.0. Otherwise it returns a string like this:
LI-V2.0.0. 12748 Firebird 2.0
or...
U-V1 .5.3.4870 Firebird 1.5
The use of API depends on programming language and connectivity library you use. Some might even not provide it. Those that do, call the isc_info_svc_server_version API.
If you use Firebird 2.1, you can also retrieve the engine version from a global context variable, like this:
SELECT rdbSget_context(’SYSTEM’, ‘ENGINE VERSION’)
from rdbSdatabase ;

12. How to determine who is and change the owner of database? 
Use the following query:
SELECT DISTINCT RDBSO WNER NAME AS DATABASE OWNER
FROM RDB$RELATIONS
WHERE (RDB$SYSTEM FLAG = 1 )
Please note that in order to change the owner, it is not enough (or even advisable) to change this column only, as many other metadata fields are involved (there are multiple tables which have this field and SQL privileges need to be updated as well). There is a handy tool by Thomas Steinmaurer that can do this automatically, but you’ll have to email him directly to get it.

13. How to pipe multiline string to isqi? 
Using Bash shell you may use the following construct:
{
echo “DROP VIEW vi;”
echo “CREATE VIEW..”
} isqi -user SYSDBA -pass masterkey srv:db
each echo statement outputs newline at the end.
Because that’s a lot of writing, use the so called ‘document here’ feature of the shell:
cat <<- _END_ I isql  user SYSDBA -pass masterkey srv:db
DROP VIEW v1;
CREATE VIEW..
END

14. how to open the database in exclusive mode? 
You need to shutdown the database (using gfix or some other tool). Firebird 2.0 offers various shutdown modes (single-user, single-connection, multiple connection, etc.). Take a look at Firebird 2 release notes for details

15. how to move a multi-file database? 
You are probably used to having a single-file database which you can move around as much as you want. But, your database has grown too big and now you need a multi-file database. Paths to the secondary files are absolute and stored in the header page of the first database file. If you need to move those files, it is recommended that you backup the database and restore at new location. However, if you really, really need to copy them around, you can use freeware tool G1.ink by Ivan Prenosil:

More Questions & Answers:-

No comments:

Post a Comment