[firebird-support] Newbies queries on type of data files and recovery options
Hi, I am a SQL Server and MySQL developer. I am aware of Firebird but never got opportunity to work with it. I want to use Firebird in one of my upcoming project replacing MySQL. While reading the documentation of Firebird, I learned that it supports single as well as multiple database files option. I have few queries in this regard: 1. Which is the recommended data file structure: `Single file` or `Multiple files`? 2. What is the table and data file max-size for version 2.5? 3. What are the common scenarios of a Firebird data file getting corrupt? In case of a single-file structure, I guess no other files need to be backed up? Regards, Rohit. [Non-text portions of this message have been removed]
Re: [firebird-support] Newbies queries on type of data files and recovery options
Hi Rohit Coder, welcome to Firebird! 1. Which is the recommended data file structure: `Single file` or `Multiple files`? I'll pass on this one. I may give wrong information. 2. What is the table and data file max-size for version 2.5? Ditto. 3. What are the common scenarios of a Firebird data file getting corrupt? In case of a single-file structure, I guess no other files need to be backed up? Some common backup scenarios are detailed in the gbak manual which you can find online here as HTML - http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/gbak.html or here as a pdf - http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/Firebird-gbak.pdf. The specific chapter you want is at http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/gbak-recipies.html where various recipies for diffrent backups and restores can be found. Also there is information on why you shouldn't just 'cp' the database file(s) and call that a backup! There is also a manual for the nbackup tool at http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/nbackup.html and also at http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/Firebird-nbackup.pdf. There may be something in the above that answers your query. HTH Cheers, Norm. -- Norman Dunbar Dunbar IT Consultants Ltd Registered address: Thorpe House 61 Richardshaw Lane Pudsey West Yorkshire United Kingdom LS28 7EL Company Number: 05132767
Re: [firebird-support] Newbies queries on type of data files and recovery options
Hi Rohit, I am a SQL Server and MySQL developer. ] 'welcome! 1. Which is the recommended data file structure: `Single file` or `Multiple files`? Single file. The multiple file structure was invented when databases were bigger than disks. Even the multiple-file configuration mixes tables, indexes, metadata, and structural data within the file. 2. What is the table and data file max-size for version 2.5? I think it's 32K * the page size. Huge. 3. What are the common scenarios of a Firebird data file getting corrupt? In case of a single-file structure, I guess no other files need to be backed up Fortunately, there are no common scenarios of a Firebird database getting corrupt. It can happen if there are memory or disk errors, and the occasional bug. The last one that happened with regularity could be fixed by rebuilding an index. Norman has already provided lots of pointers to documentation on various backup options. Other files that you need to backup include any UDF libraries you use or create, the configuration file, and the security database. Good luck, Ann [Non-text portions of this message have been removed]
Re: [firebird-support] Newbies queries on type of data files and recovery options
On Wed, Sep 28, 2011 at 15:58, Rohit Coder passionate_program...@hotmail.com wrote: 2. What is the table and data file max-size for version 2.5? http://www.firebirdfaq.org/faq61/ 3. What are the common scenarios of a Firebird data file getting corrupt? In case of a single-file structure, I guess no other files need to be backed up? In over ten years the only corruptions I've seen were due to 1) Full hard disk: IIRC in this case Firebird will overwrite the file from the beginning. Not good, but checking for free space on every write would slow down writes too much. Just make sure you have enough space. 2) Sudden power loss: Normally Firebird will just throw away the last unfinished transaction, sometimes a quick (seconds in my cases) repair with gfix tool was needed. 3) Not really a corruption but it comes up here occasionally so I'll mention it: You can add a NOT NULL column to an existing table that already contains records. Then it's up to you to fill that column with values, or else Firebird will complain when you next *restore* the database from a backup. But there's a command line switch to ignore that complaining, so it's not a big problem. HTH, Markus
Re: [firebird-support] Newbies queries on type of data files and recovery options
Hello, 3. What are the common scenarios of a Firebird data file getting corrupt? In case of a single-file structure, I guess no other files need to be backed up? There are some articles on our site Firebird and InterBase corruptions reasons http://www.ib-aid.com/articles/item70 Common InterBase/Firebird errors caused by corruptions and their recovery chances http://www.ib-aid.com/articles/item69 and ppt Firebird Anti-corruption approach http://www.slideshare.net/ibsurgeon/firebird-anticorruption-approach In over ten years the only corruptions I've seen were due to 1) Full hard disk: IIRC in this case Firebird will overwrite the file from the beginning. Not good, but checking for free space on every write would slow down writes too much. Just make sure you have enough space. This is far from true. Overwriting was an issue in Interbase 5.x. Lack of free space was solved with pre-allocation in recent Firebird versions - it will raise non-critical error. Regards, Alexey Kovyazin IBSurgeon [Non-text portions of this message have been removed]
Re: [firebird-support] Newbies queries on type of data files and recovery options
On Wed, 28 Sep 2011 11:52:01 -0400, Ann Harrison aharri...@ibphoenix.com wrote: 2. What is the table and data file max-size for version 2.5? I think it's 32K * the page size. Huge. Hi Ann, I assume you mean something like 2^32 * pagesize, because 32K * a pagesize of 16K isn't that much (roughly 512MB) :P Mark
Re: [firebird-support] Newbies queries on type of data files and recovery options
On Wed, Sep 28, 2011 at 18:48, Alexey Kovyazin a...@ib-aid.com wrote: 1) Full hard disk: IIRC in this case Firebird will overwrite the file from the beginning. Not good, but checking for free space on every write would slow down writes too much. Just make sure you have enough space. This is far from true. Overwriting was an issue in Interbase 5.x. Lack of free space was solved with pre-allocation in recent Firebird versions - it will raise non-critical error. Thanks for the correction. I knew it was a long time ago =)
[firebird-support] firebird web database
Hi, I want to use firebird single file database for my ASP.NET web application. I want to know how to host a firebird DB? Regards, Rohit. [Non-text portions of this message have been removed]
[firebird-support] UDA returning arithmetic exception, numeric overflow, or string truncation
I am working in an older version of IB that does not have the GEN_UUID() function, so I am working on implementing the function as a UDF, but it is giving me an arithmetic exception, numeric overflow, or string truncation. I looking at the FB source to see how it is implemented there, but internal functions are implemented in noticeably different ways then an UDF. Here is what I got: char* EXPORT fn_GEN_UUID() { int size = sizeof(GUID) + 1; GUID *guidBuff = (GUID*) ib_util_malloc(size); ::ZeroMemory(guidBuff, size); ::CoCreateGuid(guidBuff); return (char *) guidBuff; } /* - */ DECLARE EXTERNAL FUNCTION GEN_UUID RETURNS CHAR(16) FREE_IT ENTRY_POINT 'fn_GEN_UUID' MODULE_NAME 'UDF_GEN_UUID'; CREATE DOMAIN UNIQUEIDENTIFIER AS CHAR(16) CHARACTER SET OCTETS NOT NULL COLLATE OCTETS; CREATE TABLE TEST_UUID ( PKID INTEGER NOT NULL, UUID_VALUEUNIQUEIDENTIFIER ); /* - */ INSERT INTO TEST_UUID ( PKID, UUID_VALUE) VALUES ( 1, GEN_UUID());
[firebird-support] Not able to migrate MySQL database using:
I tried to migrate MySQL DB to Firebird 2.5 IB DataPump, but migration fails. It successfully gets connected to MySQL (Source DB), but it is unable to set relationship to the Firebird (Target DB). Sometimes it even doesn't displays MySQL Provider in the ADO Source of the Source DB. Is there any other free tool to do the job? . Rohit. [Non-text portions of this message have been removed]