Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Possibility to shut down the database and start it up again. #211

Closed
nLeonardt95 opened this issue Jun 18, 2021 · 8 comments
Labels

Comments

@nLeonardt95
Copy link
Contributor

Possibility to shut down the database and start it up again.

https://firebirdsql.org/rlsnotesh/rnfb20x-util-gfix.html#rnfb20x-util-gfix-shut

@nLeonardt95 nLeonardt95 changed the title Possibility to shut down the database and start it up again. [FEATURE REQUEST] Possibility to shut down the database and start it up again. Jun 18, 2021
@arvanus
Copy link
Collaborator

arvanus commented Jun 19, 2021

IBPP already has this features, it's just a question of building a interface for Flamerobin

void ServiceImpl::Shutdown(const std::string& dbfile, IBPP::DSM mode, int sectimeout)
{
if (mHandle == 0)
throw LogicExceptionImpl("Service::Shutdown", _("Service is not connected."));
if (dbfile.empty())
throw LogicExceptionImpl("Service::Shutdown", _("Main database file must be specified."));
IBS status;
SPB spb;
spb.Insert(isc_action_svc_properties);
spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
switch (mode)
{
case IBPP::dsDenyAttach :
spb.InsertQuad(isc_spb_prp_deny_new_attachments, sectimeout);
break;
case IBPP::dsDenyTrans :
spb.InsertQuad(isc_spb_prp_deny_new_transactions, sectimeout);
break;
case IBPP::dsForce :
spb.InsertQuad(isc_spb_prp_shutdown_db, sectimeout);
break;
}
(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
if (status.Errors())
throw SQLExceptionImpl(status, "Service::Shutdown", _("isc_service_start failed"));
Wait();
}

I'd put the menu here, with 2 distinct menus for Database Shutdown and Database Online:
image

What do you think?

@nLeonardt95
Copy link
Contributor Author

that's exactly how I imagined it too

@Jdochoa
Copy link
Contributor

Jdochoa commented Jun 19, 2021

IBPP already has this features, it's just a question of building a interface for Flamerobin

void ServiceImpl::Shutdown(const std::string& dbfile, IBPP::DSM mode, int sectimeout)
{
if (mHandle == 0)
throw LogicExceptionImpl("Service::Shutdown", _("Service is not connected."));
if (dbfile.empty())
throw LogicExceptionImpl("Service::Shutdown", _("Main database file must be specified."));
IBS status;
SPB spb;
spb.Insert(isc_action_svc_properties);
spb.InsertString(isc_spb_dbname, 2, dbfile.c_str());
switch (mode)
{
case IBPP::dsDenyAttach :
spb.InsertQuad(isc_spb_prp_deny_new_attachments, sectimeout);
break;
case IBPP::dsDenyTrans :
spb.InsertQuad(isc_spb_prp_deny_new_transactions, sectimeout);
break;
case IBPP::dsForce :
spb.InsertQuad(isc_spb_prp_shutdown_db, sectimeout);
break;
}
(*gds.Call()->m_service_start)(status.Self(), &mHandle, 0, spb.Size(), spb.Self());
if (status.Errors())
throw SQLExceptionImpl(status, "Service::Shutdown", _("isc_service_start failed"));
Wait();
}

I'd put the menu here, with 2 distinct menus for Database Shutdown and Database Online:
image

What do you tkink?

it's fine, but include gfix -online too

@luronumen
Copy link

Hi @arvanus and @Jdochoa

Is it also possible to add in this Tools menu an option to extract the Database metadata (DDL.SQL file) using the following isql command?

isql.exe -user SYSDBA -password masterkey -extract -output "DDL.SQL" LOCALHOST:"TEST_DB"

Thanks in advance,
Luciano

@arvanus
Copy link
Collaborator

arvanus commented Jun 20, 2021

Hi @arvanus and @Jdochoa

Is it also possible to add in this Tools menu an option to extract the Database metadata (DDL.SQL file) using the following isql command?

isql.exe -user SYSDBA -password masterkey -extract -output "DDL.SQL" LOCALHOST:"TEST_DB"

Thanks in advance,
Luciano

Isn't what already exists in the database property, DDL tab?
image

@luronumen
Copy link

Hi @arvanus

There is but the sequence that the instructions are shown on this page doesn't always work for the database re-creation because it doesn't perfectly consider the dependencies between the objects. The best solution would be for this page to show the DDL extracted using isql instead of the instructions extracted by FlameRobin. What do you think? Is it possible to refresh this page to show the DDL statement extracted via isql?

@arvanus
Copy link
Collaborator

arvanus commented Jun 21, 2021

Hi @arvanus

There is but the sequence that the instructions are shown on this page doesn't always work for the database re-creation because it doesn't perfectly consider the dependencies between the objects. The best solution would be for this page to show the DDL extracted using isql instead of the instructions extracted by FlameRobin. What do you think? Is it possible to refresh this page to show the DDL statement extracted via isql?

Not possible that I know, but I know nothing 😄
iSQL is simply a client do Fb, like gbak is a simple client too
Also, even isql has this problem:
FirebirdSQL/firebird#6862
This DDL fail to replicate:

create view v_test as select 1 as x from rdb$database;
create procedure sp_test(a_x type of column v_test.x) as begin end;
commit;

Please, create a new issue referring this problem

Jdochoa added a commit to Jdochoa/flamerobin that referenced this issue Aug 23, 2022
mariuz added a commit that referenced this issue Aug 25, 2022
Possibility to shut down the database and start it up again. #211
@nLeonardt95
Copy link
Contributor Author

when can we except the next release version?

@arvanus arvanus closed this as completed Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants