Firebird Quick Start Guide IBPhoenix Publications
Îò ïåðåâîä÷èêà
Àâòîð ïåðåâîäà íå íåñåò îòâåòñòâåííîñòè çà ïðè÷èíåííûé óùåðá ïðè èñïîëüçîâàíèè ïåðåâîäà äàííîãî ðóêîâîäñòâà, íî íàäååòñÿ, ÷òî îí áóäåò ïîëåçåí êîìó-íèáóäü. Ðóññêîÿçû÷íûå ðåñóðñû ïî Interbase/Firebird: • http://iBase.ru ïî ïðàâó ñ÷èòàþùàÿñÿ ýíöèêëîïåäèåé ïî Interbase/Firebird; • http://www.delphiplus.org íîâîñòè èç ìèðà Delphi, Interbase/Firebird; äîêóìåíòàöèÿ è äð. Ïðè ïîäãîòîâêå äîêóìåíòà èñïîëüçîâàëîñü: • MiKTeX (http://www.miktex.org); • TeXnicCenter (http://www.ToolsCenter.org); • øðèôòû èç ïàêåòà LHFONTS; • Firebird 1.0.2; • ABBYY Lingvo 7.0. Õî÷ó ñêàçàòü îãðîìíîå ñïàñèáî ãðóïïå Roxette è Melanie C çà èõ ïîìîùü â ðàáîòå íàä äàííûì ïåðå âîäîì ;-) Ïðîäîëæàéòå ðàäîâàòü íàñ õîðîøèìè ïåñíÿìè. Îðèãèíàë íà àíãëèéñêîì ÿçûêå http://www.ibphoenix.com/downloads/qsg.pdf. Òèìóð Áèðø
Ìàðò 2003
1
Ñîäåðæàíèå
1. ×òî ñîäåðæèò äàííûé êîìïëåêò ÏÎ?
4
2. Ðàçìåùåíèå ôàéëîâ íà äèñêå ïî óìîë÷àíèþ
4
3. Óñòàíîâêà Firebird
5
3.1. Äèñêè êóäà áóäåò óñòàíàâëèâàòüñÿ Firebird 3.2. Óñòàíîâî÷íûé ñêðèïò èëè ïðîãðàììà . . . 3.2.1. Ïëàòôîðìà Windows . . . . . . . . . 3.2.2. POSIX-ïëàòôîðìû . . . . . . . . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
5.1. Ñåòåâîé àäðåñ ñåðâåðà . . . . . . . . . . . . . . . . . 5.2. Èìÿ ïîëüçîâàòåëÿ è ïàðîëü ïî óìîë÷àíèþ . . . . . 5.2.1. Êàê ïîìåíÿòü ïàðîëü ïîëüçîâàòåëÿ SYSDBA 5.3. Óòèëèòà äëÿ àäìèíèñòðèðîâàíèÿ . . . . . . . . . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. 9 . 9 . 10 . 10
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
4. Ïðîâåðêà ïðîèçâåäåííîé óñòàíîâêè
4.1. Pinging the server . . . . . . . . . . . . . 4.2. Ïðîâåðèì, ÷òî ñåðâåð Firebird ðàáîòàåò 4.2.1. Windows NT4/2000/XP . . . . . . 4.2.2. Windows 9x/ME . . . . . . . . . . 4.2.3. POSIX-ñîâìåñòèìûå ñåðâåðà . . .
. . . . .
. . . . .
5. Äðóãèå âåùè êîòîðûå âàì ïîíàäîáÿòñÿ
6. Ïîäêëþ÷åíèå ê ïðèìåðó áàçû äàííûõ
6.1. Èìÿ ñåðâåðà è ïóòü . . . . . . . . . . . . 6.2. SQL-îïåðàòîð CONNECT . . . . . . . . 6.2.1. Èñïîëüçîâàíèå isql . . . . . . . . 6.2.2. Èñïîëüçîâàíèå GUI-èíñòðóìåíòà
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
5 5 5 6
6
6 7 7 8 8
9
10
11 11 11 12
7. Ñîçäàíèå áàçû äàííûõ èñïîëüçóÿ isql
12
8. Client-only óñòàíîâêà
13
7.1. Çàïóñê isql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.2. SQL-îïåðàòîð CREATE DATABASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 8.1. Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 8.2. Linux è íåêîòîðûå äðóãèå POSIX-ñîâìåñòèìûå êëèåíòû . . . . . . . . . . . . . . . . . . . . . 13
9. Äðóãèå âåùè çàñëóæèâàþùèå âíèìàíèÿ
9.1. ßçûê Firebird SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.1. Ñèìâîë îãðàíè÷åíèÿ ñòðîêè . . . . . . . . . . . . . . . . . . . . . 9.1.2. Èäåíòèôèêàòîðû â äâîéíûõ êàâû÷êàõ . . . . . . . . . . . . . . . 9.1.3. Àïîñòðîôû â ñòðîêàõ . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.4. Ñîåäèíåíèå ñòðîê . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.5. Äåëåíèå öåëîãî ÷èñëà íà öåëîå . . . . . . . . . . . . . . . . . . . 9.1.6. Âûðàæåíèÿ âêëþ÷àþùèå NULL . . . . . . . . . . . . . . . . . . . 9.2. Ðåçåðâíîå êîïèðîâàíèå (backup) . . . . . . . . . . . . . . . . . . . . . . . 9.3. Êàê ðàçðóøèòü áàçó äàííûõ . . . . . . . . . . . . . . . . . . . . . . . . . 9.3.1. Èçìåíåíèå ìåòàäàííûõ òàáëèö . . . . . . . . . . . . . . . . . . . 9.3.2. Îòêëþ÷åíèå forced writes ïîä Windows . . . . . . . . . . . . . . . 9.3.3. Îòêëþ÷åíèå forced writes íà Linux-ñåðâåðå . . . . . . . . . . . . 9.3.4. Âîññòàíîâëåíèå ðåçåðâíîé êîïèè ïîâåðõ îòêðûòîé áàçû äàííûõ 2
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
13
14 14 14 14 14 15 15 16 16 16 16 16 17
9.3.5. Âîçìîæíîñòü ïîëüçîâàòåëåé ïîäêëþ÷àòüñÿ ê ÁÄ âî âðåìÿ âîññòàíîâëåíèÿ . . . . . . 17 10.Êóäà äàëüøå?
17
11.Ïðîåêò Firebird
18
10.1. Êàê ïîëó÷èòü ïîìîùü . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 10.2. Èñïîëüçîâàíèå êíèã îò IBPhoenix Publications . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3
Äëÿ ïîëíîé èíôîðìàöèè ïî íàñòðîéêå è çàïóñêó âàøåãî ñåðâåðà è íàñòðîéêå óñòàíîâêè, ïîæàëóéñòà îáðàòèòåñü ê Ãëàâàì 4-6 ðóêîâîäñòâà Using Firebird ðàñïðîñòðàíÿåìîãî íà IBPhoenix CD. 1. ×òî ñîäåðæèò äàííûé êîìïëåêò ÏÎ?
Âñå êîìïëåêòû ñîäåðæàò âñå íåîáõîäèìûå êîìïîíåíòû äëÿ óñòàíîâêè ñåðâåðà Firebird: • èñïîëíÿåìûé ôàéë ñåðâåðà Firebird • êëèåíòñêàÿ áèáëèîòåêà ðàñïîëîæåííàÿ íà ñåðâåðå • óòèëèòû êîìàíäíîé ñòðîêè • ñòàíäàðòíûå áèáëèîòåêè UDF • ôàéëû ïðèìåðà áàçû äàííûõ • çàãîëîâî÷íûå ôàéëû íà ÿçûêå C (íå íóæíî äëÿ íà÷èíàþùèõ!) • release notes íåîáõîäèìî ïðî÷èòàòü! 2. Ðàçìåùåíèå ôàéëîâ íà äèñêå ïî óìîë÷àíèþ
Ñëåäóþùàÿ òàáëèöà îïèñûâàåò ðàçìåùåíèå ôàéëîâ íà äèñêå ïî óìîë÷àíèþ äëÿ Windows è Linux. Èíôîðìàöèÿ ïðåäñòàâëåíà â äâóõ âàðèàíòàõ â çàâèñèìîñòè îò âåðñèé: • âåðñèè äî Firebird 1.5 • è âåðñèè îò Firebird 1.5 è âûøå Äàííîå äåëåíèå íà äâà âàðèàíòà âàæíî. Âåðñèè äî Firebird 1.5 èñïîëüçóþò òàêèå æå ïóòè, èìåíà ôàéëîâ è ññûëêè íà ðåñóðñû êàê è â Interbase 6.x è íèæå. Ïîýòîìó íåâîçìîæíî çàïóñòèòü ñåðâåð Firebird è ñåðâåð Interbase íà îäíîì è òîì æå êîìïüþòåðå äàííûõ âåðñèé.  ðåâèçèè áàçîâîãî êîäà íà÷èíàÿ ñ âåðñèè 1.5, ñòàðûå æåñòêèå ññûëêè íà ôàéëû Interbase óäàëåíû è ìíîãèå ãëàâíûå ôàéëû ïåðåèìåíîâàíû. Firebird 1.5 ïîçâîëÿåò çàïóñê ñåðâåðà Interbase íà òîé æå ìàøèíå. Ýòî òàêæå âåðíî è äëÿ Firebird 2. Òàáëèöà 1: Êîìïîíåíòû óñòàíîâêè Firebird Ïëàòôîðìà
Windows 32-bit è 64-bit
Windows NT, 2000, XP
Êîìïîíåíò
ñåðâåð Firebird
Èìÿ ôàéëà
äî v1.5 ibserver.exe v1.5 è âûøå fbserver.exe óòèëèòû gbak.exe, gx.exe, êîìàíäíîé ñòðîêè gstat.exe è äð. ïðèìåð ÁÄ employee.gdb áèáëèîòåêè UDF ib_udf.dll è ib_utils, fbudf.dll êëèåíò Firebird äî v1.5 gds32.dll v1.5 è âûøå gds32.dll, ëèíêîâêà ÷åðåç xxxxx.dll 4
Ðàçìåùåíèå ïî óìîë÷àíèþ
C:\Program Files\Firebird\bin C:\Program Files\Firebird\bin C:\Program Files\Firebird\examples C:\Program Files\Firebird\udf C:\WINNT\system32
Òàáëèöà 1: Êîìïîíåíòû óñòàíîâêè Firebird (ïðîäîëæåíèå) Ïëàòôîðìà
Êîìïîíåíò
Windows 9x, êëèåíò Firebird ME Linux è âîçìîæíî ñåðâåð Firebird äðóãèå äèñòðèáóòû UNIX
Èìÿ ôàéëà
Ðàçìåùåíèå ïî óìîë÷àíèþ
êàê âûøå
C:\Windows
äî v1.5 ibserver v1.5 è âûøå fbserver óòèëèòû gbak, gx, gstat è äð. êîìàíäíîé ñòðîêè äî v1.5 v1.5 è âûøå ïðèìåð ÁÄ employee.gdb äî v1.5 v1.5 è âûøå áèáëèîòåêè UDF äî v1.5 ib_udf.so v1.5 è âûøå ib_udf.so è fbudf.so êëèåíò Firebird äî v1.5 libgds.so.0 (binary) libgds.so (symlink) v1.5 è âûøå TBA
/opt/interbase/bin TBA /opt/interbase/bin TBA /opt/interbase/examples TBA /opt/interbase/UDF TBA /usr/lib
3. Óñòàíîâêà Firebird 3.1. Äèñêè êóäà áóäåò óñòàíàâëèâàòüñÿ Firebird
Ñåðâåð Firebird è ëþáûå áàçû äàííûõ êîòîðûå âû ñîçäàåòå èëè ê êîòîðûì ïîäêëþ÷àåòåñü äîëæíû ðàñïîëîãàòüñÿ íà æåñòêîì äèñêå, êîòîðûé ôèçè÷åñêè ïîäêëþ÷åí ê õîñò-êîìïüþòåðó. Âû íå ìîæåòå ðàñ ïîëîæèòü ôàéëû ñåðâåðà èëè ëþáîé äðóãîé áàçû äàííûõ íà mapped drive, lesystem share èëè ñåòåâîé ôàéëîâîé ñèñòåìå. Âû ìîæåòå ïîäêëþ÷èòüñÿ ê áàçå äàííûõ ðàñïîëîæåííîé íà CD-ROM , íî âû íå ìîæåòå çàïó ñòèòü ñ íåãî ñåðâåð Firebird. 3.2. Óñòàíîâî÷íûé ñêðèïò èëè ïðîãðàììà
Íåñìîòðÿ íà òî, ÷òî åñòü âîçìîæíîñòü óñòàíîâèòü Firebird ïðîñòûì êîïèðîâàíèåì ôàéëîâ, òàêàÿ êàê ½untarring“ 1 ôàéëà áèëäà èëè ðàñïàêîâêà .zip-ôàéëà, íî ïðè ïåðâîé óñòàíîâêå î÷åíü ðåêîìåíäóåòñÿ èñ ïîëüçîâàíèå ðàñïðîñòðàíÿåìîãî êîìïëåêòà ÏÎ. Èñïîëíÿåìûé ôàéë óñòàíîâêè ïîä Windows, RPM-ïàêåò (RedHat Package Manager) ïîä Linux è îôèöèàëüíûé ôàéë tar.gz äëÿ äðóãèõ POSIX-ïëàòôîðì ïðîèçâî äÿò íåêîòîðûå íåîáõîäèìûå äåéñòâèÿ. Provided you follow the instructions correctly, there should be nothing for you to do upon completion but log in and go! 3.2.1. Ïëàòôîðìà Windows
Íà ñåðâåðíûõ âåðñèÿõ Windows Windows NT, 2000 è XP, ñåðâèñ Firebird çàïóñòèòñÿ ïîñëå çàâåð øåíèÿ óñòàíîâêè. Ïîñëå ïåðåçàãðóçêè âàøåãî êîìïüþòåðà îí çàïóñòèòñÿ àâòîìàòè÷åñêè. Äëÿ òîãî êàê 1
Èìååòñÿ ââèäó ðàñïàêîâêà .tar-àðõèâà, ñäåëàííîãî óòèëèòîé tar. (
ïðèì. ïåðåâ.
5
)
âðó÷íóþ çàïóñêàòü è îñòàíàâëèâàòü ñåðâåð ñì. Running Firebird on Windows, ñòð. 54 ãëàâû 4 ðóêîâîäñòâà Using Firebird. Íåñåðâåðíûå âåðñèè Windows Windows 95, 98 è ME, íå ïîääåðæèâàþò ñåðâèñû. Ñåðâåð Firebird áóäåò ðàáîòàòü êàê ïðèëîæåíèå, çàùèùåííîå äðóãèì ïðèëîæåíèåì èçâåñòíîå êàê Guardian. Åñëè ñåðâåðíîå ïðèëîæåíèå ïî êàêîé-òî ïðè÷èíå çàâåðøèëîñü íåïðàâèëüíî, òî Guardian ïîïðîáóåò ïåðåçàïóñòèòü åãî. Êîïèÿ êëèåíòñêîé áèáëèîòåêè gds32.dll áóäåò óñòàíîâëåíà â ñèñòåìíóþ äèðåêòîðèþ Windows. 3.2.2. POSIX-ïëàòôîðìû
 ëþáîì ñëó÷àå ïðî÷èòàéòå release notes îòíîñÿùèåñÿ ê òîé âåðñèè Firebird êîòîðóþ âû ñîáèðàåòåñü óñòàíàâëèâàòü.  íèõ ìîãóò áûòü çíà÷èòåëüíûå îòëè÷èÿ îò ðåëèçà ê ðåëèçó ëþáîé POSIX-ñîâìåñòèìîé îïåðàöèîííîé ñèñòåìû, â îñîáåííîñòè îòíîñÿùèåñÿ ê êàòåãîðèè open source. Ãäå âîçìîæíî, èíæåíåðû ñîçäàþùèå áèëäû äëÿ êàæäîé âåðñèè Firebird, äîêóìåíòèðóþò ëþáóþ èçâåñòíóþ ïðîáëåìó. Åñëè â âàøåì êîìïëåêòå ÏÎ íåò êîïèè release notes, òî ñõîäèòå íà download-ñòðàíèöó2 âåá-ñàé òà Firebird http://firebird.sourceforge.net è ñêà÷àéòå êîïèþ îòòóäà. Åñëè ó âàñ åñòü äèñòðèáóòèâ Linux ïîääåðæèâàþùèé óñòàíîâêó èç RPM-ïàêåòîâ, òî, åñëè íåîáõî äèìî, ïðî÷èòàéòå ñîîòâåòñòâóþùóþ äîêóìåíòàöèþ äëÿ èíñòðóêöèé ïî èñïîëüçîâàíèþ RedHat Package Manager'a.  áîëüøèíñòâå äèñòðèáóòîâ ó âàñ åñòü âûáîð ïðîèçâîäèòü ëè óñòàíîâêó èç êîìàíäíîé ñòðîêè èëè ïîñðåäñòâîì GUI èíòåðôåéñà. Äëÿ äèñòðèáóòèâîâ íå óìåþùèõ ðàáîòàòü ñ RPM-ïàêåòàìè è äëÿ ðÿäà UNIX ñèñòåì, èñïîëüçóéòå êîìïëåêò ½ tar.gz“ .  release notes âû íàéäåòå ïîäðîáíûå èíñòðóêöèè ïî óñòàíîâêå.  êîìïëåêò âêëþ÷åíû shell-ñêðèïòû.  íåêîòîðûõ ñëó÷àÿõ, â release notes ìîæåò áûòü íàïèñàíî ÷òîáû âû èçìåíèëè ýòè ñêðèïòû è ïðîèçâåëè íåêîòîðûå êîððåêòèðîâêè. 4. Ïðîâåðêà ïðîèçâåäåííîé óñòàíîâêè
Åñëè âñå ðàáîòàåò êàê áûëî çàäóìàíî, ïðîöåññ ñåðâåðà Firebird äîëæåí ðàáîòàòü ïîñëå çàâåðøåíèÿ óñòàíîâêè. Îí áóäåò çàïóñêàòüñÿ àâòîìàòè÷åñêè ïîñëå êàæäîé ïåðåçàãðóçêè êîìïüþòåðà. Íà äàííûé ìîìåíò ïðåäïîëàãàåòñÿ, ÷òî âû èñïîëüçóåòå äëÿ ðàáîòû ñ Firebird â ñåòè ðåêîìåíäóåìûé ïðîòîêîë TCP/IP. Äëÿ èíôîðìàöèè ïî èñïîëüçîâàíèþ ïðîòîêîëà NetBEUI â ñðåäå Windows, ïîæàëóéñòà îáðàòè òåñü ê Ãëàâå 6 Network Conguration ðóêîâîäñòâà Using Firebird. Ïðîòîêîë IPX/SPX íå ïîääåðæèâàåòñÿ Firebird. 4.1. Pinging the server
Îáû÷íî ïåðâóþ âåøü êîòîðóþ âû çàõîòèòå ñäåëàòü îäíàæäû ïîñëå óñòàíîâêè, ýòî ½ïðîïèíãîâàòü“ ñåð âåð. Ýòî ïðîñòî äàñò âàì óâåðåííîñòü â òîì, ÷òî âàøà ìàøèíà âèäèò õîñò-ìàøèíó íà êîòîðîé óñòàíîâëåí Firebird. Íàïðèìåð, åñëè ó âàøåãî ñåðâåðà â äîìåíå, êîòîðûé âèäåí âàøåé ìàøèíå, IP-àäðåñ 192.13.14.1, òî îòêðîéòå ñåàíñ êîìàíäíîé îáîëî÷êè è ââåäèòå êîìàíäó ping 192.13.14.1
çàìåíèâ ïðèâåäåííûé IP-àäðåñ íà ðåàëüíûé IP-àäðåñ âàøåãî ñåðâåðà. Åñëè âû ïîëó÷àåòå ñîîáùåíèå î òàéìàóòå, òî äëÿ äîïîëíèòåëüíîé èíôîðìàöèè èçó÷èòå ðóêî âîäñòâî Using Firebird Ãëàâó 6 Network Conguration è Ãëàâó 7 Troubleshooting Connections. Ïîìíèòå, åñëè âû ïîäêëþ÷àåòåñü ê ñåðâåðó ëîêàëüíî, ò.å. ñåðâåð è êëèåíò íàõîäÿòñÿ íà îäíîé ìàøèíå, òî âû ìîæåòå ïðîïèíãîâàòü loopback-èíòåðôåéñ ñëåäóþùèì îáðàçîì 2
http://firebird.sourceforge.net/index.php?op=files&id=fb10
6
ping localhost
èëè
ping 127.0.0.1 4.2. Ïðîâåðèì, ÷òî ñåðâåð Firebird ðàáîòàåò
Ïîñëå óñòàíîâêè ñåðâåð Firebird äîëæåí ðàáîòàòü êàê ñåðâèñ ïîä Windows NT/2000/XP èëè ïîä Linux. 4.2.1. Windows NT4/2000/XP
Äëÿ ñåðâåðíûõ âåðñèé Windows çàïóñòèòå àïïëåò Ñåðâèñû èç Ïàíåëè Óïðàâëåíèÿ.
Íà äàííîì ðèñóíêå èçîáðàæåí àïïëåò Ñåðâèñû ïîä Windows NT 4. Äëÿ äðóãèõ âåðñèé Windows èçîáðàæåíèå ìîæåò áûòü äðóãèì. Firebird Server è Firebird Guardian
Firebird Guardian Åñëè Guardian çàïóùåí (êàê ïîêàçàíî íà ñêðèíøîòå) èç-çà èçìåíåíèé â âåðñèÿõ îí ìîæåò èìåòü äðóãîå èìÿ ñåðâèñà.  Windows 2000 è XP Guardian ñêîðåå äëÿ óäîáñòâà ÷åì íåîáõîäèìîñòü, òàê êàê ýòè äâå îïåðàöèîííûå ñèñòåìû èìåþò ñðåäñòâà ïî îòñëåæèâàíèþ è ïåðåçàïóñêó ñåðâèñîâ. Íî ðåêîìåí äóåòñÿ äåðæàòü Guardian àêòèâíûì äëÿ äðóãèõ ïëàòôîðì åñëè SYSDBA íå äîñòóïåí ÷òîáû ïåðåçàïóñòèòü ñåðâåð âðó÷íóþ ïðè åãî îñòàíîâêå ïî êàêîé-ëèáî ïðè÷èíå.
Windows Control Panel applet Ðàííèå äèñòðèáóòèâû Firebird äëÿ Windows óñòàíàâëèâàëè àïïëåò Interbase Manager â Ïàíåëü Óïðàâëåíèÿ îïåðàöèîííûõ ñèñòåì êîòîðûå ïîääåðæèâàþò ñåðâèñû. Îí áûë
èñêëþ÷åí èç Firebird 1.0 èç-çà íåêîòîðûõ ñïåöèôè÷åñêèõ ðåàëèçàöèé ½Firebird [Server] Manager“ , ñòàâøèå äîñòóïíûìè ÷åðåç êàíàëû open source. Ïîêà ýòîò àïïëåò íå ãëàâíîå, íî îí äàåò óäîáíûé ñïîñîá äëÿ çàïóñêà è îñòàíîâêè ñåðâèñà. Åñëè âû íå íàøëè àïïëåò Firebird Manager â ïàíåëè óïðàâëåíèÿ âàøåãî ñåðâåðà Windows, òî ñêà÷àéòå èñõîäíèêè3 íà Delphi èç âåòêè addons äåðåâà CVS Firebird èëè ñêîìïèëèðîâàííóþ âåðñèþ ñ http://www.ibphoenix.com. Àïïëåò áóäåò âûãëÿäåòü ïðèìåðíî êàê èçîáðàæåíèå íà ðèñóíêå. 3
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/firebird/addons/CPA-1/
7
4.2.2. Windows 9x/ME
Ïîä Windows 9x/ME ñåðâåð Firebird äîëæåí ðàáîòàòü êàê ïðèëîæåíèå çà êîòîðûì ñëåäèò Guardian. Èêîíêà Guardian äîëæíà ïîÿâèòüñÿ â ñèñòåìíîì ëîòêå ñ èçîáðàæåíèåì çåëåíîãî öâåòà. Åñëè èêîíêà ìèãàåò èëè êðàñíîãî öâåòà, òî Guardian èëè ïûòàåòñÿ çàïóñòèòü ñåðâåð èëè ïîïûòêà çàïóñêà íåóäà÷íàÿ. Åñëè âû èñïîëüçîâàëè èíñòàëÿöèîííûé ïàêåò êîòîðûé óñòàíîâèëñÿ, íî íå çàïóñòèë àâòîìàòè÷åñêè Guardian è ñåðâåð Firebird, òî âû ìîæåòå ñäåëàòü ñëåäóþùåå: 1) Íàéäèòå èñïîëíÿåìûé ôàéë ïðîãðàììû Guardian (ibguard.exe) è ñîçäàéòå äëÿ íåãî ÿðëûê êîòîðûé ïîìåñòèòå â ïàïêó Startup âàøåãî Start Menu; 2) Îòêðîéòå îêíî Ñâîéñòâà ýòîãî ÿðëûêà è ïåðåéäèòå ê ïîëþ Command line; 3) Èçìåíèòå ñîäåðæèìîå ýòîãî ïîëÿ íà ibguard.exe -a 4) Ñîõðàíèòå èçìåíåíèÿ è çàêðîéòå îêíî; 5) Ùåëêíèòå äâà ðàçà ÿðëûê äëÿ çàïóñêà Guardian. Guardian â ñâîþ î÷åðåäü çàïóñòèò ibserver.exe. Guardian äîëæåí àâòîìàòè÷åñêè çàïóñòèòüñÿ â ñëåäóþùèé ðàç êîãäà âû áóäåòå ïåðåãðóæàòü âàø êîìïüþ òåð. Íà äàííûé ìîìåíò ïîêà íåò àïïëåòà Ïàíåëè Óïðàâëåíèÿ êîòîðûé áû íàõîäèë ðàáîòàþùåå ïðèëîæåíèå ñåðâåðà Firebird íà ýòèõ íåñåðâåðíûõ âåðñèÿõ Windows. 4.2.3. POSIX-ñîâìåñòèìûå ñåðâåðà Èñïîëüçóéòå óòèëèòó top â êîìàíäíîé ñòðîêå äëÿ ïðîâåðêè ðàáîòàþùèõ ïðîöåññîâ â èíòåðàêòèâíîì ðåæèìå. Åñëè Firebird ðàáîòàåò, òî âû äîëæíû óâèäåòü îäèí ïðîöåññ èìÿ êîòîðîãî ibguard (ýòî Guardian), îäíî ãëàâíîå è ìîæåò áûòü äî÷åðíèå ïðîöåññû èìÿ êîòîðûõ ibserver èëè fbserver, êîòîðîå çàâèñèò îò
èñïîëüçóåìîé âàìè âåðñèè Firebird. Ñëåäóþùèé ñêðèíøîò ïîêàçûâàåò âûâîä êîìàíäû top, êîòîðûé ñ ïîìîùüþ êîìàíäû grep ïîêàçûâàåò òîëüêî ïðîöåññû ñ èìåíàìè íà÷èíàþùèåñÿ ñ ñèìâîëîâ ½ib“ , ò.å. 8
top -A | grep ib4
Åñëè âû èñïîëüçóåòå ñåðâåð Firebird ñ àðõèòåêòóðîé Classic, òî èìÿ ïðîöåññà gds_inet_server. Äëÿ êàæäîãî ïîäêëþ÷åíèÿ áóäåò îäèí òàêîé ðàáîòàþùèé ïðîöåññ. Ñäåëàéòå òàê top -A | grep gds ÷òîáû ïîñìîòðåòü èõ. 5. Äðóãèå âåùè êîòîðûå âàì ïîíàäîáÿòñÿ 5.1. Ñåòåâîé àäðåñ ñåðâåðà
• •
•
Åñëè âû íàõîäèòåñü â óïðàâëÿåìîé ñåòè, òî ñïðîñèòå IP-àäðåñ ñåðâåðà ó âàøåãî ñèñòåìíîãî àäìèíè ñòðàòîðà. Åñëè ó âàñ ïðîñòàÿ ñåòü èç äâóõ ìàøèí ñîåäèíåííûõ êðîññîâûì êàáåëåì, òî âû ìîæåòå âûáðàòü ëþáîé IP-àäðåñ äëÿ âàøåãî ñåðâåðà êðîìå 127.0.0.1 (êîòîðûé çàðåçåðâèðîâàí äëÿ loopback-èíòåð ôåéñà) è êîíå÷íî IP-àäðåñ äëÿ âàøåé êëèåíòñêîé ìàøèíû. Åñëè âû çíàåòå ½native“ IP-àäðåñà âàøèõ ñåòåâûõ êàðò è îíè ðàçíûå, òî âû ìîæåòå èñïîëüçîâàòü èõ. Åñëè âû ïëàíèðóåòå èñïðîáîâàòü óñòàíîâêó ñåðâåðà è êëèåíòà íà îäíîé ìàøèíå, òî âû äîëæíû èñïîëüçîâàòü loopback-èíòåðôåéñ localhost ñ IP-àäðåñîì 127.0.0.1. Ïðèìå÷àíèå. Ïîä Windows åñòü âîçìîæíîñòü ïîäêëþ÷èòüñÿ ê ñåðâåðó ëîêàëüíî, áåç èñïîëü çîâàíèÿ TCP/IP loopback-èíòåðôåéñà. Ýòî íå TCP/IP-ñîåäèíåíèå è íå thread-safe ñïîñîá äëÿ ïîäêëþ÷åíèÿ ê ñåðâåðó ëîêàëüíî. Äëÿ èñïîëüçîâàíèÿ îäèíî÷íûõ ýêçåìïëÿðîâ óòèëèò êîìàíä íîé ñòðîêè (gsec, gbak è äð.) îí ðàáîòàåò íîðìàëüíî.
5.2. Èìÿ ïîëüçîâàòåëÿ è ïàðîëü ïî óìîë÷àíèþ
Ïîëüçîâàòåëü SYSDBA èìååò ïîëíûé êîíòðîëü íàä ñåðâåðîì. Ïðîãðàììà óñòàíîâêè óñòàíàâëèâàåò ïîëüçîâàòåëÿ SYSDBA ñ ïàðîëåì masterkey. Íà ñàìîì äåëå ïàðîëü masterke, òàê êàê âñå ñèìâîëû ïîñëå âîñüìîãî èãíîðèðóþòñÿ. Åñëè âàø ñåðâåð ïîäêëþ÷åí ê Èíòåðíåòó, òî âû äîëæíû ïîìåíÿòü ïàðîëü íåìåäëåííî ïðè ïîìîùè óòè ëèòû gsec. 4
Íå çíàþ êàê â äðóãèõ Linux'àõ, íî â Debian ÿ íå íàøåë ó top îïöèè A. Ìîæíî òàê top -b -n 1 | grep ib
9
ïðèì. ïåðåâ.
5.2.1. Êàê ïîìåíÿòü ïàðîëü ïîëüçîâàòåëÿ SYSDBA Äëÿ çàïóñêà gsec âû äîëæíû âîéòè â ñèñòåìó êàê ñóïåðïîëüçîâàòåëü
(root â Linux). Ïðåäïîëîæèì âû ðåøèëè ïîìåíÿòü ïàðîëü SYSDBA íà icuryy4me: 1) Âîéäèòå ê êîìàíäíóþ îáîëî÷êó íà âàøåì ñåðâåðå è ïåðåéäèòå â äèðåêòîðèþ ãäå ðàñïîëîæåíû óòè ëèòû êîìàíäíîé ñòðîêè. Îáðàòèòåñü ê òàáëèöå 2 (ðàñïîëîæåíà âûøå) ÷òîáû íàéòè ýòîò ïóòü; 2) Íàáåðèòå ñëåäóþùåå (íà âñåõ ïëàòôîðìàõ, êðîìå Windows, êîìàíäû ÷óâñòâèòåëüíû ê ðåãèñòðó) gsec -user sysdba -password masterkey
Çàòåì âû óâèäåòå ïðèãëàøåíèå GSEC>
3) Íàáåðèòå ñëåäóþùóþ êîìàíäó GSEC> modify sysdba -pw icuryy4me
4) Íàæìèòå êëàâèøó ENTER. Íîâûé ïàðîëü icuryy4me òåïåðü çàøèôðîâàí è ñîõðàíåí, à ïàðîëü masterkey óæå íåïðàâèëüíûé. 5) Òåïåðü âûéäåòå èç gsec: GSEC> quit
Òàê êàê Firebird èãíîðèðóåò âñå ñèìâîëû ïîñëå âîñüìîãî, òî ïàðîëü icuryy4m áóäåò ðàáî òàòü êàê è ïàðîëü icuryy4monkeys. 5.3. Óòèëèòà äëÿ àäìèíèñòðèðîâàíèÿ
Êîìïëåêò Firebird íå ñîäåðæèò GUI óòèëèòû äëÿ àäìèíèñòðèðîâàíèÿ. Îí ñîäåðæèò íàáîð óòèëèò êîìàíäíîé ñòðîêè, èñïîëíÿåìûå ôàéëû êîòîðûõ íàõîäÿòñÿ â äèðåêòîðèè bin âàøåé óñòàíîâêè Firebird. Åñòü öåëûé ðÿä îòëè÷íûõ GUI-èíñòðóìåíòîâ äîñòóïíûõ äëÿ èñïîëüçîâàíèÿ íà êëèåíòñêèõ ìàøèíàõ ïîä Windows è èõ ñëèøêîì ìíîãî ÷òîáû îïèñàòü âñå çäåñü. Íåñêîëüêî GUI-óòèëèò íàïèñàííûõ â Borland Kylix äëÿ èñïîëüçîâàíèÿ íà êëèåíòñêèõ ìàøèíàõ ïîä Linux, òàêæå íàõîäÿòñÿ íà ñòàäèÿõ çàâåðøåíèÿ ðàçðàáîòêè. Äëÿ âñåõ âîçìîæíûõ îïöèé ïðîâåðüòå ñòðàíèöó Downloads > Contributed > Admin Tools íà http://www.ibphoenix.com5 . Âû ìîæåòå èñïîëüçîâàòü Windows-êëèåíòà äëÿ äîñòóïà ê Linux-ñåðâåðó è íàîáîðîò. 6. Ïîäêëþ÷åíèå ê ïðèìåðó áàçû äàííûõ
 äèðåêòîðèè examples âàøåé óñòàíîâêè Firebird åñòü ïðèìåð áàçû äàííûõ èìÿ êîòîðîé employee.gdb. Âû ìîæåòå èñïîëüçîâàòü äàííóþ áàçó ÷òîáû ½try your wings“ . Åñëè âàø ñåðâåð ðàáîòàåò ïîä Windows 9x/ME, òî îáÿçàòåëüíî ïåðåèìåíóéòå ýòó áàçó äàííûõ â employee.fdb äëÿ èçáåæàíèÿ ïðîáëåì ñ óòèëèòîé System Restore êîòîðàÿ èñïîëüçóåò ôàéëû ñ ðàñøèðåíèåì .gdb â ñâîèõ öåëÿõ. Áîëåå ïîäðîáíàÿ èíôîðìàöèÿ íàõîäèòñÿ â release notes. 5
http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_contrib_download#ADM
10
6.1. Èìÿ ñåðâåðà è ïóòü
Åñëè âû ïåðåìåñòèòå ôàéë ïðèìåðà áàçû äàííûõ, òî áóäüòå óâåðåíû ÷òî âû ïåðåìåùàåòå åãî íà æåñòêèé äèñê êîòîðûé ôèçè÷åñêè ïîäêëþ÷åí ê ñåðâåðíîé ìàøèíå. Ñîâìåñòíî èñïîëüçóåìûå ðåñóðñû, mapped drives èëè (ïîä UNIX) ñìîíòèðîâàííûå ôàéëîâûå ñèñòåìû SMB (Samba) íå áóäóò ðàáîòàòü. Òàêèå æå ïðàâèëà íàëàãàþòñÿ è íà âñå ñîçäàâàåìûå âàìè áàçû. Ñòðîêà TCP/IP ïîäêëþ÷åíèÿ ñîäåðæèò äâà ýëåìåíòà: èìÿ ñåðâåðà6 è ïóòü â ôàéëîâîé ñèñòåìå. Åå ôîðìàò ñëåäóþùèé: • Äëÿ Linux-ñåðâåðà: servername:/lesystem-path/database-le Íàïðèìåð äëÿ Linux-ñåðâåðà èëè äðóãîãî POSIX-ñîâìåñòèìîãî ñåðâåðà ñ èìåíåì serverxyz serverxyz:/opt/interbase/examples/employee.gdb •
Äëÿ Windows-ñåðâåðà: servername:D:\lesystem-path\database-le serverxyz:C:\Program Files\Firebird\examples\employee.gdb
6.2. SQL-îïåðàòîð CONNECT
Ïðè ïîäêëþ÷åíèè ê áàçå äàííûõ Firebird âñåãäà òðåáóåòñÿ ÷òîáû ïîëüçîâàòåëü ½âîøåë“ (log in) èñïîëü çóÿ èìÿ ïîëüçîâàòåëÿ è ïðàâèëüíûé ïàðîëü èçâåñòíîå âñåì êàê log-in èëè login. Ëþáîé ïîëüçîâàòåëü, êðîìå SYSDBA èëè root (òîëüêî â POSIX ñèñòåìàõ) äîëæåí èìåòü ïðàâà äëÿ äîñòóïà ê îáúåêòàì áàçû äàííûõ. Äëÿ óäîáñòâà, çäåñü ìû áóäåì èñïîëüçîâàòü SYSDBA ñ ïàðîëåì masterkey. 6.2.1. Èñïîëüçîâàíèå isql
Åñòü íåñêîëüêî ðàçíûõ ñïîñîáîâ ïîäêëþ÷èòüñÿ ê áàçå äàííûõ èñïîëüçóÿ isql. Îäèí èç íèõ, ýòî çàïó ñòèòü isql â åå èíòåðàêòèâíîé îáîëî÷êå: • Ïåðåéäèòå â äèðåêòîðèþ bin ñåðâåðà Firebird è â êîìàíäíîé ñòðîêå íàáåðèòå isql [root@penguin /root]# cd /opt/interbase/bin [root@penguin bin]# ./isql Use CONNECT or CREATE DATABASE to specify a database SQL> CONNECT "/opt/interbase/examples/employee.gdb" user 'SYSDBA' password 'masterkey';
Íàõîäÿñü â isql óáåäèòåñü, ÷òî ëþáàÿ êîìàíäà çàâåðøàåòñÿ ñèìâîëîì ½;“ . Åñëè âû çàáóäåòå åãî, òî ïðèãëàøåíèå ïîìåíÿåòñÿ ñ SQL> íà CON> è âû íå ñìîæåòå ïðîäîëæèòü ïîêà íå íàáåðåòå ýòîò ñèìâîë è íå íàæìåòå êëàâèøó ENTER. Although single quote symbols are the ½norm“ for delimiting strings in Firebird, double quote symbols were used with the database path string in the above example. This is sometimes necessary with some of the command-line utilities where the path string contains spaces. Single quotes should work for paths that do not contain spaces. È òàê, isql ñîîáùèò âàì, ÷òî âû ïîäêëþ÷åíû: DATABASE "/opt/interbase/examples/employee.gdb", User: sysdba SQL> 6
À åñëè áûòü òî÷íåå, òî íà÷èíàÿ ñ Firebird 1.0 (áèëä 386), èìÿ ñåðâåðà è ïîðò, ò.å.: servername/port:/path/to/db. ( )
ïðèì.
ïåðåâ.
11
Òåïåðü âû ìîæåòå íà÷àòü ðàáîòàòü ñ áàçîé employee.gdb. Íàçâàíèå isql ðàñøèôðîâûâàåòñÿ êàê Interactive SQL [utility]. Âû ìîæåòå èñïîëüçîâàòü åå äëÿ âûáîðêè äàííûõ, ïîëó÷åíèè èíôîðìàöèè î ìåòàäàííûõ, ñî çäàíèÿ îáúåêòîâ áàçû äàííûõ, âûïîëíÿòü DDL-ñêðèïòû (Data Denition Language ïðèì. ïåðåâ.) è ìíîãîå äðóãîå. ×òîáû âîçâðàòèòüñÿ â êîìàíäíóþ îáîëî÷êó, ââåäèòå: SQL> quit;
Äëÿ äîïîëíèòåëüíîé èíôîðìàöèè ïî isql ñì. Ãëàâó 10 Interactive SQL Utility (isql) (ñòð. 152, Using Firebird). 6.2.2. Èñïîëüçîâàíèå GUI-èíñòðóìåíòà
GUI-óòèëèòû îáû÷íî áåðóò çàáîòó íà ñåáÿ ïî ôîðìèðîâàíèþ ñòðîêè ïîäêëþ÷åíèÿ èñïîëüçóÿ èìÿ ñåðâåðà, ïóòü ê ÁÄ, èìÿ ïîëüçîâàòåëÿ è ïàðîëü, êîòîðûå âû ââîäèòå â ïîëÿ ââîäà. Èñïîëüçóéòå ýëåìåíòû êîòîðûå áûëè óïîìÿíóòû â ïðåäûäóùåì òîïèêå. Íåêîòîðûå óòèëèòû, ÷òî îáû÷íî íîðìàëüíî, ïîïðîñÿò âàñ ââåñòè èìÿ ñåðâåðà è ïóòü îäíîé ñòðîêîé. Ïîìíèòå, ÷òî èìåíà ôàéëîâ è êîìàíäû â Linux è äðóãèõ POSIX-ñèñòåìàõ ÷óâñòâèòåëüíû ê ðåãèñòðó. 7. Ñîçäàíèå áàçû äàííûõ èñïîëüçóÿ isql
Åñòü íåñêîëüêî ñïîñîáîâ ñîçäàòü áàçó äàííûõ èñïîëüçóÿ isql. Çäåñü ìû ðàññìîòðèì ïðîñòîé ñïîñîá ñîçäàíèÿ áàçû èíòåðàêòèâíî, íî äëÿ ñåðüåçíîé ðàáîòû ñ ÁÄ âû äîëæíû èñïîëüçîâàòü DDL-ñêðèïòû. Â ðóêîâîäñòâå Using Firebird åñòü ãëàâà ïîëíîñòüþ ïîñâàùåííàÿ äàííîé òåìå. 7.1. Çàïóñê isql
×òîáû ñîçäàòü ÁÄ èñïîëüçóÿ èíòåðàêòèâíóþ îáîëî÷êó isql, ó âàñ äîëæåí áûòü ðàáîòàþùèé ñåðâåð. Çàïóñòèòå êîìàíäíóþ îáîëî÷êó è ïåðåéäèòå â äèðåêòîðèþ bin Firebird è çàïóñòèòå isql ñëåäóþùèì îá ðàçîì: [root@penguin bin]# ./isql Use CONNECT or CREATE DATABASE to specify a database 7.2. SQL-îïåðàòîð CREATE DATABASE
Òåïåðü âû ìîæåòå ñîçäàòü âàøó íîâóþ ÁÄ èíòåðàêòèâíî. Ïðåäïîëîæèì âû õîòèòå ñîçäàòü ÁÄ ñ èìåíåì test.fdb è ïîìåñòèòü åå â äèðåêòîðèþ /opt/interbase/data: SQL> CREATE DATABASE '/opt/interbase/data/test.fdb' page_size 8192 user 'SYSDBA' password 'masterkey';
Áàçà äàííûõ ñîçäàñòñÿ è ïîñëå íåñêîëüêèõ ìîìåíòîâ ïðèãëàøåíèå âíîâü ïîÿâèòñÿ. Çíà÷èò òàê, âû ïîä êëþ÷åíû ê âàøåé íîâîé ÁÄ è òåïåðü ìîæåòå ñîçäàòü â íåé íåêîòîðûå òåñòîâûå îáúåêòû. ×òîáû óáåäèòüñÿ, ÷òî ÁÄ ñîçäàíà íàáåðèòå ñëåäóþùåå: SQL> SELECT * FROM RDB$RELATIONS;
Ýêðàí çàïîëíèòñÿ áîëüøèì êîëè÷åñòâîì äàííûõ! Ýòîò çàïðîñ âûáèðàåò âñå çàïèñè èç ñèñòåìíîé òàáëèöû, ãäå Firebird õðàíèò ìåòàäàííûå äëÿ òàáëèö. ½Ïóñòàÿ“ ÁÄ íå ïóñòàÿ îíà ñîäåðæèò áàçó äàííûõ êîòîðàÿ áóäåò èñïîëüçîâàòüñÿ, êîãäà âû áóäåòå â íåé ñîçäàâàòü îáúåêòû ÁÄ. ×òîáû âåðíóòüñÿ â êîìàíäíóþ îáîëî÷êó íàáåðèòå: 12
SQL> quit;
Äëÿ äîïîëíèòåëüíîé èíôîðìàöèè ïî isql, ñì. Ãëàâó 10 Interactive SQL Utility (isql) (ñòð. 152 ðóêîâîä ñòâà Using Firebird). 8. Client-only óñòàíîâêà
Êàæäàÿ óäàëåííàÿ êëèåíòñêàÿ ìàøèíà äîëæíà èìåòü êëèåíòñêóþ áèáëèîòåêó: libgds.so â POSIX ñèñòåìàõ è gds32.dll íà Windows-êëèåíòàõ, êîòîðàÿ äîëæíà áûòü ñõîäíà ïî âåðñèè ñ ñåðâåðîì Firebird. Âåðñèè Firebird îò 1.5 è âûøå íóæäàþòñÿ â äîïîëíèòåëüíîé êëèåíòñêîé áèáëèîòåêå ñ èìåíåì libfb.so èëè fb32.dll, êîòîðûå ñîäåðæàò ïîëíóþ áèáëèîòåêó.  òàêèõ íîâûõ äèñòðèáóòèâàõ, èìåíà ôàéëîâ ñ ñèìâî ëàìè ½gds“ èñïîëüçóþòñÿ äëÿ ñîâìåñòèìîñòè ñ ïðîäóêòàìè ñòîðîííèõ ðàçðàáîò÷èêîâ, êîòîðûå íóæäàþòñÿ â äàííûõ ôàéëàõ. Íî íà íèçêîì óðîâíå âûçîâû ïåðåàäðåñóþòñÿ ê ïðàâèëüíûì ôóíêöèÿì â ïåðåèìåíî âàííûõ áèáëèîòåêàõ. Äëÿ client-only óñòàíîâêè íóæíî âûïîëíèòü åùå íåêîòîðûå ìàíèïóëÿöèè. 8.1. Windows
Íà ìîìåíò íàïèñàíèÿ äàííîãî ðóêîâîäñòâà íå áûëî êîìïàêòíîé ïðîãðàììû óñòàíîâêè, êîòîðàÿ áû ïîìîãàëà â óñòàíîâêå êëèåíòà Firebird ïîä Windows. Åñëè âû èñïîëüçóåòå Windows-êëèåíòîâ äëÿ äîñòóïà ê Linux èëè äðóãîìó POSIX-ñîâìåñòèìîìó ñåðâåðó Firebird, òî âàì íóæíî ñêà÷àòü ïîëíûé êîìïëåêò óñòàíîâêè ïîä Windows, êîòîðûé ñîîòâåòñòâóåò âåðñèè ñåðâåðà Firebird óñòàíîâëåííîãî íà Linux èëè äðóãîé ñåðâåðíîé ìàøèíå. Åñëè âàì ïîâåçëî è ó âàñ åñòü äèñòðèáóòèâ, òî client-only óñòàíîâêà ïîä Windows íå ïðåäîñòàâèò òðóäà. Çàïóñòèòå ïðîãðàììó óñòàíîâêè, êàê áóäòî âû ñòàâèòå ñåðâåð, íî âûáåðèòå îïöèþ CLIENT ONLY (òîëüêî êëèåíò) èç ïðåäëîæåííîãî ñïèñêà. 8.2. Linux è íåêîòîðûå äðóãèå POSIX-ñîâìåñòèìûå êëèåíòû
Ïîä Linux òàêæå íå ñóùåñòâóåò êîìïàêòíîé ïðîãðàììû äëÿ client-only óñòàíîâêè. Äîïîëíèòåëüíî, íåêîòîðûå âèäû POSIX-ñèñòåì, äàæå â ñîçâåçäèè Linux, èìåþò êîå-êàêèå óíèêàëüíûå òðåáîâàíèÿ ê ðàñïî ëîæåíèþ ôàéëîâ â ôàéëîâîé ñèñòåìå. Ïîýòîìó íå âñå *NIX äèñòðèáóòèâû Firebird èìåþò îïöèþ client-only óñòàíîâêè. Äëÿ áîëüøèíñòâà âèäîâ Linux, ñëåäóþùàÿ ïðîöåäóðà îòíîñèòñÿ ê Firebird âåðñèÿì íèæå 1.5. Äëÿ ýòîãî âîéäèòå â ñèñòåìó êàê root. 1) Íàéäèòå ôàéë libgds.so.0 â äèðåêòîðèè /opt/interbase/lib íà ñåðâåðå ãäå óñòàíîâëåí ñåðâåð Firebird. Ñêîïèðóéòå åãî â äèðåêòîðèþ /usr/lib íà êëèåíòå; 2) Ñîçäàéòå äëÿ íåãî ñèìëèíê7 libgds.so, èñïîëüçóÿ ñëåäóþùóþ êîìàíäó: ln -s /usr/lib/libgds.so.0 /usr/lib/libgds.so
3) Ñêîïèðóéòå ôàéë interbase.msg â äèðåêòîðèþ /opt/interbase; 4) Â ñèñòåìíîì ïðîôàéëå èëè èñïîëüçóÿ âûçîâ setenv() èç øåëëà, ñîçäàéòå ïåðåìåííóþ îêðóæå íèÿ INTERBASE è ñäåëàéòå åå ðàâíîé /opt/interbase, ÷òîáû ôóíêöèè API ìîãëè íàéòè ôàéë interbase.msg. 9. Äðóãèå âåùè çàñëóæèâàþùèå âíèìàíèÿ
This chapter nishes with a small, eclectic collection of things other Firebird ½newbies“ wished they had known about when they began. 7
Ñèìâîëè÷åñêàÿ ññûëêà (symbolic link) (
ïðèì. ïåðåâ.
)
13
9.1. ßçûê Firebird SQL
Êàæäàÿ ÑÓÁÄ èìååò ñâîè îòëè÷èòåëüíûå îñîáåííîñòè â ñïîñîáàõ ðåàëèçàöèè ÿçûêà SQL. Firebird ïðèäåðæèâàåòñÿ ñòàíäàðòà SQL áîëåå ñòðîãî ÷åì ëþáàÿ äðóãàÿ ÑÓÁÄ, êðîìå âîçìîæíî åãî ½êóçåíà“ Interbase. Ðàçðàáîò÷èêè ìèãðèðóþùèå ñ ïðîäóêòîâ ìåíåå ñîáëþäàþùèõ ñòàíäàðòû ÷àñòî íåïðàâèëüíî ïîëàãàþò ÷òî Firebird íåîáû÷íûé, íåñìîòðÿ íà òî, ÷òî ìíîãèå åãî êàæóùèåñÿ ñòðàííîñòè ñîâñåì è íå ñòðàííîñòè. 9.1.1. Ñèìâîë îãðàíè÷åíèÿ ñòðîêè
Ñòðîêè â Firebird ðàçäåëÿþòñÿ ïàðîé ñèìâîëîâ îäèíàðíûõ êàâû÷åê `I am a string' (ASCII-êîä 39,
ÍÅ 96). Åñëè âû èñïîëüçîâàëè ðàííèå âåðñèè Firebird, áëèæå ê Interbase, âû ìîãëè èñïîëüçîâàòü äâîéíûå
è îäèíàðíûå êàâû÷êè, êîòîðûå âçàèìîçàìåíÿåìû, êàê ðàçäåëèòåëè ñòðîêè. Äâîéíûå êàâû÷êè íå ìîãóò èñïîëüçîâàòüñÿ êàê ðàçäåëèòåëè ñòðîêè â Firebird. 9.1.2. Èäåíòèôèêàòîðû â äâîéíûõ êàâû÷êàõ
Before the SQL-92 standard, it was not legal to have object names (identiers) in a database that duplicated keywords in the language, were case-sensitive or contained spaces. SQL-92 introduced a single new standard to make any of them legal, provided that the identiers were dened within pairs of double-quote symbols (ASCII 34) and were always referred to using double-quote delimiters. The purpose of this ½gift“ was to make it easier to migrate metadata from non-standard RDBMSs to standards-compliant ones. The down-side is that, if you choose to dene an identier in double quotes, its case-sensitivity and the enforced double-quoting will remain mandatory. Firebird does permit a slight relaxation under a very limited set of conditions: if the identier which was dened in double-quotes 1) was dened as all upper-case, 2) is not a keyword and 3) does not contain any spaces, then it can be used in SQL unquoted as long as it is used in all upper-case. Unless you have a compelling reason to dene quoted identiers, it is usually recommended that you avoid them. Firebird happily accepts a mix of quoted and unquoted identiers so there is no problem including that keyword which you inherited from a legacy database, if you need to. Íåêîòîðûå èíñòðóìåíòû áàç äàííûõ óñòàíàâëèâàþò èñïîëüçîâàíèå èäåíòèôèêàòîðîâ â äâîé íûõ êàâû÷êàõ ïî óìîë÷àíèþ. Ïîïðîáóéòå âûáðàòü èíñòðóìåíò êîòîðûé ïîçâîëÿåò èñïîëüçî âàòü äâîéíûå êàâû÷êè îïöèîíàëüíî. 9.1.3. Àïîñòðîôû â ñòðîêàõ
Åñëè âàì íóæíî èñïîëüçîâàòü àïîñòðîô âíóòðè ñòðîêè, òî âû ìîæåòå îïðåäåëèòü åãî äðóãèì ïðåäøå ñòâóþùèì àïîñòðîôîì. Íàïðèìåð, ýòà ñòðîêà äàñò îøèáêó: 'Joe's Emporium'
ïîòîìó ÷òî ïàðñåð âñòðåòèò àïîñòðîô è îïðåäåëèò ñòðîêó êàê `Joe' ñ ïîñëåäóþùèìè íåèçâåñòíûìè êëþ ÷åâûìè ñëîâàìè. ×òîáû ñäåëàòü ýòó ñòðîêó ïðàâèëüíîé íóæíî ïðîäóáëèðîâàòü ñèìâîë àïîñòðîôà: 'Joe''s Emporium'
Îáðàòèì âàøå âíèìàíèå, ÷òî ýòî ÄÂÅ îäèíàðíûå êàâû÷êè, à íå îäíà äâîéíàÿ êàâû÷êà. 9.1.4. Ñîåäèíåíèå ñòðîê
Ñèìâîë ñîåäèíåíèÿ ñòðîê â SQL ýòî äâà ñèìâîëà ½pipe“ (ASCII 124, áåç ïðîáåëà ìåæäó íèìè).  SQL ñèìâîë ½+“ ýòî àðèôìåòè÷åñêèé îïåðàòîð è îí äàñò îøèáêó åñëè âû ïîïðîáóåòå èñïîëüçîâàòü åãî äëÿ ñîåäèíåíèÿ ñòðîê. Ñëåäóþùåå âûðàæåíèå ñîåäèíÿåò çíà÷åíèå ñèìâîëüíîãî ïîëÿ ñ ñèìâîëàìè ½Reported by: “ : 14
'Reported by: ' || LastName
Âåäèòå ñåáÿ îñòîðîæíî ñ ñîåäèíåíèÿìè ñòðîê. Çíàéòå, ÷òî Firebird âûçîâåò îøèáêó åñëè âàøå âûðàæå íèå ïîïðîáóåò ñîåäèíèòü äâà èëè áîëåå ïîëÿ òèïîâ CHAR è/èëè VARCHAR, ÷üè âîçìîæíûå îáúåäèíåííûå äëèíû ïðåâûñÿò ìàêñèìàëüíóþ äëèíó äëÿ ïîëÿ òèïîâ CHAR èëè VARCHAR (32Kb). Ñìîòðèòå òàêæå ïðèìå÷àíèå íèæå Âûðàæåíèÿ âêëþ÷àþùèå NULL î ñîåäèíåíèè â âûðàæåíèÿõ âêëþ ÷àþùèõ NULL. 9.1.5. Äåëåíèå öåëîãî ÷èñëà íà öåëîå
Firebird ñîîòâåòñòâóåò ñòàíäàðòó SQL ïî óñå÷åíèþ ðåçóëüòàòà (quotient) îò äåëåíèÿ öåëîãî ÷èñëà íà öåëîå äî ñëåäóþùåãî ìåíüøåãî öåëîãî. Ýòî ìîæåò äàâàòü ñòðàííûå ðåçóëüòàòû, êðîìå êàê åñëè âû îá ýòîì ïîçàáîòèòåñü. Íàïðèìåð, äàííîå âû÷èñëåíèå ïðàâèëüíîå äëÿ SQL: 1 / 3 = 0
Åñëè âû ïåðåõîäèòå îò ÑÓÁÄ êîòîðàÿ ïðåâðàùàåò äåëåíèå îò öåëîãî ÷èñëà íà öåëîå â âåùåñòâåííûé ïîêàçàòåëü, òî âàì íóæíî èçìåíèòü ëþáûå çàòðîíóòûå âûðàæåíèÿ äëÿ èñïîëüçîâàíèÿ âåùåñòâåííûõ èëè scaled ÷èñëîâûõ òèïîâ äëÿ äåëèìîãî èëè äåëèòåëÿ èëè äëÿ îáîèõ. Íàïðèìåð, âû÷èñëåíèå ïðèâåäåííîå âûøå ìîæåò áûòü èçìåíåíî òàêèì îáðàçîì ÷òîáû îíî ãåíåðèðî âàëî íåíóëåâîå çíà÷åíèå: 1.000 / 3 = 0.333
9.1.6. Âûðàæåíèÿ âêëþ÷àþùèå NULL
 SQL NULL ýòî íå çíà÷åíèå. Ýòî óñëîâèå èëè ñîñòîÿíèå îïðåäåëåííîãî êóñî÷êà èíôîðìàöèè, çíà÷åíèå êîòîðîãî íåèçâåñòíî. Ïîòîìó ÷òî îíî íåèçâåñòíî, òî NULL íå ìîæåò âûñòóïàòü êàê çíà÷åíèå. Êîãäà âû ïîïûòàåòåñü ïðîèçâåñòè àðèôìåòè÷åñêîå äåéñòâèå íàä NULL èëè âêëþ÷èòü åãî ñî çíà÷åíèÿìè â äðóãèõ âûðàæåíèÿõ, òî ðåçóëüòàò îïåðàöèè âñåãäà áóäåò NULL. Ýòî íå íóëåâîå èëè ïóñòîå çíà÷åíèå èëè ½ïóñòàÿ ñòðîêà“ è îí íå âûñòóïàåò êàê ëþáîå èç ýòèõ çíà÷åíèé. Òàê, òóò íåêîòîðûå ïðèìåðû êîòîðûå óäèâÿò âàñ åñëè âû ïîïðîáóåòå ïðîèçâåñòè âû÷èñëåíèÿ èëè ñðàâíèâàíèÿ ñ NULL: 1 + 2 + 3 + NULL = NULL if (a = b) then MyVariable = 'Equal' else MyVariable = 'Not equal';
âåðíåò ½Not equal“ åñëè a è b ðàâíû NULL. if (a b) then MyVariable = 'Not equal' else MyVariable = 'Equal';
òàêæå âåðíåò ½Not equal“ åñëè a è b ðàâíû NULL. FirstName || ' ' || LastName
âåðíåò NULL åñëè FirstName èëè LastName ðàâíû NULL.
15
9.2. Ðåçåðâíîå êîïèðîâàíèå (backup)
Firebird ïîñòàâëÿåòñÿ ñî ñâîåé óòèëèòîé äëÿ ðåçåðâíîãî êîïèðîâàíèÿ è âîññòàíîâëåíèÿ âàøèõ ÁÄ. Åå èìÿ gbak è îíà ìîæåò áûòü íàéäåíà â äèðåêòîðèè bin óñòàíîâêè Firebird. ÁÄ Firebird ìîãóò áûòü çàðå çåðâèðîâàíû ïîêà ïîëüçîâàòåëè ïîäêëþ÷åííû ê ñèñòåìå è äåëàþò ñâîþ íîðìàëüíóþ ðàáîòó. Ðåçåðâíàÿ êîïèÿ áóäåò ñäåëàíà èç ñíèìêà ÁÄ íà ìîìåíò íà÷àëà ðåçåðâíîãî êîïèðîâàíèÿ. Ðåãóëÿðíîå ðåçåðâíîå êîïèðîâàíèå è âðåìÿ îò âðåìåíè âîññòàíîâëåíèå èñïîëüçóÿ gbak äîëæíû áûòü çàïëàíèðîâàííîé ñòàòüåé âàøåãî óïðàâëåíèÿ ÁÄ. Íå èñïîëüçóéòå âíåøíèå óòèëèòû ðåçåâíîãî êîïèðîâàíèÿ èëè êîïèðîâàíèÿ ôàéëîâ, òàêèå êàê WinZip, tar, copy, xcopy è äð. íà ÁÄ êîòîðàÿ ðàáîòàåò. Íå òîëüêî ðåçåðâíîå êîïèðîâàíèå áó äåò íåíàäåæíî, íî è áëîêèðîâêà íà äèñêîâîì óðîâíå, èñïîëüçóåìûå ýòèìè óòèëèòàìè, ìîæåò èñïîðòèòü ðàáîòàþùóþ ÁÄ. Âàæíî. Èçó÷èòå ïðåäóïðåæäåíèÿ â ñëåäóþùåì ðàçäåëå î àêòèâíîñòè ÁÄ âî âðåìÿ âîññòàíîâ ëåíèÿ ðåçåðâíîé êîïèè! 9.3. Êàê ðàçðóøèòü áàçó äàííûõ
9.3.1. Èçìåíåíèå ìåòàäàííûõ òàáëèö
Firebird õðàíèò è îáñëóæèâàåò âñå ñâîè è ïîëüçîâàòåëüñêèå ìåòàäàííûå â ÁÄ Firebird! Åñëè áîëåå òî÷íî, òî îí õðàíèò èõ â òàáëèöàõ (relations, tables) ñàìîé ÁÄ. Èäåíòèôèêàòîðû ñèñòåìíûõ òàáëèö, èõ ïîëÿ è íåêîòîðûå äðóãèå òèïû ñèñòåìíûõ îáúåêòîâ íà÷èíàþòñÿ ñ ñèìâîëîâ ½RDB$“ . Òàê êàê îíè îáû÷íûå îáúåêòû ÁÄ, îíè ìîãóò áûòü çàïðîøåíû è èñïîëüçîâàíû êàê âàøè ïîëüçîâà òåëüñêèå îáúåêòû. Îäíàêî, ãîâîðÿ ÷òî âû ìîæåòå íå îçíà÷àåò ÷òî âû äîëæíû. (However, just because you can does not say you should.)  äâèæêå Firebird ðåàëèçîâàíî âûñîêîóðîâíåâîå ïîäìíîæåñòâî ÿçûêà SQL (DDL) äëÿ îïðåäåëåíèÿ è óïðàâëåíèÿ ìåòàäàííûìè îáúåêòîâ, îáû÷íî ïîñðåäñòâîì îïåðàòîðîâ CREATE, ALTER è DROP. Ýòî òàêæå íå ìîæåò áûòü íàñòîé÷èâî ðåêîìåíäîâàíî ÷òîáû âû èñïîëüçîâàëè DDL, à íå ïðÿìûå SQL îïåðàöèè íàä ñèñòåìíûìè òàáëèöàìè, âñÿêèé ðàç êîãäà âàì íóæíî èçìåíèòü èëè óäàëèòü ìåòàäàííûå. Îòëîæèòå ½hot x“ stu ïîêà âàøè íàâûêè â SQL è âàøè çíàíèÿ î Firebird íå ñòàíóò î÷åíü ïðîäâèíóòûìè. A wrecked database is neither pretty to behold nor cheap to repair. 9.3.2. Îòêëþ÷åíèå forced writes ïîä Windows
Firebird ïî óìîë÷àíèþ óñòàíàâëèâàåòñÿ ñ âêëþ÷åííîé îïöèåé forced writes (ñèíõðîííàÿ çàïèñü). Èçìå íåííûå è íîâûå äàííûå ñáðàñûâàþòñÿ íà äèñê íåìåäëåííî ïîñëå çàïèñè. Òàêæå âîçìîæíî íàñòðîèòü ÁÄ èñïîëüçîâàòü àñèíõðîííóþ çàïèñü, ïðè ïîìîùè ÷åãî èçìåíåííûå èëè íîâûå äàííûå äåðæàòñÿ â êýøå è ïåðèîäè÷åñêè ñáðàñûâàþòñÿ íà äèñê ïîäñèñòåìîé ââîäà/âûâîäà îïåðà öèîííîé ñèñòåìû. Îáùèé òåðìèí äëÿ òàêîé êîíôèãóðàöèè ýòî forced writes o (èëè îòêëþ÷åíû). Ê ýòîìó èíîãäà ïðèáåãàþò äëÿ ïîâûøåíèÿ ïðîèçâîäèòåëüíîñòè ïðè âûïîëíåíèè áîëüøîé ñåðèè îïåðàöèé. Âàæíîå ïðåäóïðåæäåíèå íå îòêëþ÷àéòå forced writes íà Windows-ñåðâåðå. Ïðè íàáëþäåíèè âûÿñíèëîñü, ÷òî Windows-ñåðâåðà íå ñáðàñûâàþò êýø ïîêà ñåðâèñ Firebird íå áóäåò âûêëþ÷åí. Êðîìå ïåðåáîåâ â ïèòàíèè, ìíîãî ÷åãî ìîæåò ñëó÷èòüñÿ íà Windows-ñåðâåðå. Åñëè îí îñòàíîâèòñÿ, òî ñèñòåìû ââîäà/âûâîäà áóäåò íå äîñòóïíà è âàøè ïîëüçîâàòåëè ïîòåðÿþò ñâîè äàííûå â ïðîöåññå ïåðåçàãðóçêè. Windows 9x è ME íå ïîääåðæèâàþò îòëîæåííóþ çàïèñü. 9.3.3. Îòêëþ÷åíèå forced writes íà Linux-ñåðâåðå
Linux-ñåðâåðà â ýòîì ïëàíå áîëåå áåçîïàñíû ïðè ðàáîòå îïåðàöèè ñ îòêëþ÷åííûìè íà âðåìÿ forced writes. Íå îñòàâëÿéòå ýòó îïöèþ âûêëþ÷åííîé ïîñëå âûïîëíåíèÿ áîëüøîé ñåðèè îïåðàöèé, çà èñêëþ÷å íèåì åñëè ó âàñ åñòü ìîùíàÿ ñèñòåìà ðåçåðâíîãî ïèòàíèÿ. 16
9.3.4. Âîññòàíîâëåíèå ðåçåðâíîé êîïèè ïîâåðõ îòêðûòîé áàçû äàííûõ Îäíà èç îïöèé âîññòàíîâëåíèÿ ó óòèëèòû gbak (gbak -r[estore]) ïîçâîëÿåò
âàì âîññòàíîâèòü ðå çåðâíóþ êîïèþ ïîâåðõ ñóùåñòâóþùåé ÁÄ. Âîçìîæíî äëÿ òàêîãî òèïà âîññòàíîâëåíèÿ ïðîäîëæèòü áåç ïðåäóïðåæäåíèÿ ïîêà ïîëüçîâàòåëè ïîäêëþ÷åíû ê ÁÄ. È êàê ðåçóëüòàò áóäåò íåñîìíåííî ïîð÷à ÁÄ. Ïîçàáîòåñü î òîì, ÷òîáû íàñòðîèòü âàøè óòèëèòû àäìèíèñòðèðîâàíèÿ è ïðîöåäóðû äëÿ ïðåäîò âðàùåíèÿ ëþáîé âîçìîæíîñòè, äëÿ ëþáîãî ïîëüçîâàòåëÿ (âêëþ÷àÿ SYSDBA), âîññòàíîâëåíèÿ ÁÄ åñëè ïîëüçîâàòåëè ê íåé ïîäêëþ÷åíû. Äëÿ èíôîðìàöèè ïî gbak ñì. Ãëàâó 21 Database Backup and Restore (ñòð. 390, Using Firebird ). Äëÿ èíôîðìàöèè ïî áëîêèðîâàíèþ äîñòóïà ïîëüçîâàòåëåé ñì. Ãëàâó 14 Getting exclusive access to a database (ñòð. 283, Using Firebird ). Åñëè ýòî ðåàëüíî, ðåêîìåíäóåòñÿ âîññòàíàâëèâàòü ðåçåðâíóþ êîïèþ ïðèìåíÿÿ îïöèþ gbak -c[reate] è ïðîòåñòèðîâàòü âîññòàíîâëåííóþ ÁÄ èñïîëüçóÿ isql èëè âàøó ëþáèìóþ óòèëèòó. Åñëè âîññòàíîâëåí íàÿ ÁÄ ðàáîòàåò, òî îñòàíîâèòå ñåðâåð. Ñäåëàéòå êîïèþ ñòàðîé ÁÄ è ñêîïèðóéòå ôàéë (èëè ôàéëû) âîññòàíîâëåííîé ÁÄ ïîâåðõ åãî ñóùåñòâóþùåé êîïèè. 9.3.5. Âîçìîæíîñòü ïîëüçîâàòåëåé ïîäêëþ÷àòüñÿ ê ÁÄ âî âðåìÿ âîññòàíîâëåíèÿ
Åñëè âû íåçàáëîêèðîâàëè äîñòóï ïîëüçîâàòåëÿì âî âðåìÿ âûïîëíåíèÿ îïåðàöèè âîññòàíîâëåíèÿ èñ ïîëüçóÿ gbak -r[estore], òî ïîëüçîâàòåëè ìîãóò ïîäêëþ÷èòüñÿ ê ÁÄ è ïðîèçâåñòè îïåðàöèè íàä äàííûìè. È êàê ðåçóëüòàò áóäóò èñïîð÷åíû ñòðóêòóðû. 10. Êóäà äàëüøå? 10.1. Êàê ïîëó÷èòü ïîìîùü
Ñîîáùåñòâî äîáðîâîëüöåâ âîêðóã Firebird óõîäèò äàëåêîå â ïðîøëîå, ìíîãî ëåò íàçàä ïåðåä òåì êàê ñäåëàòü êîä åãî ïðåäêà Interbase 6 open source. Ñîîáùà ñîîáùåñòâî Firebird èìååò îòâåòû íà âñå âîïðîñû! Îíî äàæå èìååò íåêîòîðûõ ëþäåé êòî áûë ñâÿçàí ñ íèì ñ ìîìåíòà ïðîåêòèðîâàíèÿ íà ÷åðòåæíîé äîñêå â âàííîé êîìíàòå â Áîñòîíå. • Ïîñåòèòå îôèöèàëüíûé ñàéò ïðîåêòà Firebird http://firebird.sourceforge.net è ïîäïèøèòåñü íà ðàññûëêè ïî ïîääåðæêå ïîëüçîâàòåëåé. • Ïîñåòèòå áàçó çíàíèé ïî Firebird ïî àäðåñó http://www.ibphoenix.com, ÷òîáû íàéòè ãðîìàäíóþ êîëëåêöèþ èíôîðìàöèè ïî ðàçðàáîòêå è èñïîëüçîâàíèþ Firebird. • Âîçüìèòå ðóêîâîäñòâà Using Firebird è The Firebird Reference Guide. Îáà ðóêîâîäñòâà ïîñòàâ ëÿþòñÿ íà IBPhoenix CD êàê ýëåêòðîííûå êíèãè ïîäîáíî ýòîé. • Ïðî÷òèòå Resources and References èç ðóêîâîäñòâà Using Firebird (ñòð. 399, ãëàâà 10) äëÿ êîëëåêöèè ïîëåçíûõ ðåñóðñîâ ïî Firebird, SQL è ðàçðàáîòêå ïðèëîæåíèé áàç äàííûõ. 10.2. Èñïîëüçîâàíèå êíèã îò IBPhoenix Publications
Ðóêîâîäñòâà Using Firebird è The Firebird Reference Guide âûïîëíåíû äëÿ ëåãêîãî èõ èñïîëüçîâàíèÿ è äîñòóïà âî âðåìÿ âàøåé ðàáîòû. Êíîïêà â ïðàâîì-âåðõíåì óãëó êàæäîé ñòðàíèöû çàñòàâëÿåò Acrobat Reader ïåðåêëþ÷àòüñÿ íàçàä è âïåðåä ìåæäó ýòèìè äâóìÿ ðóêîâîäñòâàìè. Òàêæå íà êàæäîé ñòðàíèöå åñòü ïàíåëü íàâèãàöèè ñ êíîïêàìè, ñëóæàùèå äëÿ ïåðåìåùåíèÿ âàñ ïðÿìî ê ïðåäìåòíîìó óêàçàòåëþ äëÿ âûáðàííîãî ñèìâîëà. Âñå ýëåìåíòû ïðåäìåòíîãî óêàçàòåëÿ èìåþò ãèïåðññûëêè íà èõ èñòî÷íèêè. Åñëè ÷èòàòåëü óñòàíîâèò ìàñøòàá 125%, òî áóäóò âèäíû ïîëíîñòüþ ñòðàíèöà è ãèïåðòåêñòîâîå ìåíþ. 17
Î äîïîëíèòåëüíûõ äåòàëÿõ ïî íàñòðîéêå âàøåãî ñåðâåðà è ñåòè îáðàòèòåñü ê íà÷àëüíûì ãëàâàì ðóêî âîäñòâà Using Firebird. Ãëàâà 7 ðóêîâîäñòâî ïî óñòðàíåíèþ ïðîáëåì. Ïîñëåäóþùèå ãëàâû ïî î÷åðåäè ðàññêàçûâàþò î âîïðîñàõ ïðîåêòèðîâàíèÿ, ÿçûêà è ðàçðàáîòêè, è ïðåäîñòàâëÿþò äåòàëüíûå èíñòðóêöèè ïî èñïîëüçîâàíèþ óòèëèò êîìàíäíîé ñòðîêè. 11. Ïðîåêò Firebird
Ðàçðàáîò÷èêè, ïðîåêòèðîâùèêè è òåñòåðû, êîòîðûå äàþò âàì Firebird è íåêîòîðûå äðàéâåðà, ÿâëÿ þòñÿ ó÷àñòíèêàìè open source ïðîåêòà Firebird íà SourceForge óäèâèòåëüíîå âèðòóàëüíîå ñîîáùåñòâî ÿâëÿþùååñÿ äîìîì äëÿ òûñÿ÷ êîìàíä ðàçðàáàòûâàþùèõ open source ÏÎ. Àäðåñ ïðîåêòà Firebird http://sourceforge.net/projects/firebird. Íà ýòîì ñàéòå âû íàéäåòå èñõîäíûé êîä, bug tracker è ôàé ëû êîòîðûå ìîãóò áûòü ñêà÷àíû äëÿ ðàçëè÷íûõ öåëåé ïðè ðàçðàáîòêå è òåñòèðîâàíèè êîäà. Ðàçðàáîò÷èêè è òåñòåðû ïðîåêòà Firebird èñïîëüçóþò ñïèñîê ðàññûëêè
[email protected] êàê ½âèðòóàëüíóþ ëàáîðàòîðèþ“ äëÿ îáùåíèÿ äðóã ñ äðóãîì î èõ ðàáîòå ïî ñîâåðøåíñòâîâàíèþ Firebird, óñòðàíåíèþ áàãîâ (bug-xing) è âûïóñêó íîâûõ âåðñèé Firebird. Ëþáîé êòî çàèíòåðåñîâàí â íàáëþäåíèè çà ïðîåêòîì ìîæåò ïîäïèñàòüñÿ íà ýòîò ñïèñîê ðàññûëêè. Îäíàêî âîïðîñû ïîëüçîâàòåëåé (íå ðàçðàáîò÷èêîâ ïðèì. ïåð.) îòâëåêàþò âíèìàíèå, ïîýòîìó îíè íå ïðèâåòñòâóþòñÿ. Ïîæàëóéñòà íå ïûòàéòåñü òàì çàäàâàòü âîïðîñû ïî èñïîëüçîâàíèþ Firebird, ò.å. íå êàñàþùèåñÿ ñàìîãî ïðîöåññà ðàçðàáîòêè!
18
Ïðåäìåòíûé óêàçàòåëü
çàïóñê, 12 Ping, 6 SQL-îïåðàòîð CONNECT, 11
Àïîñòðîôû â ñòðîêàõ, 14 Àïïëåò Ïàíåëè Óïðàâëåíèÿ, 7 Firebird Manager, 7 Áàçà äàííûõ íà CD-ROM, 5 ïîäêëþ÷åíèå, 10 ïóòü, 11 ñîçäàíèå èñïîëüçóÿ isql, 12 òîëüêî äëÿ ÷òåíèÿ, 5 employee.gdb, 10 Èäåíòèôèêàòîðû â äâîéíûõ êàâû÷êàõ, 14 Èìÿ ïîëüçîâàòåëÿ ïî óìîë÷àíèþ, 9 SYSDBA, 9 Èìÿ ñåðâåðà è ïóòü, 11 Ïàðîëü êàê ïîìåíÿòü, 10 ïî óìîë÷àíèþ, 9 masterkey, 9 Ïîëó÷èòü ïîìîùü, 17 Ïðîåêò Firebird, 18 Ïðîâåðêà, ÷òî ñåðâåð ðàáîòàåò, 7 Ïóòü, 11 Ðåçåðâíîå êîïèðîâàíèå, 16 Ñèìâîë îãðàíè÷åíèÿ ñòðîêè, 14 Ñèñòåìíûå òàáëèöû, 16 Ñòðîêè ñîåäèíåíèå, 14 Óñòàíîâêà äèñêè, 5 êîìïëåêòû ÏÎ, 4 ðàçìåùåíèå ôàéëîâ, 4 âåðñèè äî Firebird 1.5, 4 âåðñèè îò Firebird 1.5 è âûøå, 4 ñêðèïò èëè ïðîãðàììà, 5 client-only, 13 Óòèëèòà äëÿ àäìèíèñòðèðîâàíèÿ, 10 top (Linux), 9 Âûðàæåíèÿ âêëþ÷àþùèå NULL, 15 Forced writes, 16 gbak ïîäêëþ÷åíèå âî âðåìÿ âîññòàíîâëåíèÿ, 17 âîññòàíîâëåíèå ïîâåðõ îòêðûòîé ÁÄ, 17 isql 19