TpFIBBackupService Serverdan Backup almıyor

Firebird ve Interbase veritabanları ve SQL komutlarıyla ilgli sorularınızı sorabilirsiniz. Delphi tarafındaki sorularınızı lütfen Programlama forumunda sorunuz.
Cevapla
Kullanıcı avatarı
freeman35
Admin
Mesajlar: 2380
Kayıt: 12 Haz 2003 04:05
Konum: merkez camii yanı

TpFIBBackupService Serverdan Backup almıyor

Mesaj gönderen freeman35 »

Fib plus ve Delphi 2007 ile gelen TBackupService aynı şekilde server üzerindeki db nin yedeğini almıyor. Aşağıdaki yazışmaları FIB plus ta Sergey Pfaffenrot (helpdesk staff) elemanla yaptım. Sonuç yada diğer görüşmeleri bu başlık altında devam etmeye çalışacağım. Ama malesef eleman Türkçe bilemediği için eziklik duymasın diye yarım yamalak ingiLAZ ca yazdım :lol: :lol: Türkçe ye çevirmek yerine olduğu gibi copy-paste yapıcam

İlk sorun şu :
I tried Backup but TpFIBBackupService did NOT backup. I Tested in Delphi 2007 by fib+ example BackupRestore.dpr

Delphi standart IB componets (TIBBackupService) same it not work too :(

I tested this in IBExpert and EMS FireBird Tools. But same, It not works :(

BackupService1.DatabaseName := 'Mydb 2007';
BackupService1.Protocol := (TCP);
BackupService1.ServerName := '127.0.0.1';

result is
*** Database file: ***
Mydb 2007
*** Backup file(s): ***
C:\Mydb.fbk
==================== Backup started ====================
gbak: readied database Mydb 2007 for backup
gbak: creating file C:\Mydb.fbk
.......
this is okey. But, if the db on server and NOSHAREd folder, NO any permissions on Server's HDD(Just connect to db via tcp/ip [exam: 10.0.0.1:Mydb 2007] everythink is okey) can NOT backup.

BackupService1.DatabaseName := 'Mydb 2007';
BackupService1.Protocol := (TCP);
BackupService1.ServerName := '10.0.0.1';

Error is:
Unsuccessful execution caused by a system error that precludes
succeddful execution of subsequent statements.
Cannot open backup file C:\Mydb.fbk.

Test system is
Client XP pro
Server Windows 2003
FireBird Server 1.5.3.4870

this is my test code:
BackupService1.DatabaseName := 'Mydb 2007';
BackupService1.Protocol := (TCP);
BackupService1.ServerName := '10.0.0.1';
BackupService1.BackupFile.Clear;
Memo1.Clear;
Memo1.Lines.Add('*** Database file: ***');
Memo1.Lines.Add(BackupService1.DatabaseName);
Memo1.Lines.Add('*** Backup file(s): ***');
BackupService1.BackupFile.Add('C:\MyDb.fbk');
Memo1.Lines.Add('C:\MyDb.fbk');
Memo1.Lines.Add(
'==================== Backup started ====================');
BackupService1.Active := True;
BExit.Enabled := False;
BBackup.Enabled := False;
BRestore.Enabled := False;
BackupService1.ServiceStart;
while not (BackupService1.Eof) do Memo1.Lines.Add(BackupService1.GetNextLine);
BackupService1.Active := False;//Error line
BExit.Enabled := True;
BBackup.Enabled := True;
BRestore.Enabled := True;
Memo1.Lines.Add(
'==================== Backup ended ====================');


I think this is bug, becouse this command line is working correctly


d:\Firebird_1_5\bin\gbak.exe -v -t -user SYSDBA -password "masterkey" 10.0.0.1:"Mydb 2007" C:\Mydb.fbk


just importing Alias name has a space char (#32) so its work just Alias name add like this "Mydb 2007" not Mydb 2007

Sorry for my poor english
2. Mesaj:
From: [1185] (svd) Sergey Pfaffenrot (helpdesk staff)
ok. then could you tring next experiment:
rename your database to 8.3 and start application again.
cevap:
From: [3007] (freeman35) freeman35 freeman35
I did. But same problem :(
I renamed db name to "ABC.FDB" I tryed Alias name to "Mydb 2007" & "ABC". Same problem goes on.
I tested in IBExpert tools, but same :(

şimdilik bu kadar
ZAGOR TENAY TÜRK'tür... TÜRK kalacak...
Zoru başarırım, İmkansız zaman alır
FreeMan 35.5

Soru sormaya üşenmiyorsan, sorunun çözümünü yazmaya da üşenme !!!
Kullanıcı avatarı
freeman35
Admin
Mesajlar: 2380
Kayıt: 12 Haz 2003 04:05
Konum: merkez camii yanı

Mesaj gönderen freeman35 »

I think gbak.exe use "fbclient.dll". In \BIN folder.

error be in this line, if im not rong parameter can not sending to API, so Alias can not finding. If can look to gbak.exe source and if posible to learn how is sending geted parameter by which API can correcting this bug.

this is in IB_Services.pas
LoadLibrary;
if call(FClientLibrary.isc_service_start(StatusVector, @FHandle, nil,
FStartSPBLength, FStartSPB), False) > 0

http://www.koders.com/delphi/fidCEA28E4 ... 9CE1A.aspx
I found borlands IBServices.pas in this adres.Line number is 1252. But it can be old version. But not changed in lasted version too. i think problem in procedure TIBControlService.InternalServiceStart;

gbak.exe -v -t -user SYSDBA -password "masterkey" 10.0.0.1:"Mydb 2007" C:\Mydb.fbk

gbak.exe access without problem in the same system (client & server computer means). if gbak.exe do then backupservice(s) have do too. because use IB API

best regards
gelen cevap:

Kod: Tümünü seç

var s : string;  i : integer;
begin
  with TpFIBBackupService.Create(nil) do
  try
    Result := False;
    LoginPrompt := False;
    Verbose := True;

    ServerName := '127.0.0.1';
    Protocol := TCP;
    LibraryName := 'fbclient.dll';//this library must exist in {WINDIR}\ or 'gds32.dll'

    Params.Add('user_name=sysdba');
    Params.Add('password=masterkey');

    DatabaseName := 'C:\DB\MyDB2007.FDB';//must call with FULL LOACAL path;

    BackupFile.Text :=  BKName;

    Attach;
    try
      ServiceStart;
      while not Eof do
      begin
        s := GetNextLine;
        i := pos('ERROR', UpperCase(S));
        if i > 0 then
         raise Exception.Create(S);
      end;
    finally
     Detach;
    end;
  finally
    Free;
  end;
end;
This code must be work correct.

Yes that code working. And I was said.

BackupService1.DatabaseName := 'Mydb 2007';
BackupService1.Protocol := (TCP);
BackupService1.ServerName := '127.0.0.1';
This working too.
You wrote
'C:\DB\MyDB2007.FDB';//must call with FULL LOACAL path;
I tested with Alias it works too. With this Alias "MyDB 2007"

This example for local. Problem is on Network. for example
Server IP is 10.0.0.1
Client IP is 10.0.0.5
try from client to server

This code be in CLIENT
BackupService1.DatabaseName := 'Mydb 2007'; No full path because I dont now where db file, I have Just Alias.
BackupService1.Protocol := (TCP);
BackupService1.ServerName := '10.0.0.1';//Server IP

Can you try this code ?
Cevabı:
I'm not not sure about aliases.
dedim ki:
gbak.exe -v -t -user SYSDBA -password "masterkey" 10.0.0.1:"Mydb 2007" C:\Mydb.fbk
This is working correct. Its working by Alias
ZAGOR TENAY TÜRK'tür... TÜRK kalacak...
Zoru başarırım, İmkansız zaman alır
FreeMan 35.5

Soru sormaya üşenmiyorsan, sorunun çözümünü yazmaya da üşenme !!!
Kullanıcı avatarı
freeman35
Admin
Mesajlar: 2380
Kayıt: 12 Haz 2003 04:05
Konum: merkez camii yanı

Mesaj gönderen freeman35 »

Konu hakkında önerisi çözümü olan varsa mesaj yazabilir. Çünkü Delphi 2007 ile gelen IBBAckupService de aynı şekilde çalışmıyor. Sanırım o yüzdende IBExpert ve EMS tool larındada aynı hata var :)
Benim tahminim yukarıdada yazdığım gibi IB API ye parametre doğru şekilde gönderilmniyor. Yani Alias bilgisi doğru gönderilemiyor. Ama bunu GBAK.EXE doğru gönderebiliyor. Demek ki hata bu IB_Servis.pas içindeki ...ControlService.InternalServiceStart; bu procedure de

walla eğer bunu çözersek elemanlardan düzeltme yapılan satırın üstüne remark olarak DelphiTürkiye ibaresinin yazılmasını istiycem :)

Kolay gele
ZAGOR TENAY TÜRK'tür... TÜRK kalacak...
Zoru başarırım, İmkansız zaman alır
FreeMan 35.5

Soru sormaya üşenmiyorsan, sorunun çözümünü yazmaya da üşenme !!!
Kullanıcı avatarı
freeman35
Admin
Mesajlar: 2380
Kayıt: 12 Haz 2003 04:05
Konum: merkez camii yanı

Mesaj gönderen freeman35 »

Elemanlar son noktayı koydular :lol: ÇA LIŞ MI YOOOORRR bize güvenmeyin borland böyle bir destek sözü vermedi. Hem üstelik client tan backup mı alınırmış canım backup dediğin serverda olur :P uğraşamıycam şimdi kardeşim dese walla gam yemiycem :P bizde uğraşıp durmayız burda :lol:

Time: 06/21/2007 07:39:53 [ Quote ]
From: [1185] (svd) Sergey Pfaffenrot (helpdesk staff)
I thik, this question is solved?


Time: 06/21/2007 07:56:48 [ Quote ]
From: [8] (buzz) Sergey Buzadzhy (helpdesk staff)
the backup functionality when you use services does not coincide with that of gbak.exe. The backup with services ALWAYS tries to make the backup to the server computer. You can't make backup to client computer. This is implemented by Borland. That's why we (and IBX, IBExpert, etc) do not give it this ability, it does not depend on us.


Time: 06/21/2007 08:45:58 [ Quote ]
From: [3007] (freeman35) freeman35 freeman35
Now this question solved ?
Its not work,
Quote
does not depend on us.
:)
If I need I use gbak.exe But backup means( I think ) copy or backup diffrent HDD, CD or any media device. If server crashed or file is corrapted loose everthing, main db and backups

Thank you for answers
Best regards
ZAGOR TENAY TÜRK'tür... TÜRK kalacak...
Zoru başarırım, İmkansız zaman alır
FreeMan 35.5

Soru sormaya üşenmiyorsan, sorunun çözümünü yazmaya da üşenme !!!
Cevapla