<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>8.3.14. dump — groonga v3.0.5 documentation</title> <link rel="stylesheet" href="../../_static/groonga.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../../', VERSION: '3.0.5', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script> <link rel="shortcut icon" href="../../_static/favicon.ico"/> <link rel="top" title="groonga v3.0.5 documentation" href="../../index.html" /> <link rel="up" title="8.3. Command" href="../command.html" /> <link rel="next" title="8.3.15. load" href="load.html" /> <link rel="prev" title="8.3.13. delete" href="delete.html" /> </head> <body> <div class="header"> <h1 class="title"> <a id="top-link" href="../../index.html"> <span class="project">groonga</span> <span class="separator">-</span> <span class="description">An open-source fulltext search engine and column store.</span> </a> </h1> <div class="other-language-links"> <ul> <li><a href="../../../../ja/html/reference/commands/dump.html"><img src="../../_static/jp.png" alt="日本語">日本語版はこちら</a></li> </ul> </div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="load.html" title="8.3.15. load" accesskey="N">next</a> |</li> <li class="right" > <a href="delete.html" title="8.3.13. delete" accesskey="P">previous</a> |</li> <li><a href="../../index.html">groonga v3.0.5 documentation</a> »</li> <li><a href="../../reference.html" >8. リファレンスマニュアル</a> »</li> <li><a href="../command.html" accesskey="U">8.3. Command</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="dump"> <h1>8.3.14. dump<a class="headerlink" href="#dump" title="Permalink to this headline">¶</a></h1> <div class="section" id="id1"> <h2>8.3.14.1. 名前<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2> <p>dump - データベースのスキーマとデータを出力する</p> </div> <div class="section" id="id2"> <h2>8.3.14.2. 書式<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2> <div class="highlight-none"><div class="highlight"><pre>dump [tables] </pre></div> </div> </div> <div class="section" id="id3"> <h2>8.3.14.3. 説明<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2> <p>groonga組込コマンドの一つであるdumpについて説明します。組込コマンドは、groonga実行ファイルの引数、標準入力、またはソケット経由でgroongaサーバにリクエストを送信することによって実行します。</p> <p>dumpはデータベースのスキーマとデータを後から読み込めるフォーマットで出力します。dumpの結果は大きくなるため、主にコマンドラインから使うことを想定しています。データベースのバックアップが主な利用方法です。</p> <p>dumpが出力するフォーマットは直接groongaが解釈できるフォーマットです。そのため、以下のようにしてデータベースをコピーすることができます。:</p> <div class="highlight-none"><div class="highlight"><pre>% groonga original/db dump > dump.grn % mkdir backup % groonga -n backup/db < dump.grn </pre></div> </div> </div> <div class="section" id="id4"> <h2>8.3.14.4. 引数<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2> <p><tt class="docutils literal"><span class="pre">tables</span></tt></p> <blockquote> <div>出力対象のテーブルを「,」(カンマ)区切りで指定します。存在しないテーブルを指定した場合は無視されます。</div></blockquote> </div> <div class="section" id="id5"> <h2>8.3.14.5. 返値<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2> <p>データベースのスキーマとデータをgroongaの組み込みコマンド呼び出し形式で出力します。output_type指定は無視されます。</p> </div> <div class="section" id="id6"> <h2>8.3.14.6. 例<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2> <p>データベース内のすべてのデータを出力:</p> <div class="highlight-none"><div class="highlight"><pre>> dump table_create LocalNames 48 ShortText table_create Entries 48 ShortText column_create Entries local_name 0 LocalNames column_create LocalNames Entries_local_name 2 Entries local_name ... load --table LocalNames [ ["_key"], ["Items"], ["BLT"], ... ] ... </pre></div> </div> <p>データベース内のスキーマと特定のテーブルのデータのみ出力:</p> <div class="highlight-none"><div class="highlight"><pre>> dump --tables Users,Sites table_create Users TABLE_HASH_KEY ShortText column_create Users name COLUMN_SCALAR ShortText table_create Comments TABLE_PAT_KEY ShortText column_create Comments text COLUMN_SCALAR ShortText table_create Sites TABLE_NO_KEY column_create Sites url COLUMN_SCALAR ShortText load --table Users [ ["_key"], ["mori"], ["yu"], ... ] load --table Sites [ ["_id","url"], [1,"http://groonga.org/"], [2,"http://qwik.jp/senna/"], ... ] </pre></div> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">8.3.14. dump</a><ul> <li><a class="reference internal" href="#id1">8.3.14.1. 名前</a></li> <li><a class="reference internal" href="#id2">8.3.14.2. 書式</a></li> <li><a class="reference internal" href="#id3">8.3.14.3. 説明</a></li> <li><a class="reference internal" href="#id4">8.3.14.4. 引数</a></li> <li><a class="reference internal" href="#id5">8.3.14.5. 返値</a></li> <li><a class="reference internal" href="#id6">8.3.14.6. 例</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="delete.html" title="previous chapter">8.3.13. delete</a></p> <h4>Next topic</h4> <p class="topless"><a href="load.html" title="next chapter">8.3.15. <tt class="docutils literal"><span class="pre">load</span></tt></a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../../_sources/reference/commands/dump.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="load.html" title="8.3.15. load" >next</a> |</li> <li class="right" > <a href="delete.html" title="8.3.13. delete" >previous</a> |</li> <li><a href="../../index.html">groonga v3.0.5 documentation</a> »</li> <li><a href="../../reference.html" >8. リファレンスマニュアル</a> »</li> <li><a href="../command.html" >8.3. Command</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009-2013, Brazil, Inc. </div> </body> </html>