By default, databases are in read-write mode when created. Read-write databases cannot be on a read-only filesystem, even if they are used only for SELECT, because Firebird writes information about transaction states to a data structure in the database file.
A Firebird database can be deployed as a read-only file, providing the ability to distribute catalogs, albums of files, and other non-maintained types of database on CDs and other read-only filesystems. Read-only databases can, of course, be accessed on read-write systems as well.
A read-only database is not the same thing as a database file that has its read-only attribute set on. File-copying a read-write database to a CD-ROM does not make it into a read-only database.
The application will need to be written so as to avoid requests that involve writing to the database or to trap the exceptions raised when they are attempted. The following will throw the error “Attempt to write to a read-only database”:
Any accompanying files linked to the database by having been declared with CREATE TABLE tablename EXTERNAL FILE 'filename' will also be opened read-only, even if the file itself is not carrying the filesystem read-only attribute.
Making a Database Read-Only
Exclusive access is required to switch a database between read-write and read-only modes—see the section “Exclusive Access” in Chapter Housekeeping Tool (gfix) for instructions. The mode switch can be performed by the database owner or the SYSDBA.
Either fix or gbak can be used:
gbak -create -mode read_only db1.fbk db1.fdb
gfix -mode read_only db1.fdb
Firebird Related Interview Questions
|RDBMS Interview Questions||MySQL Interview Questions|
|Linux Interview Questions||Mac OS X Deployment Interview Questions|
|Windows Administration Interview Questions||Windows Server 2003 Interview Questions|
|SQL Interview Questions||NoSQL Interview Questions|
|Advanced C++ Interview Questions|
Introduction To Client/server Architecture
About Firebird Data Types
Date And Time Types
Blobs And Arrays
From Drawing Board To Database
Creating And Maintaining A Database
Firebird’s Sql Language
Expressions And Predicates
Querying Multiple Tables
Ordered And Aggregated Sets
Overview Of Firebird Transactions In
Programming With Transactions
Introduction To Firebird Programming
Developing Psql Modules
Error Handling And Events
Security In The Operating Environment
Configuration And Special Features
Interactive Sql Utility (isql)
Database Backup And Restore (gbak)
Housekeeping Tool (gfix)
Understanding The Lock Manager
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.