Re: [Firebird-devel] Firebird 4 Install and replication

2021-02-23 Thread Dmitry Yemanov

24.02.2021 09:52, Peter Gore wrote:


database = D:\Users\Peter\Documents\FB4Data\FB4TEST.FDB
{
  log_directory = D:\Apps\FB4\FB4Test\chlog
  log_archive_directory = D:\Apps\FB4\FB4Test\archlog
  log_archive_timeout = 10
}

database = D:\Users\Peter\Documents\FB4Data\FB4TESTReplica.FDB
{
  log_source_directory = D:\Apps\FB4\FB4Test\archlog
  verbose_logging = true
}

journal files are created fine in D:\Apps\FB4\FB4Test\archlog (there are 
now 14 of these).  I have a single file in D:\Apps\FB4\FB4Test\chlog viz 
FB4TEST.FDB.chlog-00014.


Everything looks OK so far.


But the replica just doesn't update the modifications.


This is surely not OK ;-)

Does replication.log contain anything?
Did you try to re-start Firebird server?


Dmitry


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 4 Install and replication

2021-02-23 Thread Peter Gore
Hi Dimitry,
Thank you for your assistance so far.  I have got synchronous replication
working fine but still no joy with asynchronous. Here's my Replication.conf
database = D:\Users\Peter\Documents\FB4Data\FB4TEST.FDB
{
 log_directory = D:\Apps\FB4\FB4Test\chlog
 log_archive_directory = D:\Apps\FB4\FB4Test\archlog
 log_archive_timeout = 10
}

database = D:\Users\Peter\Documents\FB4Data\FB4TESTReplica.FDB
{
 log_source_directory = D:\Apps\FB4\FB4Test\archlog
 verbose_logging = true
}

journal files are created fine in D:\Apps\FB4\FB4Test\archlog (there are
now 14 of these).  I have a single file in D:\Apps\FB4\FB4Test\chlog viz
FB4TEST.FDB.chlog-00014. But the replica just doesn't update the
modifications.
OS Windows 10
FB4 running as app on port 3052
Master and replica on same host (localhost)

I just cannot fathom what is wrong
regards
Peter

On Tue, 23 Feb 2021 at 09:10, Dmitry Yemanov  wrote:

> 23.02.2021 11:57, Peter Gore wrote:
>
> > Here's my new config
> > database = D:\Users\Peter\Documents\FB4Data\FB4TEST.FDB
> > {
> >   log_directory = D:\Apps\FB4\FB4Test\chlog
> >   log_archive_directory = D:\Apps\FB4\FB4Test\archlog
> >   log_archive_timeout = 10
> >   verbose_logging = true
> > }
> >
> > database = D:\Users\Peter\Documents\FB4Data\FB4TESTReplica.FDB
> > {
> >   log_source_directory = D:\Apps\FB4\incominglogs
>
> On a single host, log_archive_directory and log_source_directory should
> point to the same directory.
>
> (a) log_archive_directory is where journal segments are written to by
> the primary node
>
> (b) log_source_directory is where they're searched for applying by the
> replica node
>
> But there're no miracle that moves segments from (a) to (b) ;-) It
> should be either the same directory or you should move them yourself.
>
>
> Dmitry
>
>
> Firebird-Devel mailing list, web interface at
> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Change metadata domain from "DOUBLE PRECISION" to "BIGINT"

2021-02-23 Thread Lucas Schatz
Yes I know that I can extract and copy, I'll export/import only as a last
resource

But I'm asking if anyone here tried to do what I'm asking for, and if had
any problems with this "hack"


On Tue, Feb 23, 2021 at 6:28 PM Ivan Přenosil 
wrote:

> - create new empty database using sql scripts (if you do not have them
> you can extract them from original db using ISQL -X)
> - copy data using some datapump tool
>
>
>
> Firebird-Devel mailing list, web interface at
> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Change metadata domain from "DOUBLE PRECISION" to "BIGINT"

2021-02-23 Thread Ivan Přenosil
- create new empty database using sql scripts (if you do not have them 
you can extract them from original db using ISQL -X)

- copy data using some datapump tool



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Change metadata domain from "DOUBLE PRECISION" to "BIGINT"

2021-02-23 Thread Leyne, Sean
Karol,

> Why not standard way by creating new field copy data delete old and
> rename?
> 
> It can be slow operation, is it your conern to do not take production database
> too long offline? If yes, you can speed up such process if you have access to
> good hardware with a loot of RAM and do all in memory.
> 
> I do not know also your setup and how complicated relations are as you can
> also add new field and create view which choose new field and hen you can
> divide this process in multiple update steeps.

With a 100GB database, the new/copy/delete approach is not feasible.


Sean

Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Change metadata domain from "DOUBLE PRECISION" to "BIGINT"

2021-02-23 Thread Lucas Schatz
On Tue, Feb 23, 2021 at 3:00 PM liviuslivius 
wrote:

> Why not standard way by creating new field copy data delete old and
> rename?
>
Hundreds of tables/SPs/Triggers using this domain (it's used domain in
almost every table, multiple times per table)

It can be slow operation, is it your conern to do not take production
> database too long offline?
>
Exactly, and in fact a client have 20+ databases with 100Gb+ each db and at
least 5 distinct databases

If yes, you can speed up such process if you have access to good hardware
> with a loot of RAM and do all in memory.
>
 Possible, but anyway I'm not sure how long would it take (creating a new
database empty and fixed is quick, but exporting/importing is my concern)

>
>
I do not know also your setup and how complicated relations are as you can
> also add new field and create view which choose new field and hen you can
> divide this process in multiple update steeps.
>
It's a ERP, so hundreds of relations and dependencies

>
> Regards,
> Karol Bieniaszewski
>
>
> Firebird-Devel mailing list, web interface at
> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Change metadata domain from "DOUBLE PRECISION" to "BIGINT"

2021-02-23 Thread liviuslivius
Why not standard way by creating new field copy data delete old and rename? It 
can be slow operation, is it your conern to do not take production database too 
long offline? If yes, you can speed up such process if you have access to good 
hardware with a loot of RAM and do all in memory.I do not know also your setup 
and how complicated relations are as you can also add new field and create view 
which choose new field and hen you can divide this process in multiple update 
steeps.Regards,Karol Bieniaszewski
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] POSITION on binary blobs

2021-02-23 Thread Jiří Činčura
> SELECT POSITION(cast(ascii_char(1) AS BLOB SUB_TYPE BINARY),
> CAST(x'0001' as blob sub_type binary)) FROM rdb$database;

Nice. Thanks. It even looks like I don't need the first CAST.

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Change metadata domain from "DOUBLE PRECISION" to "BIGINT"

2021-02-23 Thread Lucas Schatz
Hi, I have a 100Gb+ database that has a domain of data type "Double
Precision" but used as integer (no decimals, just integer values), and was
hoping to change it to bigint.

I has thinking: if I backup the database and edit the fdk with a hex editor
and change the domain information, the 3º char after its name from x1b to
x10 (would edit to bigint) and then restore normally
Example:
DOMANNAME 08 04 1b
To
DOMANNAME 08 04 10

I tried this with a 1Gb database, and everything "is running fine" but it's
a local DB with just I testing it, so there are a lot of things that still
could go wrong.

Question: Is there a possibility of problems that anyone here has
experienced doing this before?

Thanks
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 4 Install and replication

2021-02-23 Thread Mark Rotteveel

On 23-02-2021 07:31, Peter Gore wrote:
Good morning, I'm a long standing Firebird User since FB1.5! My interest 
in FB4 is primarily replication, which I have been unable to get 
working. I have also noticed some errors in the documentation that I 
note below.


I have manually downloaded the 32bit version and and run it as an 
application (I have FB2.3 and also FB3 running as a service locally.)


*Doc anomaly 1*
install_windows_manually.txt
Line 46    fbserver.exe -a
should be
                 firebird.exe -a


Looks like that doc hasn't been touched since Firebird 2.5.x or earlier, 
as the executable was renamed in Firebird 3.


Mark

--
Mark Rotteveel


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] POSITION on binary blobs

2021-02-23 Thread Adriano dos Santos Fernandes
On 23/02/2021 10:37, Jiří Činčura wrote:
> Or maybe not. Any smart way to make something like this work? Maybe I just 
> don't see it.
> 
> SELECT POSITION(CAST(CAST(1 AS SMALLINT) AS BLOB SUB_TYPE BINARY), 
> CAST(x'0001' as blob sub_type binary)) FROM rdb$database
> 
> The `CAST(1 AS SMALLINT)` is, at the moment constant byte value I'm getting 
> (hence I could generate x'...' literal), but it can be i.e. column (and hence 
> the literal approach would not work).
> 

CAST(CAST(1 AS SMALLINT) AS BLOB SUB_TYPE BINARY) is same as '1'.

Maybe what you want is this?

SELECT POSITION(cast(ascii_char(1) AS BLOB SUB_TYPE BINARY),
CAST(x'0001' as blob sub_type binary)) FROM rdb$database;


Adriano


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] POSITION on binary blobs

2021-02-23 Thread Mark Rotteveel

On 23-02-2021 14:37, Jiří Činčura wrote:

Or maybe not. Any smart way to make something like this work? Maybe I just 
don't see it.

SELECT POSITION(CAST(CAST(1 AS SMALLINT) AS BLOB SUB_TYPE BINARY), CAST(x'0001' 
as blob sub_type binary)) FROM rdb$database

The `CAST(1 AS SMALLINT)` is, at the moment constant byte value I'm getting 
(hence I could generate x'...' literal), but it can be i.e. column (and hence 
the literal approach would not work).



Using 1 will cast to string first, so it'll look for 0x31 (hexadecimal 
for ASCII character '1'), for a dynamic value, use ASCII_CHAR, e.g. 
ASCII_CHAR(1).


Mark
--
Mark Rotteveel


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] POSITION on binary blobs

2021-02-23 Thread Jiří Činčura
Or maybe not. Any smart way to make something like this work? Maybe I just 
don't see it.

SELECT POSITION(CAST(CAST(1 AS SMALLINT) AS BLOB SUB_TYPE BINARY), CAST(x'0001' 
as blob sub_type binary)) FROM rdb$database

The `CAST(1 AS SMALLINT)` is, at the moment constant byte value I'm getting 
(hence I could generate x'...' literal), but it can be i.e. column (and hence 
the literal approach would not work).

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] POSITION on binary blobs

2021-02-23 Thread Jiří Činčura
Ah, there's my problem. With little bit of casting I think I can make it work.

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 4 Install and replication

2021-02-23 Thread Dmitry Yemanov

23.02.2021 12:30, Mark Rotteveel wrote:


Dmitry, your push with the change was a bit messy


Yes, I've noticed that :-(

could you rebase 
before pushing if your local master diverges from the remote master.


Forgot about that, sorry.


Dmitry


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] POSITION on binary blobs

2021-02-23 Thread Mark Rotteveel

On 2021-02-23 10:27, Jiří Činčura wrote:

Hi *,

is there a reason why POSITION does not work on binary blobs? I would
expect something like `POSITION(blob, 0x1)` to work.


Did you mean POSITION(blob, x'01'), because I wouldn't expect 0x1 (an 
integer literal) to work.


In any case, the problem is that you have switched the parameters. The 
correct order would be POSITION(x'01', blob).


The syntax is:
  POSITION (substr IN string)
| POSITION (substr, string [, startpos])

So the string you're searching for should be first, the string you're 
searching in must come second.


See also 
https://www.firebirdsql.org/file/documentation/html/en/refdocs/fblangref25/firebird-25-language-reference.html#fblangref25-functions-scalarfuncs-position



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 4 Install and replication

2021-02-23 Thread Mark Rotteveel

On 2021-02-23 07:48, Dmitry Yemanov wrote:

23.02.2021 09:31, Peter Gore wrote:

I also ran all the necessary DDL statements and run GFIX as prescribed

*GFIX - Doc anomaly 2*
Release Notes
I found empirically that
Page 28
           gfix -replica read-only 
should be
            gfix -replica read_only 
Also page 137
            gfix -replica read-only 
should be
            gfix -replica read_only 
Probably references to read-write should be read_write but haven't 
tried this.


Noted to be fixed, thanks.


Dmitry, your push with the change was a bit messy, could you rebase 
before pushing if your local master diverges from the remote master.


Mark


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] POSITION on binary blobs

2021-02-23 Thread Jiří Činčura
Hi *,

is there a reason why POSITION does not work on binary blobs? I would expect 
something like `POSITION(blob, 0x1)` to work.

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 4 Install and replication

2021-02-23 Thread Dmitry Yemanov

23.02.2021 11:57, Peter Gore wrote:


Here's my new config
database = D:\Users\Peter\Documents\FB4Data\FB4TEST.FDB
{
  log_directory = D:\Apps\FB4\FB4Test\chlog
  log_archive_directory = D:\Apps\FB4\FB4Test\archlog
  log_archive_timeout = 10
  verbose_logging = true
}

database = D:\Users\Peter\Documents\FB4Data\FB4TESTReplica.FDB
{
  log_source_directory = D:\Apps\FB4\incominglogs


On a single host, log_archive_directory and log_source_directory should 
point to the same directory.


(a) log_archive_directory is where journal segments are written to by 
the primary node


(b) log_source_directory is where they're searched for applying by the 
replica node


But there're no miracle that moves segments from (a) to (b) ;-) It 
should be either the same directory or you should move them yourself.



Dmitry


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 4 Install and replication

2021-02-23 Thread Peter Gore
Thanks Dimitry for the super fast response.  Yes you were correct the paths
were incorrect.  I have corrected this and no longer get the error
message.  Its still not replicating though.
Here's my new config
database = D:\Users\Peter\Documents\FB4Data\FB4TEST.FDB
{
 log_directory = D:\Apps\FB4\FB4Test\chlog
 log_archive_directory = D:\Apps\FB4\FB4Test\archlog
 log_archive_timeout = 10
 verbose_logging = true
}

database = D:\Users\Peter\Documents\FB4Data\FB4TESTReplica.FDB
{
 log_source_directory = D:\Apps\FB4\incominglogs
 verbose_logging = true
}

Still no replication.log
I am now getting journal files. But no records are being replicated
archlog
FB4TEST.FDB.chlog-1
FB4TEST.FDB.chlog-2
chlog
FB4TEST.FDB.chlog-2

Regards
Peter

On Tue, 23 Feb 2021 at 06:49, Dmitry Yemanov  wrote:

> 23.02.2021 09:31, Peter Gore wrote:
>
> > As a test I have tried to get asynchronous replication working.  Is this
> > even possible when Master and Replica is on the same Server?
>
> Sure. Even using a single FB instance for both.
>
> > I have two
> > databases; FB4Test.fdb and FB4TestReplica.fdb o the same (localhost)
> > server.  The replica I created by copying theFB4Test.FDB whilst the
> > server was not running.
> >
> > I followed the release notes and changed the replication.conf as follows
> >
> > database = D:\Users\Peter\Documents\FB4Data\FB4TEST.FDB
> > {
> >   log_directory = /FB4Test/chlog
> >   log_archive_directory = /FB4Test/archlog
>
> UNIX paths??? Your server is obviously on Windows, so it cannot work.
> I'd rather expect something like:
>
>log_directory = D:\Users\Peter\Documents\FB4Test\chlog
>log_archive_directory = D:\Users\Peter\Documents\FB4Test\archlog
>
> > database = D:\Users\Peter\Documents\FB4Data\FB4TESTReplica.FDB
> > {
> >   log_source_directory = /incominglogs/
>
> Same here.
>
> > I also ran all the necessary DDL statements and run GFIX as prescribed
> >
> > *GFIX - Doc anomaly 2*
> > Release Notes
> > I found empirically that
> > Page 28
> >gfix -replica read-only 
> > should be
> > gfix -replica read_only 
> > Also page 137
> > gfix -replica read-only 
> > should be
> > gfix -replica read_only 
> > Probably references to read-write should be read_write but haven't tried
> > this.
>
> Noted to be fixed, thanks.
>
> > *GFIX - Returned error*
> > gfix -replica read_only
> D:\Users\Peter\Documents\FB4Data\FB4TESTReplica.FDB
> > Unable to perform operation
> > -System privilege USE_GFIX_UTILITY is missing
>
> You missed the -user switch, and the user must be DBA/owner.
>
> > When I modify data in the Master database the following error appears in
> > the Firebird.log
> >
> > TOSHPJGTue Feb 23 06:02:15 2021
> > Operating system call FindFirstFile failed. Error code 3
>
> I will improve the error reporting to be more user-friendly. This errors
> means non-existing "/FB4Test/chlog" directory.
>
>
> Dmitry
>
>
> Firebird-Devel mailing list, web interface at
> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] LibreOffice Patch : Can't use System V semaphores in a sandboxed macOS process

2021-02-23 Thread Paul Beach


>

Not really

https://github.com/FirebirdSQL/firebird/commit/6ec7a10aa3b772527320729b6c67d6bc83258d39=

Paul



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel