| --- |
| layout: docpage |
| |
| title: "Documentation" |
| |
| is_homepage: false |
| is_sphinx_doc: true |
| |
| doc-parent: "Cassandra Tools" |
| |
| doc-parent: "SSTable Tools" |
| |
| doc-title: "sstableutil" |
| doc-header-links: ' |
| <link rel="top" title="Apache Cassandra Documentation v4.0-alpha2" href="../../index.html"/> |
| <link rel="up" title="SSTable Tools" href="index.html"/> |
| <link rel="next" title="sstableverify" href="sstableverify.html"/> |
| <link rel="prev" title="sstableupgrade" href="sstableupgrade.html"/> |
| ' |
| doc-search-path: "../../search.html" |
| |
| extra-footer: ' |
| <script type="text/javascript"> |
| var DOCUMENTATION_OPTIONS = { |
| URL_ROOT: "", |
| VERSION: "", |
| COLLAPSE_INDEX: false, |
| FILE_SUFFIX: ".html", |
| HAS_SOURCE: false, |
| SOURCELINK_SUFFIX: ".txt" |
| }; |
| </script> |
| ' |
| |
| --- |
| <div class="container-fluid"> |
| <div class="row"> |
| <div class="col-md-3"> |
| <div class="doc-navigation"> |
| <div class="doc-menu" role="navigation"> |
| <div class="navbar-header"> |
| <button type="button" class="pull-left navbar-toggle" data-toggle="collapse" data-target=".sidebar-navbar-collapse"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| </div> |
| <div class="navbar-collapse collapse sidebar-navbar-collapse"> |
| <form id="doc-search-form" class="navbar-form" action="../../search.html" method="get" role="search"> |
| <div class="form-group"> |
| <input type="text" size="30" class="form-control input-sm" name="q" placeholder="Search docs"> |
| <input type="hidden" name="check_keywords" value="yes" /> |
| <input type="hidden" name="area" value="default" /> |
| </div> |
| </form> |
| |
| |
| |
| <ul class="current"> |
| <li class="toctree-l1"><a class="reference internal" href="../../getting_started/index.html">Getting Started</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../architecture/index.html">Architecture</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../data_modeling/index.html">Data Modeling</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../cql/index.html">The Cassandra Query Language (CQL)</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../configuration/index.html">Configuring Cassandra</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../operating/index.html">Operating Cassandra</a></li> |
| <li class="toctree-l1 current"><a class="reference internal" href="../index.html">Cassandra Tools</a><ul class="current"> |
| <li class="toctree-l2"><a class="reference internal" href="../cqlsh.html">cqlsh: the CQL shell</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../nodetool/nodetool.html">Nodetool</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../nodetool/nodetool.html#usage">Usage</a></li> |
| <li class="toctree-l2 current"><a class="reference internal" href="index.html">SSTable Tools</a><ul class="current"> |
| <li class="toctree-l3"><a class="reference internal" href="sstabledump.html">sstabledump</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="sstableexpiredblockers.html">sstableexpiredblockers</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="sstablelevelreset.html">sstablelevelreset</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="sstableloader.html">sstableloader</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="sstablemetadata.html">sstablemetadata</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="sstableofflinerelevel.html">sstableofflinerelevel</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="sstablerepairedset.html">sstablerepairedset</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="sstablescrub.html">sstablescrub</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="sstablesplit.html">sstablesplit</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="sstableupgrade.html">sstableupgrade</a></li> |
| <li class="toctree-l3 current"><a class="current reference internal" href="#">sstableutil</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="sstableverify.html">sstableverify</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l2"><a class="reference internal" href="../cassandra_stress.html">Cassandra Stress</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l1"><a class="reference internal" href="../../troubleshooting/index.html">Troubleshooting</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../development/index.html">Contributing to Cassandra</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../faq/index.html">Frequently Asked Questions</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../plugins/index.html">Third-Party Plugins</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../bugs.html">Reporting Bugs</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../contactus.html">Contact us</a></li> |
| </ul> |
| |
| |
| |
| </div><!--/.nav-collapse --> |
| </div> |
| </div> |
| </div> |
| <div class="col-md-8"> |
| <div class="content doc-content"> |
| <div class="content-container"> |
| |
| <div class="section" id="sstableutil"> |
| <h1>sstableutil<a class="headerlink" href="#sstableutil" title="Permalink to this headline">¶</a></h1> |
| <p>List sstable files for the provided table.</p> |
| <p>ref: <a class="reference external" href="https://issues.apache.org/jira/browse/CASSANDRA-7066">https://issues.apache.org/jira/browse/CASSANDRA-7066</a></p> |
| <p>Cassandra must be stopped before this tool is executed, or unexpected results will occur. Note: the script does not verify that Cassandra is stopped.</p> |
| <div class="section" id="usage"> |
| <h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2> |
| <p>sstableutil <options> <keyspace> <table></p> |
| <table border="1" class="docutils"> |
| <colgroup> |
| <col width="30%" /> |
| <col width="70%" /> |
| </colgroup> |
| <tbody valign="top"> |
| <tr class="row-odd"><td>-c, –cleanup</td> |
| <td>clean up any outstanding transactions</td> |
| </tr> |
| <tr class="row-even"><td>-d, –debug</td> |
| <td>display stack traces</td> |
| </tr> |
| <tr class="row-odd"><td>-h, –help</td> |
| <td>display this help message</td> |
| </tr> |
| <tr class="row-even"><td>-o, –oplog</td> |
| <td>include operation logs</td> |
| </tr> |
| <tr class="row-odd"><td>-t, –type <arg></td> |
| <td>all (list all files, final or temporary), tmp (list temporary files only), |
| final (list final files only),</td> |
| </tr> |
| <tr class="row-even"><td>-v, –verbose</td> |
| <td>verbose output</td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="section" id="list-all-sstables"> |
| <h2>List all sstables<a class="headerlink" href="#list-all-sstables" title="Permalink to this headline">¶</a></h2> |
| <p>The basic command lists the sstables associated with a given keyspace/table.</p> |
| <p>Example:</p> |
| <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sstableutil</span> <span class="n">keyspace</span> <span class="n">eventlog</span> |
| <span class="n">Listing</span> <span class="n">files</span><span class="o">...</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">32</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">CRC</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">32</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Data</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">32</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Digest</span><span class="o">.</span><span class="n">crc32</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">32</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Filter</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">32</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Index</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">32</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Statistics</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">32</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Summary</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">32</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">TOC</span><span class="o">.</span><span class="n">txt</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">37</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">CRC</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">37</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Data</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">37</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Digest</span><span class="o">.</span><span class="n">crc32</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">37</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Filter</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">37</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Index</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">37</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Statistics</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">37</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">Summary</span><span class="o">.</span><span class="n">db</span> |
| <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cassandra</span><span class="o">/</span><span class="n">data</span><span class="o">/</span><span class="n">keyspace</span><span class="o">/</span><span class="n">eventlog</span><span class="o">-</span><span class="mi">6365332094</span><span class="n">dd11e88f324f9c503e4753</span><span class="o">/</span><span class="n">mc</span><span class="o">-</span><span class="mi">37</span><span class="o">-</span><span class="n">big</span><span class="o">-</span><span class="n">TOC</span><span class="o">.</span><span class="n">txt</span> |
| </pre></div> |
| </div> |
| </div> |
| <div class="section" id="list-only-temporary-sstables"> |
| <h2>List only temporary sstables<a class="headerlink" href="#list-only-temporary-sstables" title="Permalink to this headline">¶</a></h2> |
| <p>Using the -t option followed by <cite>tmp</cite> will list all temporary sstables, in the format above. Temporary sstables were used in pre-3.0 versions of Cassandra.</p> |
| </div> |
| <div class="section" id="list-only-final-sstables"> |
| <h2>List only final sstables<a class="headerlink" href="#list-only-final-sstables" title="Permalink to this headline">¶</a></h2> |
| <p>Using the -t option followed by <cite>final</cite> will list all final sstables, in the format above. In recent versions of Cassandra, this is the same output as not using the -t option.</p> |
| </div> |
| <div class="section" id="include-transaction-logs"> |
| <h2>Include transaction logs<a class="headerlink" href="#include-transaction-logs" title="Permalink to this headline">¶</a></h2> |
| <p>Using the -o option will include transaction logs in the listing, in the format above.</p> |
| </div> |
| <div class="section" id="clean-up-sstables"> |
| <h2>Clean up sstables<a class="headerlink" href="#clean-up-sstables" title="Permalink to this headline">¶</a></h2> |
| <p>Using the -c option removes any transactions left over from incomplete writes or compactions.</p> |
| <p>From the 3.0 upgrade notes:</p> |
| <p>New transaction log files have been introduced to replace the compactions_in_progress system table, temporary file markers (tmp and tmplink) and sstable ancestors. Therefore, compaction metadata no longer contains ancestors. Transaction log files list sstable descriptors involved in compactions and other operations such as flushing and streaming. Use the sstableutil tool to list any sstable files currently involved in operations not yet completed, which previously would have been marked as temporary. A transaction log file contains one sstable per line, with the prefix “add:” or “remove:”. They also contain a special line “commit”, only inserted at the end when the transaction is committed. On startup we use these files to cleanup any partial transactions that were in progress when the process exited. If the commit line is found, we keep new sstables (those with the “add” prefix) and delete the old sstables (those with the “remove” prefix), vice-versa if the commit line is missing. Should you lose or delete these log files, both old and new sstable files will be kept as live files, which will result in duplicated sstables. These files are protected by incremental checksums so you should not manually edit them. When restoring a full backup or moving sstable files, you should clean-up any left over transactions and their temporary files first.</p> |
| </div> |
| </div> |
| |
| |
| |
| |
| <div class="doc-prev-next-links" role="navigation" aria-label="footer navigation"> |
| |
| <a href="sstableverify.html" class="btn btn-default pull-right " role="button" title="sstableverify" accesskey="n">Next <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span></a> |
| |
| |
| <a href="sstableupgrade.html" class="btn btn-default" role="button" title="sstableupgrade" accesskey="p"><span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span> Previous</a> |
| |
| </div> |
| |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |