diff options
Diffstat (limited to 'manuals/en/main/sqlite.tex')
-rw-r--r-- | manuals/en/main/sqlite.tex | 172 |
1 files changed, 0 insertions, 172 deletions
diff --git a/manuals/en/main/sqlite.tex b/manuals/en/main/sqlite.tex deleted file mode 100644 index f3eabdf..0000000 --- a/manuals/en/main/sqlite.tex +++ /dev/null @@ -1,172 +0,0 @@ -%% -%% - -\chapter{Installing and Configuring SQLite} -\label{SqlLiteChapter} -\index[general]{Installing and Configuring SQLite} -\index[general]{SQLite!Installing and Configuring} - -Please note that SQLite both versions 2 and 3 are not network enabled, -which means that they must be linked into the Director rather than accessed -by the network as MySQL and PostgreSQL are. This has two consequences: -\begin{enumerate} -\item SQLite cannot be used in the {\bf bweb} web GUI package. -\item If you use SQLite, and your Storage daemon is not on the same -machine as your Director, you will need to transfer your database -to the Storage daemon's machine before you can use any of the SD tools -such as {\bf bscan}, ... -\end{enumerate} - -\section{Installing and Configuring SQLite -- Phase I} -\index[general]{Phase I!Installing and Configuring SQLite -- } -\index[general]{Installing and Configuring SQLite -- Phase I} - -If you use the {\bf ./configure \verb:--:with-sqlite} statement for configuring {\bf -Bareos}, you will need SQLite version 2.8.16 or later installed. Our standard -location (for the moment) for SQLite is in the dependency package {\bf -depkgs/sqlite-2.8.16}. Please note that the version will be updated as new -versions are available and tested. - -Installing and Configuring is quite easy. - -\begin{enumerate} -\item Download the Bareos dependency packages -\item Detar it with something like: - -\begin{verbatim} - tar xvfz depkgs.tar.gz -\end{verbatim} - - Note, the above command requires GNU tar. If you do not have GNU tar, a - command such as: - -\begin{verbatim} - zcat depkgs.tar.gz | tar xvf - -\end{verbatim} - - will probably accomplish the same thing. - -\item {\bf cd depkgs} - -\item {\bf make sqlite} - -\end{enumerate} - - -Please note that the {\bf ./configure} used to build {\bf Bareos} will need to -include {\bf \verb:--:with-sqlite} or {\bf \verb:--:with-sqlite3} depending -one which version of SQLite you are using. You should not use the {\bf -\verb:--:enable-batch-insert} configuration parameter for Bareos if you -are using SQLite version 2 as it is probably not thread safe. If you -are using SQLite version 3, you may use the {\bf \verb:--:enable-batch-insert} -configuration option with Bareos, but when building SQLite3 you MUST -configure it with {\bf \verb:--:enable-threadsafe} and -{\bf \verb:--:enable-cross-thread-connections}. - -By default, SQLite3 is now run with {\bf PRAGMA synchronous=OFF} this -increases the speed by more than 30 time, but it also increases the -possibility of a corrupted database if your server crashes (power failure -or kernel bug). If you want more security, you can change the PRAGMA -that is used in the file src/version.h. - - -At this point, you should return to completing the installation of {\bf -Bareos}. - - -\section{Installing and Configuring SQLite -- Phase II} -\label{phase2} -\index[general]{Phase II!Installing and Configuring SQLite -- } -\index[general]{Installing and Configuring SQLite -- Phase II} - -This phase is done {\bf after} you have run the {\bf ./configure} command to -configure {\bf Bareos}. - -{\bf Bareos} will install scripts for manipulating the database (create, -delete, make tables etc) into the main installation directory. These files -will be of the form *\_bareos\_* (e.g. create\_bareos\_database). These files -are also available in the {\textless}bareos-src{\textgreater}/src/cats directory after -running ./configure. If you inspect create\_bareos\_database, you will see -that it calls create\_sqlite\_database. The *\_bareos\_* files are provided -for convenience. It doesn't matter what database you have chosen; -create\_bareos\_database will always create your database. - -At this point, you can create the SQLite database and tables: - -\begin{enumerate} -\item cd {\textless}install-directory{\textgreater} - - This directory contains the Bareos catalog interface routines. - -\item ./make\_sqlite\_tables - - This script creates the SQLite database as well as the tables used by {\bf - Bareos}. This script will be automatically setup by the {\bf ./configure} - program to create a database named {\bf bareos.db} in {\bf Bareos's} working - directory. -\end{enumerate} - -\section{Linking Bareos with SQLite} -\index[general]{SQLite!Linking Bareos with} -\index[general]{Linking Bareos with SQLite} - -If you have followed the above steps, this will all happen automatically and -the SQLite libraries will be linked into {\bf Bareos}. - -\section{Testing SQLite} -\index[general]{SQLite!Testing} -\index[general]{Testing SQLite} - -We have much less "production" experience using SQLite than using MySQL. -SQLite has performed flawlessly for us in all our testing. However, -several users have reported corrupted databases while using SQLite. For -that reason, we do not recommend it for production use. - -If Bareos crashes with the following type of error when it is started: -\footnotesize -\begin{verbatim} -Using default Catalog name=MyCatalog DB=bareos -Could not open database "bareos". -sqlite.c:151 Unable to open Database=/var/lib/bareos/bareos.db. -ERR=malformed database schema - unable to open a temporary database file -for storing temporary tables -\end{verbatim} -\normalsize - -this is most likely caused by the fact that some versions of -SQLite attempt to create a temporary file in the current directory. -If that fails, because Bareos does not have write permission on -the current directory, then you may get this errr. The solution is -to start Bareos in a current directory where it has write permission. - - -\section{Re-initializing the Catalog Database} -\index[general]{Database!Re-initializing the Catalog} -\index[general]{Re-initializing the Catalog Database} - -After you have done some initial testing with {\bf Bareos}, you will probably -want to re-initialize the catalog database and throw away all the test Jobs -that you ran. To do so, you can do the following: - -\footnotesize -\begin{verbatim} - cd <install-directory> - ./drop_sqlite_tables - ./make_sqlite_tables -\end{verbatim} -\normalsize - -Please note that all information in the database will be lost and you will be -starting from scratch. If you have written on any Volumes, you must write an -end of file mark on the volume so that Bareos can reuse it. Do so with: - -\footnotesize -\begin{verbatim} - (stop Bareos or unmount the drive) - mt -f /dev/nst0 rewind - mt -f /dev/nst0 weof -\end{verbatim} -\normalsize - -Where you should replace {\bf /dev/nst0} with the appropriate tape drive -device name for your machine. |