]> git.sur5r.net Git - bacula/docs/blob - docs/manual/sqlite.tex
Initial revision
[bacula/docs] / docs / manual / sqlite.tex
1 %%
2 %%
3
4 \section*{Installing and Configuring SQLite}
5 \label{_ChapterStart33}
6 \index[general]{Installing and Configuring SQLite }
7 \index[general]{SQLite!Installing and Configuring }
8 \addcontentsline{toc}{section}{Installing and Configuring SQLite}
9
10 \subsection*{Installing and Configuring SQLite -- Phase I}
11 \index[general]{Phase I!Installing and Configuring SQLite -- }
12 \index[general]{Installing and Configuring SQLite -- Phase I }
13 \addcontentsline{toc}{subsection}{Installing and Configuring SQLite -- Phase
14 I}
15
16 If you use the {\bf ./configure \verb{--{with-sqlite} statement for configuring {\bf
17 Bacula}, you will need SQLite version 2.2.3 or later installed. Our standard
18 location (for the moment) for SQLite is in the dependency package {\bf
19 depkgs/sqlite-2.2.3}. Please note that the version will be updated as new
20 versions are available and tested. 
21
22 Installing and Configuring is quite easy. 
23
24 \begin{enumerate}
25 \item Download the Bacula dependency packages  
26 \item Detar it with something like:
27
28    {\bf tar xvfz depkgs.tar.gz}  
29
30 Note, the above command requires GNU tar. If you do not  have GNU tar, a
31 command such as:
32
33 {\bf zcat depkgs.tar.gz | tar xvf -}
34
35 will probably accomplish the same thing. 
36
37 \item {\bf cd depkgs}
38
39 \item {\bf make sqlite}  
40
41    \end{enumerate}
42
43 At this point, you should return to completing the installation of {\bf
44 Bacula}. 
45
46 Please note that the {\bf ./configure} used to build {\bf Bacula} will need to
47 include {\bf \verb{--{with-sqlite}. 
48
49 \subsection*{Installing and Configuring SQLite -- Phase II}
50 \label{phase2}
51 \index[general]{Phase II!Installing and Configuring SQLite -- }
52 \index[general]{Installing and Configuring SQLite -- Phase II }
53 \addcontentsline{toc}{subsection}{Installing and Configuring SQLite -- Phase
54 II}
55
56 This phase is done {\bf after} you have run the {\bf ./configure} command to
57 configure {\bf Bacula}. 
58
59 {\bf Bacula} will install scripts for manipulating the database (create,
60 delete, make tables etc) into the main installation directory. These files
61 will be of the form *\_bacula\_* (e.g. create\_bacula\_database). These files
62 are also available in the \lt{}bacula-src\gt{}/src/cats directory after
63 running ./configure. If you inspect create\_bacula\_database, you will see
64 that it calls create\_sqlite\_database. The *\_bacula\_* files are provided
65 for convenience. It doesn't matter what database you have chosen;
66 create\_bacula\_database will always create your database. 
67
68 At this point, you can create the SQLite database and tables: 
69
70 \begin{enumerate}
71 \item cd \lt{}install-directory\gt{}
72
73    This directory contains the Bacula catalog  interface routines.  
74
75 \item ./make\_sqlite\_tables
76
77    This script creates the SQLite database as well as the  tables used by {\bf
78 Bacula}. This script will be  automatically setup by the {\bf ./configure}
79 program  to create a database named {\bf bacula.db} in {\bf Bacula's}  working
80 directory. 
81 \end{enumerate}
82
83 \subsection*{Linking Bacula with SQLite}
84 \index[general]{SQLite!Linking Bacula with }
85 \index[general]{Linking Bacula with SQLite }
86 \addcontentsline{toc}{subsection}{Linking Bacula with SQLite}
87
88 If you have followed the above steps, this will all happen automatically and
89 the SQLite libraries will be linked into {\bf Bacula}. 
90
91 \subsection*{Testing SQLite}
92 \index[general]{SQLite!Testing }
93 \index[general]{Testing SQLite }
94 \addcontentsline{toc}{subsection}{Testing SQLite}
95
96 As of this date (20 March 2002), we have much less ``production'' experience
97 using SQLite than using MySQL. That said, we should note that SQLite has
98 performed flawlessly for us in all our testing. 
99
100 \subsection*{Re-initializing the Catalog Database}
101 \index[general]{Database!Re-initializing the Catalog }
102 \index[general]{Re-initializing the Catalog Database }
103 \addcontentsline{toc}{subsection}{Re-initializing the Catalog Database}
104
105 After you have done some initial testing with {\bf Bacula}, you will probably
106 want to re-initialize the catalog database and throw away all the test Jobs
107 that you ran. To do so, you can do the following: 
108
109 \footnotesize
110 \begin{verbatim}
111   cd <install-directory>
112   ./drop_sqlite_tables
113   ./make_sqlite_tables
114 \end{verbatim}
115 \normalsize
116
117 Please note that all information in the database will be lost and you will be
118 starting from scratch. If you have written on any Volumes, you must write and
119 end of file mark on the volume so that Bacula can reuse it. Do so with: 
120
121 \footnotesize
122 \begin{verbatim}
123    (stop Bacula or unmount the drive)
124    mt -f /dev/nst0 rewind
125    mt -f /dev/nst0 weof
126 \end{verbatim}
127 \normalsize
128
129 Where you should replace {\bf /dev/nst0} with the appropriate tape drive
130 device name for your machine.