<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Recover a database &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/recover-a-database/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Thu, 05 Apr 2018 20:24:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>PostgreSQL: Use pg_resetxlog to recover the deleted pg_xlog data</title>
		<link>https://www.dbrnd.com/2018/04/postgresql-use-pg_resetxlog-to-recover-the-deleted-pg_xlog-data-pg_ctl-failed-backup/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 06 Apr 2018 16:16:05 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[PG_CTL failed]]></category>
		<category><![CDATA[pg_resetxlog]]></category>
		<category><![CDATA[pg_xlog]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Monitoring]]></category>
		<category><![CDATA[PostgreSQL Performance Tuning]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[Recover a database]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4604</guid>

					<description><![CDATA[If you don&#8217;t know the importance of pg_xlog, please visit a below article. PostgreSQL: Difference between pg_log, pg_clog and pg_xlog log directories Recently, we were facing a size related problem in one of our PostgreSQL test servers. A system admin found that the size of pg_xlog folder is large. What he did was, he deleted [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-use-pg_resetxlog-to-recover-the-deleted-pg_xlog-data-pg_ctl-failed-backup%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_resetxlog%20to%20recover%20the%20deleted%20pg_xlog%20data" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-use-pg_resetxlog-to-recover-the-deleted-pg_xlog-data-pg_ctl-failed-backup%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_resetxlog%20to%20recover%20the%20deleted%20pg_xlog%20data" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-use-pg_resetxlog-to-recover-the-deleted-pg_xlog-data-pg_ctl-failed-backup%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_resetxlog%20to%20recover%20the%20deleted%20pg_xlog%20data" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-use-pg_resetxlog-to-recover-the-deleted-pg_xlog-data-pg_ctl-failed-backup%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_resetxlog%20to%20recover%20the%20deleted%20pg_xlog%20data" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-use-pg_resetxlog-to-recover-the-deleted-pg_xlog-data-pg_ctl-failed-backup%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_resetxlog%20to%20recover%20the%20deleted%20pg_xlog%20data" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-use-pg_resetxlog-to-recover-the-deleted-pg_xlog-data-pg_ctl-failed-backup%2F&amp;linkname=PostgreSQL%3A%20Use%20pg_resetxlog%20to%20recover%20the%20deleted%20pg_xlog%20data" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-use-pg_resetxlog-to-recover-the-deleted-pg_xlog-data-pg_ctl-failed-backup%2F&#038;title=PostgreSQL%3A%20Use%20pg_resetxlog%20to%20recover%20the%20deleted%20pg_xlog%20data" data-a2a-url="https://www.dbrnd.com/2018/04/postgresql-use-pg_resetxlog-to-recover-the-deleted-pg_xlog-data-pg_ctl-failed-backup/" data-a2a-title="PostgreSQL: Use pg_resetxlog to recover the deleted pg_xlog data"></a></p><p>If you don&#8217;t know the importance of pg_xlog, please visit a below article.</p>
<blockquote class="wp-embedded-content" data-secret="WW1hmePK5k"><p><a href="https://www.dbrnd.com/2016/12/postgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log/">PostgreSQL: Difference between pg_log, pg_clog and pg_xlog log directories</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/12/postgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log/embed/#?secret=WW1hmePK5k" data-secret="WW1hmePK5k" width="600" height="338" title="&#8220;PostgreSQL: Difference between pg_log, pg_clog and pg_xlog log directories&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>Recently, we were facing a size related problem in one of our PostgreSQL test servers. A system admin found that the size of pg_xlog folder is large. What he did was, he deleted few log files from pg_xlog folder and restarted the PostgreSQL service without knowing the outcome. </p></blockquote>
<p>Postgres server got down immediately and threw error like &#8216;PG_CTL failed&#8217;.</p>
<blockquote><p>A pg_xlog folder contains the main transaction log files (WAL files) which are necessary to load the database and other objects. The size of pg_xlog folder is large, so if you are facing any size related problem, you can archive it. </p></blockquote>
<p>The very first step to recovering your database using a backup file, but if you don&#8217;t have any backup of a database, you have to use pg_resetxlog utility which reset the pg_xlog.</p>
<blockquote><p>pg_resetxlog may corrupt your database, or you may get data loss, as the documentation warns because of missing WAL files.<br />
After running this command, it should be possible to start the server but bear in mind that the database might contain inconsistent data due to partially-committed transactions. </p></blockquote>
<p><strong>Step 1:</strong></p>
<pre class="crayon-plain-tag">Go to /usr/bin/ directory</pre> </p>
<p><strong>Step 2: Execute pg_resetxlog utility to reset pg_xlog </strong></p>
<pre class="crayon-plain-tag">./pg_resetxlog -f /data/</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
