Re: [firebird-support] from FB 2.5.2 to 2.5.6 and C application

2016-07-26 Thread ehmmm.fireb...@seznam.cz [firebird-support]
Adding some notes:

Examples stat3.e and stat5.e from /opt/firebird/examples/stat/ don't work, 
while stat2.e works.
I'm getting the same -901 "request synchronization error".

Steps to reproduce:

Extract somewhere FirebirdCS-2.5.6.27020-0.i686.tar.gz
"su" to be root.
Run install.sh, creates backup, ask for password.
Replace /opt/firebird/security2.fdb with symlink to reallife security2.fdb.
Get /etc/init.d/firebird from somewhere.
service firebird start

cd /opt/firebird/examples/stat
cp ../include/example.h .
/opt/firebird/bin/gpre -d employee.fdb stat2.e
export ISC_USER=sysdba
export ISC_PASSWORD=...
export ISC_DATABASE=employee.fdb
cc -lfbclient stat2.c -o stat2
./stat2
(Same for stat3.e and stat5.e)

Like I said, in FB 2.5.6 stat3 and stat5 throw error.
If I do the same with FB 2.5.5 then these examples work.



-- Původní zpráva --
Od: ehmmm.fireb...@seznam.cz [firebird-support] 
Komu: firebird-support@yahoogroups.com
Datum: 26. 7. 2016 20:46:58
Předmět: [firebird-support] from FB 2.5.2 to 2.5.6 and C application

"
  



Hi,
we have server with Debian 6.0 squeeze and there we have Firebird 2.5.2 
(superclassic) which sometimes hangs and I don't know why.
So my idea was to install there FB 2.5.6.
I downloaded FB 2.5.6 superclassic i686 (debian is amd64 but previous 
firebird seems to be i686 so I decided to continue using i686) tar.gz, 
extracted it and executed install.sh.
I think I was quite successful. I didn't make backups of *.fdb files, I only
copied older security2.fdb into /opt/firebird and copied some init script 
from /opet/firebird/misc into /etc/init.d
My PHP webapges work well, my Python apps work well, FlameRobin works well.
The only problem I have with some old C programs running on the same server,
precompiled via GPRE utility.
These C apps fail for example on then line (just example) EXEC SQL FETCH cur
_al...:

int i, id, status;

EXEC SQL CONNECT DB USER '...' PASSWORD '...';
EXEC SQL SET TRANSACTION READ WRITE WAIT ISOLATION LEVEL READ COMMITTED;

EXEC SQL DECLARE cur_al CURSOR FOR SELECT id_blabla, status FROM blabla;

EXEC SQL OPEN cur_al;
while(SQLCODE == 0) {
    EXEC SQL FETCH cur_al INTO :id, :status;
    if (SQLCODE == 0) { ... }
}

EXEC SQL CLOSE cur_al;

...

It throws error -901 and messages "Unsuccessful execution caused by system 
error that does not preclude successful execution of subsequent statements" 
and "request synchronization error".

I'm not author of these C apps and I'm not very skilled in C on linux, I 
only found some Makefile so I tried run "make". But it didn't help.

What should I try? Should I look somewhere for some libraries?

The most interesting for me is that when I download and install FB 2.5.5 or 
2.5.4 (I must admit that upgrading/downgrading firebird inside 2.5.x is 
quite easy) then these C apps seems to work correctly. (?) Is there any 
explanation for this?

=




"=

Re: [firebird-support] Occasionally need to specify port number in connectiong string to connect over network

2016-07-26 Thread Rodney Tapit rodta...@gmail.com [firebird-support]
Thank you we will look into it and update when we have more info.
Rodney.

On Wed, Jul 27, 2016 at 4:49 AM, Dimitry Sibiryakov s...@ibphoenix.com
[firebird-support]  wrote:

> 26.07.2016 12:35, Rodney Tapit rodta...@gmail.com [firebird-support]
> wrote:
> > Can you please advise what factors govern whether the port number needs
> to be included
> > given that the RemoteServicePort  is defined in the firebird.conf?
>
>In such cases your application, probably, uses different client library
> that cannot
> find firebird.conf with your changes. Use Process Monitor to find out were
> firebird.conf
> is looked for and why.
>
>
> --
>WBR, SD.
>
>
> 
>
> 
>
> ++
>
> Visit http://www.firebirdsql.org and click the Documentation item
> on the main (top) menu.  Try FAQ and other links from the left-side menu
> there.
>
> Also search the knowledgebases at
> http://www.ibphoenix.com/resources/documents/
>
> ++
> 
>
> Yahoo Groups Links
>
>
>
>


Re: [firebird-support] Occasionally need to specify port number in connectiong string to connect over network

2016-07-26 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
26.07.2016 12:35, Rodney Tapit rodta...@gmail.com [firebird-support] wrote:
> Can you please advise what factors govern whether the port number needs to be 
> included
> given that the RemoteServicePort  is defined in the firebird.conf?

   In such cases your application, probably, uses different client library that 
cannot 
find firebird.conf with your changes. Use Process Monitor to find out were 
firebird.conf 
is looked for and why.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



[firebird-support] from FB 2.5.2 to 2.5.6 and C application

2016-07-26 Thread ehmmm.fireb...@seznam.cz [firebird-support]
Hi,
we have server with Debian 6.0 squeeze and there we have Firebird 2.5.2
(superclassic) which sometimes hangs and I don't know why.
So my idea was to install there FB 2.5.6.
I downloaded FB 2.5.6 superclassic i686 (debian is amd64 but previous
firebird seems to be i686 so I decided to continue using i686) tar.gz,
extracted it and executed install.sh.
I think I was quite successful. I didn't make backups of *.fdb files, I only
copied older security2.fdb into /opt/firebird and copied some init script
from /opet/firebird/misc into /etc/init.d
My PHP webapges work well, my Python apps work well, FlameRobin works well.
The only problem I have with some old C programs running on the same server,
precompiled via GPRE utility.
These C apps fail for example on then line (just example) EXEC SQL FETCH cur
_al...:


int i, id, status;


EXEC SQL CONNECT DB USER '...' PASSWORD '...';
EXEC SQL SET TRANSACTION READ WRITE WAIT ISOLATION LEVEL READ COMMITTED;


EXEC SQL DECLARE cur_al CURSOR FOR SELECT id_blabla, status FROM blabla;


EXEC SQL OPEN cur_al;
while(SQLCODE == 0) {
    EXEC SQL FETCH cur_al INTO :id, :status;
    if (SQLCODE == 0) { ... }
}


EXEC SQL CLOSE cur_al;


...


It throws error -901 and messages "Unsuccessful execution caused by system
error that does not preclude successful execution of subsequent statements"
and "request synchronization error".


I'm not author of these C apps and I'm not very skilled in C on linux, I
only found some Makefile so I tried run "make". But it didn't help.


What should I try? Should I look somewhere for some libraries?


The most interesting for me is that when I download and install FB 2.5.5 or
2.5.4 (I must admit that upgrading/downgrading firebird inside 2.5.x is
quite easy) then these C apps seems to work correctly. (?) Is there any
explanation for this?


=

[firebird-support] Occasionally need to specify port number in connectiong string to connect over network

2016-07-26 Thread Rodney Tapit rodta...@gmail.com [firebird-support]
We are using Firebird 2.5 in our Windows (7, 8,10) based application in a
network situation.
We use a different port from the default 3050 for the application. We have
edited the RemoteServicePort in the firebird.conf to reflect the port
number we are using.
The client connection strings we normally use is:  192.168.0.1:alias


But occasionally, on some network installations in order to establish
connection we have to specify the port number:  192.168.0.1/portnumber:alias


We would rather not specify the port number on the connection string for
security reasons.


Can you please advise what factors govern whether the port number needs to
be included given that the RemoteServicePort  is defined in the
firebird.conf?


Regards,


Rodney


Re: [firebird-support] Database/Backup consistency check

2016-07-26 Thread Ann Harrison aharri...@ibphoenix.com [firebird-support]
On Mon, Jul 4, 2016 at 2:52 PM, 'Steffen Heil (Mailinglisten)'
li...@steffen-heil.de [firebird-support] 
wrote:

Late, but I was away...

>
> I have a database on a hard drive which is failing. The hard drive already
> has some bad sectors and we are about to replace it.
>
> Now I have a backup of that database created with gbak that I could use.
> However I am not sure if the hard drive was still fine, when the backup was
> created.
>

If the backup succeeded, then the database file had no corrupted data pages
or system pages.  It might have corrupted pages in indexes on user tables.


> On the other hand, I can right now access the database just fine and I
> could try to simply copy it.


Copying it is a good option if a backup fails - you'll have something to
try to recover from.

As third option I could create a new backup to external media right now.
>

That would have been the best option.  If the backup succeeded, then you
would know that all your data is fine and up to date.

>
> Now my questions:
> - Is there any way to check a copied database file for corruption?

If the file copy works without error (no file system I/O error) can I be
> sure or is there a command to be sure, if the file is completely intact?
>

Gfix -v works on the physical level.  Backup or sweep checks the logical
consistency of data and system structures but not user indexes.


> - If I restore the backup and gbak does not report an error, can I be sure
> that everything is okay?
>

Yes.  If there were bad index pages, they will be replaced.


> - If I create a new backup and gbak does not report an error, can I be
> sure that the new backup is okay?
>

Yes, the backup will be OK - yes there have been bugs in backup but they
were generally mishandled dependencies ... not bad pages

>
> There used to be a checksum in the page header, but IIRC that field was
> abandoned.
>

Decades ago.


Good luck,

Ann


Re: [firebird-support] Database design. Simple question!

2016-07-26 Thread Ann Harrison aharri...@ibphoenix.com [firebird-support]
On Mon, Jul 25, 2016 at 5:51 PM, shg_siste...@yahoo.com.ar
[firebird-support]  wrote:
>
> Hello! I  have a FB 2.5 database with a tabla "invoices". I need to add a
> field in that table which will be null most of the times. Lefts say, that
> 90% of the records will have this new field in null.
>
> What is your advice? To create a new table with a FK to "invoices" and
> save the needed field in a separate table (only when the value is not null
> of course)
>
Each record in the second table would incur nearly bytes of storage
overhead.  The outer join to put together the full record can make query
optimization difficult.  Really, that's a bad idea.


> or just create the new field in the main "invoices" table? I think I read
> somewhere that null fields use very little space in the database. Is that
> true?
>
Null fields take up very little space.  Every record has space for a null
flag for each field in the record.  The space is there whether or not the
field is null.  A null field is filled with spaces or zeros, depending on
the type. Run-length compression will probably make it disappear.

But seriously, people, don't worry so much about data size!  The basic ODS
on which Firebird is built was designed in 1984 - thirty-two years ago!
Back then, DEC, where Jim and I worked, had three database groups.  We got
together and asked management if there was some way we could get a gigabyte
of disk to do some performance and limits testing.  Management said, "NO.
Too expensive.  No real world application will see those limits."  DEC made
disks and our group was part of disk engineering.  Now you can get 5TB for
$120.  Yes, dense records reduce the amount of I/O, but remember that
Firebird was designed for small disks and almost no memory - it's miserly
about space.

Good luck,

Ann


Re: was [firebird-support] Delete visibility - now bonehead insert/delete with generators

2016-07-26 Thread Ann Harrison aharri...@ibphoenix.com [firebird-support]
On Sun, Jul 3, 2016 at 5:17 PM, 'Daniel Miller' dmil...@amfes.com
[firebird-support]  wrote:

>
>
> Still haven't answered my visibility question - but figured out the
> brilliant bug I implemented which caused me to question things.  I have a
> primary key defined as a Smallint and an associated generator.
>

There is no reason in the world to sue a small integer (or worse, a float)
given the cost and size of modern disks.

Good luck,

Ann


Re: {Disarmed} Re: [firebird-support] Database design. Simple question!

2016-07-26 Thread Elmar Haneke el...@haneke.de [firebird-support]
> To have a separate table for a single column is a good idea if the
> column will be of type BLOB and will be used just sometimes.

Since BLOB are stored outside the table that is not an good idea: As
long as no data is stored there is only the space for an Pointer
reserved in table.

Elmar