You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following batch:
0) reads argument %1, which can be:
*** SS_30 -- if we check 3.0 SuperServer
** SC_30 -- for 3.0 SuperClassic
** CS_30 --for pure 3.0 Classic server
(default value = 'SS_30' -- SuperServer)
1) creates database with name derived from this batch own name + suffix, using appropriate FB instance (SS/SC/CS)
2) moves this database to full shutdown
3) attempts to return database to online state using REMOTE access
4) moves database again to offline
5) attempts to return database to online state using LOCAL access
Also, after on each step it gathers info from database header and extract from it only two lines - with database name and its attributes.
Text:
=== begin of batch `shutdown-online.bat` === @echo off
setlocal
@Rem remove any occurrence of FB home from path:
set path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM
set fbarch=%1
if .%1.==.. set fbarch=SS_30
if /i .%fbarch%.==.SS_30. (
set fbhome=C:\1INSTALL\FIREBIRD\fb30sS
set fbport=3333
)
if /i .%fbarch%.==.CS_30. (
set fbhome=C:\1INSTALL\FIREBIRD\fb30Cs
set fbport=3329
)
if /i .%fbarch%.==.SC_30. (
set fbhome=C:\1INSTALL\FIREBIRD\fb30Sc
set fbport=3330
)
set dbpath=%~dp0
set dbname=%~n0.fdb.tmp
del %dbpath%%dbname% 2>nul
echo create database 'localhost/%fbport%:%dbpath%%dbname%' user 'SYSDBA' password 'masterkey'; show version; | %fbhome%\isql -q
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"
In cases when authentication is possible without maps that can't be currently read from shutdown database attach() error is ignored. In case when authentication fails (no context) an error message about failed access to maps is added to make conditions better understood by user.
Submitted by: @pavel-zotov
Following batch:
0) reads argument %1, which can be:
*** SS_30 -- if we check 3.0 SuperServer
** SC_30 -- for 3.0 SuperClassic
** CS_30 --for pure 3.0 Classic server
(default value = 'SS_30' -- SuperServer)
1) creates database with name derived from this batch own name + suffix, using appropriate FB instance (SS/SC/CS)
2) moves this database to full shutdown
3) attempts to return database to online state using REMOTE access
4) moves database again to offline
5) attempts to return database to online state using LOCAL access
Also, after on each step it gathers info from database header and extract from it only two lines - with database name and its attributes.
Text:
=== begin of batch `shutdown-online.bat` ===
@echo off
setlocal
@Rem remove any occurrence of FB home from path:
set path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM
set fbarch=%1
if .%1.==.. set fbarch=SS_30
if /i .%fbarch%.==.SS_30. (
set fbhome=C:\1INSTALL\FIREBIRD\fb30sS
set fbport=3333
)
if /i .%fbarch%.==.CS_30. (
set fbhome=C:\1INSTALL\FIREBIRD\fb30Cs
set fbport=3329
)
if /i .%fbarch%.==.SC_30. (
set fbhome=C:\1INSTALL\FIREBIRD\fb30Sc
set fbport=3330
)
set dbpath=%~dp0
set dbname=%~n0.fdb.tmp
del %dbpath%%dbname% 2>nul
echo create database 'localhost/%fbport%:%dbpath%%dbname%' user 'SYSDBA' password 'masterkey'; show version; | %fbhome%\isql -q
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"
@Rem --------------------------------------------------------
@echo on
%fbhome%\gfix localhost/%fbport%:%dbpath%%dbname% -user SYSDBA -password masterkey -shut full -force 0
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"
@echo off
@Rem --------------------------------------------------------
@echo on
@echo.
@echo Return to ONLINE - attempt to use remote access:
%fbhome%\gfix localhost/%fbport%:%dbpath%%dbname% -user SYSDBA -password masterkey -online
@echo off
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"
@Rem --------------------------------------------------------
@echo.
@echo Again move in shutdown mode.
%fbhome%\gfix localhost/%fbport%:%dbpath%%dbname% -user SYSDBA -password masterkey -shut full -force 0 1>nul 2>&1
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"
@Rem --------------------------------------------------------
@echo on
@echo.
@echo Return to ONLINE - attempt to use local access:
%fbhome%\gfix %dbpath%%dbname% -user SYSDBA -password masterkey -online
@echo off
%fbhome%\gstat localhost/%fbport%:%dbpath%%dbname% -h -user SYSDBA -password masterkey | findstr /i "%dbname% attributes"
del %dbpath%%dbname% 2>nul
=== end of batch `shutdown-online.bat` ===
All three architectures were checked on WI-V3.0.0.31981.
Result for SS_30:
##############
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30sS\gfix localhost/3333:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -shut full -force 0
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30sS\gstat localhost/3333:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -h -user SYSDBA -pa
ssword masterkey | findstr /i "shutdown-online.fdb.tmp attributes"
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown
Return to ONLINE - attempt to use remote access:
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30sS\gfix localhost/3333:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -online
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write
Again move in shutdown mode.
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown
Return to ONLINE - attempt to use local access:
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30sS\gfix C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -password masterkey -o
nline
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write
(i.e. all fine - the're no errors occur)
Result for SC_30:
##############
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Sc\gfix localhost/3330:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -shut full -force 0
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Sc\gstat localhost/3330:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -h -user SYSDBA -pa
ssword masterkey | findstr /i "shutdown-online.fdb.tmp attributes"
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown
Return to ONLINE - attempt to use remote access:
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Sc\gfix localhost/3330:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -online
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write
Again move in shutdown mode.
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown
Return to ONLINE - attempt to use local access:
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Sc\gfix C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -password masterkey -o
nline
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write
(also all fine, no errors)
Result for CS_30:
##############
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Cs\gfix localhost/3329:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -shut full -force 0
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Cs\gstat localhost/3329:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -h -user SYSDBA -pa
ssword masterkey | findstr /i "shutdown-online.fdb.tmp attributes"
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown
Return to ONLINE - attempt to use remote access:
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Cs\gfix localhost/3329:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -online
database C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP shutdown
-IProvider::attachDatabase failed when loading mapping cache
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown
Again move in shutdown mode.
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write, full shutdown
Return to ONLINE - attempt to use local access:
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Cs\gfix C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -password masterkey -o
nline
Database "C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP"
Attributes force write
Messages in Classic differ from other two architectures here:
. . .
Return to ONLINE - attempt to use remote access:
C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb30Cs\gfix localhost/3329:C:\FBTESTING\qa\fbt-repo\tmp\shutdown-online.fdb.tmp -user SYSDBA -passwo
rd masterkey -online
database C:\FBTESTING\QA\FBT-REPO\TMP\SHUTDOWN-ONLINE.FDB.TMP shutdown
-IProvider::attachDatabase failed when loading mapping cache
. . .
PS. I have no guess what is correct in above text: maybe it is Classic behave like it was intended and SS & SC are wrong ?
Commits: ef78fed FirebirdSQL/fbt-repository@e5f9d77
The text was updated successfully, but these errors were encountered: