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