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