IBCRestoreService - database shutdown unsuccessful

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
yota
Posts: 10
Joined: Thu 19 Nov 2009 10:42
Location: Poland

IBCRestoreService - database shutdown unsuccessful

Post by yota » Fri 12 Aug 2011 07:23

Code: Select all

  IBCConfigService1.Active := True;
  IBCConfigService1.ShutdownDatabase(smForced, 1);
  IBCConfigService1.Active := False;

  IBCRestoreService1.Active := TRUE;
  IBCRestoreService1.Attach;
  IBCRestoreService1.ServiceStart;
  while IBCRestoreService1.IsServiceRunning do begin
    Application.ProcessMessages;
  end;
 IBCRestoreService1.Detach;
I'm trying to recreate database. I've got the Options.roReplace set to True.
It gives me: (on while IsServiceRunning)

Code: Select all

database shutdown unsuccessful
failed to create database D:\test\test.fdb'.
And then

Code: Select all

Target shutdown mode is invalid for database "D:\test\test.fdb"'
It clears the DB but do not restore it.
I'm using IBDAC 3.50.0.21, Firebird 2.5 and Delphi 2010
Where can be the problem?

AndreyZ

Post by AndreyZ » Fri 12 Aug 2011 08:50

Hello,

You can find more information about this problem here: http://tracker.firebirdsql.org/browse/CORE-869
To solve the problem, please try using the following code:

Code: Select all

IBCConfigService1.Active := True;
IBCConfigService1.ShutdownDatabase(smForced, 1);
IBCConfigService1.BringDatabaseOnline;
IBCConfigService1.Active := False;

IBCRestoreService1.Active := True;
IBCRestoreService1.ServiceStart;
while IBCRestoreService1.IsServiceRunning do begin
  Application.ProcessMessages;
end;
IBCRestoreService1.Active := False;

yota
Posts: 10
Joined: Thu 19 Nov 2009 10:42
Location: Poland

Post by yota » Fri 12 Aug 2011 11:43

Working like a charm, thank you AndreyZ.

AndreyZ

Post by AndreyZ » Fri 12 Aug 2011 11:53

Feel free to contact us if you have any further questions about IBDAC.

Haydar Aji
Posts: 7
Joined: Wed 22 Jun 2016 04:06

Re: IBCRestoreService - database shutdown unsuccessful

Post by Haydar Aji » Wed 22 Jun 2016 04:11

I have same error problem " TARGET SHUTDOWN MODE IS INVALID FOR DATABASE D:\Database\DB.fdb"

Im Using IBDAC Profesional Edition Version: 5.7.23, Firebird 3.0, Delphi XE4

Code: Select all

IBCCS.Database := 'D:\Database\DB.fdb';
IBCCS.Params.Clear;
IBCCS.Username := dbInfo.ServerUserName;
IBCCS.Password := GetPassword(dbInfo.ServerUserName, dbInfo.ServerPassword) ;
IBCCS.Active := true;
IBCCS.ShutdownDatabase(smForced, 1);
IBCCS.Active := False;

Debug error on line IBCCS.ShutdownDatabase(smForced, 1);
how to fix it? Thanks Devart

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: IBCRestoreService - database shutdown unsuccessful

Post by ViktorV » Thu 23 Jun 2016 11:44

A similar issue was discussed at Firebird RDBMS Issue Tracker. See more details about the issue at http://tracker.firebirdsql.org/browse/CORE-869 To solve the issue, try to call the TIBCConfigService.BringDatabaseOnline method after calling the TIBCConfigService.ShutdownDatabase method.

Post Reply