gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
9.2KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!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>pg_waldump</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="pgupgrade.html" title="pg_upgrade" /><link rel="next" href="app-postgres.html" title="postgres" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center"><span xmlns="http://www.w3.org/1999/xhtml" class="application">pg_waldump</span></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="pgupgrade.html" title="pg_upgrade">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="reference-server.html" title="PostgreSQL Server Applications">Up</a></td><th width="60%" align="center">PostgreSQL Server Applications</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="app-postgres.html" title="postgres">Next</a></td></tr></table><hr></hr></div><div class="refentry" id="PGWALDUMP"><div class="titlepage"></div><a id="id-1.9.5.13.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle"><span class="application">pg_waldump</span></span></h2><p>pg_waldump — display a human-readable rendering of the write-ahead log of a <span class="productname">PostgreSQL</span> database cluster</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p id="id-1.9.5.13.4.1"><code class="command">pg_waldump</code> [<code class="option">option</code>...] [<code class="option">startseg</code> [<code class="option">endseg</code>]]</p></div></div><div class="refsect1" id="R1-APP-PGWALDUMP-1"><h2>Description</h2><p>
  3. <code class="command">pg_waldump</code> displays the write-ahead log (WAL) and is mainly
  4. useful for debugging or educational purposes.
  5. </p><p>
  6. This utility can only be run by the user who installed the server, because
  7. it requires read-only access to the data directory.
  8. </p></div><div class="refsect1" id="id-1.9.5.13.6"><h2>Options</h2><p>
  9. The following command-line options control the location and format of the
  10. output:
  11. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>startseg</code></em></span></dt><dd><p>
  12. Start reading at the specified log segment file. This implicitly determines
  13. the path in which files will be searched for, and the timeline to use.
  14. </p></dd><dt><span class="term"><em class="replaceable"><code>endseg</code></em></span></dt><dd><p>
  15. Stop after reading the specified log segment file.
  16. </p></dd><dt><span class="term"><code class="option">-b</code><br /></span><span class="term"><code class="option">--bkp-details</code></span></dt><dd><p>
  17. Output detailed information about backup blocks.
  18. </p></dd><dt><span class="term"><code class="option">-e <em class="replaceable"><code>end</code></em></code><br /></span><span class="term"><code class="option">--end=<em class="replaceable"><code>end</code></em></code></span></dt><dd><p>
  19. Stop reading at the specified WAL location, instead of reading to the
  20. end of the log stream.
  21. </p></dd><dt><span class="term"><code class="option">-f</code><br /></span><span class="term"><code class="option">--follow</code></span></dt><dd><p>
  22. After reaching the end of valid WAL, keep polling once per second for
  23. new WAL to appear.
  24. </p></dd><dt><span class="term"><code class="option">-n <em class="replaceable"><code>limit</code></em></code><br /></span><span class="term"><code class="option">--limit=<em class="replaceable"><code>limit</code></em></code></span></dt><dd><p>
  25. Display the specified number of records, then stop.
  26. </p></dd><dt><span class="term"><code class="option">-p <em class="replaceable"><code>path</code></em></code><br /></span><span class="term"><code class="option">--path=<em class="replaceable"><code>path</code></em></code></span></dt><dd><p>
  27. Specifies a directory to search for log segment files or a
  28. directory with a <code class="literal">pg_wal</code> subdirectory that
  29. contains such files. The default is to search in the current
  30. directory, the <code class="literal">pg_wal</code> subdirectory of the
  31. current directory, and the <code class="literal">pg_wal</code> subdirectory
  32. of <code class="envar">PGDATA</code>.
  33. </p></dd><dt><span class="term"><code class="option">-r <em class="replaceable"><code>rmgr</code></em></code><br /></span><span class="term"><code class="option">--rmgr=<em class="replaceable"><code>rmgr</code></em></code></span></dt><dd><p>
  34. Only display records generated by the specified resource manager.
  35. If <code class="literal">list</code> is passed as name, print a list of valid resource manager
  36. names, and exit.
  37. </p></dd><dt><span class="term"><code class="option">-s <em class="replaceable"><code>start</code></em></code><br /></span><span class="term"><code class="option">--start=<em class="replaceable"><code>start</code></em></code></span></dt><dd><p>
  38. WAL location at which to start reading. The default is to start reading
  39. the first valid log record found in the earliest file found.
  40. </p></dd><dt><span class="term"><code class="option">-t <em class="replaceable"><code>timeline</code></em></code><br /></span><span class="term"><code class="option">--timeline=<em class="replaceable"><code>timeline</code></em></code></span></dt><dd><p>
  41. Timeline from which to read log records. The default is to use the
  42. value in <em class="replaceable"><code>startseg</code></em>, if that is specified; otherwise, the
  43. default is 1.
  44. </p></dd><dt><span class="term"><code class="option">-V</code><br /></span><span class="term"><code class="option">--version</code></span></dt><dd><p>
  45. Print the <span class="application">pg_waldump</span> version and exit.
  46. </p></dd><dt><span class="term"><code class="option">-x <em class="replaceable"><code>xid</code></em></code><br /></span><span class="term"><code class="option">--xid=<em class="replaceable"><code>xid</code></em></code></span></dt><dd><p>
  47. Only display records marked with the given transaction ID.
  48. </p></dd><dt><span class="term"><code class="option">-z</code><br /></span><span class="term"><code class="option">--stats[=record]</code></span></dt><dd><p>
  49. Display summary statistics (number and size of records and
  50. full-page images) instead of individual records. Optionally
  51. generate statistics per-record instead of per-rmgr.
  52. </p></dd><dt><span class="term"><code class="option">-?</code><br /></span><span class="term"><code class="option">--help</code></span></dt><dd><p>
  53. Show help about <span class="application">pg_waldump</span> command line
  54. arguments, and exit.
  55. </p></dd></dl></div><p>
  56. </p></div><div class="refsect1" id="id-1.9.5.13.7"><h2>Environment</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="envar">PGDATA</code></span></dt><dd><p>
  57. Data directory; see also the <code class="option">-p</code> option.
  58. </p></dd><dt><span class="term"><code class="envar">PG_COLOR</code></span></dt><dd><p>
  59. Specifies whether to use color in diagnostic messages. Possible values
  60. are <code class="literal">always</code>, <code class="literal">auto</code> and
  61. <code class="literal">never</code>.
  62. </p></dd></dl></div></div><div class="refsect1" id="id-1.9.5.13.8"><h2>Notes</h2><p>
  63. Can give wrong results when the server is running.
  64. </p><p>
  65. Only the specified timeline is displayed (or the default, if none is
  66. specified). Records in other timelines are ignored.
  67. </p><p>
  68. <span class="application">pg_waldump</span> cannot read WAL files with suffix
  69. <code class="literal">.partial</code>. If those files need to be read, <code class="literal">.partial</code>
  70. suffix needs to be removed from the file name.
  71. </p></div><div class="refsect1" id="id-1.9.5.13.9"><h2>See Also</h2><span class="simplelist"><a class="xref" href="wal-internals.html" title="29.5. WAL Internals">Section 29.5</a></span></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pgupgrade.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-server.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="app-postgres.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="application">pg_upgrade</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="application">postgres</span></td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1