1<!--$Id: text.so,v 10.15 2001/03/13 20:39:47 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB Reference Guide: Loading text into databases</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<a name="2"><!--meow--></a> 12<table width="100%"><tr valign=top> 13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Dumping and Reloading</dl></b></td> 14<td align=right><a href="../dumpload/format.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../install/file.html"><img src="../../images/next.gif" alt="Next"></a> 15</td></tr></table> 16<p align=center><b>Loading text into databases</b></p> 17<p>The <a href="../../utility/db_load.html">db_load</a> utility can be used to load text into databases. 18The <b>-T</b> option permits nondatabase applications to create 19flat-text files that are then loaded into databases for fast, 20highly-concurrent access. For example, the following command loads the 21standard UNIX <b>/etc/passwd</b> file into a database, with the login 22name as the key item and the entire password entry as the data item:</p> 23<blockquote><pre>awk -F: '{print $1; print $0}' < /etc/passwd |\ 24 sed 's/\\/\\\\/g' | db_load -T -t hash passwd.db</pre></blockquote> 25<p>Note that backslash characters naturally occurring in the text are escaped 26to avoid interpretation as escape characters by <a href="../../utility/db_load.html">db_load</a>.</p> 27<table width="100%"><tr><td><br></td><td align=right><a href="../dumpload/format.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../install/file.html"><img src="../../images/next.gif" alt="Next"></a> 28</td></tr></table> 29<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 30</body> 31</html> 32