]> git.sur5r.net Git - bacula/docs/blobdiff - docs/manuals/en/catalog/catmaintenance.tex
Update catmaintenance + install + git
[bacula/docs] / docs / manuals / en / catalog / catmaintenance.tex
index bbdf013b84ad7916a97644921608b5d2b29540c6..ee0be08cdd96fbe99f499a1dc98d94c8f392ad2c 100644 (file)
@@ -271,6 +271,32 @@ the MySQL documentation, which can be found at:
 \elink{http://dev.mysql.com/doc/refman/5.0/en/gone-away.html}
 {http://dev.mysql.com/doc/refman/5.0/en/gone-away.html}
 
+\section{MySQL Temporary Tables}
+When doing backups with large numbers of files, MySQL creates some
+temporary tables.  When these tables are small they can be held in
+system memory, but as they approach some size, they
+spool off to disk.  The default location for these temp tables is
+/tmp.  Once that space fills up, Bacula daemons such as the Storage
+daemon doing spooling can get strange errors. E.g.
+
+\footnotesize                                 
+\begin{verbatim}
+Fatal error: spool.c:402 Spool data read error.
+Fatal error: backup.c:892 Network send error to SD. ERR=Connection reset by
+peer
+\end{verbatim}
+\normalsize
+
+What you need to do is setup MySQL to use a different (larger) temp
+directory, which can be set in the /etc/my.cnf with these variables
+set:
+
+\footnotesize                                 
+\begin{verbatim}
+  tmpdir=/path/to/larger/tmpdir
+  bdb_tmpdir=/path/to/larger/tmpdir
+\end{verbatim}
+\normalsize
 
 \label{RepairingPSQL}
 \section{Repairing Your PostgreSQL Database}
@@ -388,7 +414,7 @@ create them with the following commands:
 \begin{verbatim}
 mysql bacula
 CREATE INDEX file_jobid_idx on File (JobId);
-CREATE INDEX file_jpf_idx on File (Job, FilenameId, PathId);
+CREATE INDEX file_jpf_idx on File (JobId, FilenameId, PathId);
 \end{verbatim}
 \normalsize
 
@@ -428,7 +454,7 @@ On SQLite, you can check if you have the proper indexes by:
 
 \footnotesize
 \begin{verbatim}
-sqlite <path>bacula.db
+sqlite <path>/bacula.db
 select * from sqlite_master where type='index' and tbl_name='File';
 \end{verbatim}
 \normalsize
@@ -438,9 +464,9 @@ create them with the following commands:
 
 \footnotesize
 \begin{verbatim}
-mysql bacula
+sqlite <path>/bacula.db
 CREATE INDEX file_jobid_idx on File (JobId);
-CREATE INDEX file_jfp_idx on File (Job, FilenameId, PathId);
+CREATE INDEX file_jfp_idx on File (JobId, FilenameId, PathId);
 \end{verbatim}
 \normalsize
 
@@ -524,18 +550,18 @@ Director's configuration file. Note, in the case of SQLite, it is necessary to
 completely delete (rm) the old database before creating a new compressed
 version. 
 
-\section{Migrating from SQLite to MySQL}
+\section{Migrating from SQLite to MySQL or PostgreSQL}
 \index[general]{MySQL!Migrating from SQLite to }
-\index[general]{Migrating from SQLite to MySQL }
+\index[general]{Migrating from SQLite to MySQL or PostgreSQL}
 
 You may begin using Bacula with SQLite then later find that you want to switch
-to MySQL for any of a number of reasons: SQLite tends to use more disk than
-MySQL; when the database is corrupted it is often more catastrophic than
-with MySQL or PostgreSQL.
-Several users have succeeded in converting from SQLite to MySQL by
-exporting the MySQL data and then processing it with Perl scripts
-prior to putting it into MySQL. This is, however, not a simple
-process.
+to MySQL or Postgres for any of a number of reasons: SQLite tends to use more
+disk than MySQL; when the database is corrupted it is often more catastrophic
+than with MySQL or PostgreSQL.  Several users have succeeded in converting by
+exporting the SQLite data and then processing it with Perl scripts prior to
+putting it into MySQL or PostgreSQL. This is, however, not a simple process.
+Scripts are available on bacula source distribution under
+\texttt{examples/database}.
 
 \label{BackingUpBacula}
 \section{Backing Up Your Bacula Database}