<?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>transaction log &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/transaction-log/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>Fri, 12 May 2017 13:47:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>SQL Server: Who dropped a table, find out from Transaction Log</title>
		<link>https://www.dbrnd.com/2017/05/sql-server-who-dropped-a-table-find-out-from-transaction-log-fn_dblog/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 24 May 2017 16:16:56 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[drop table]]></category>
		<category><![CDATA[fn_dblog()]]></category>
		<category><![CDATA[object security]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[transaction log]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5288</guid>

					<description><![CDATA[<div><img width="600" height="600" src="https://www.dbrnd.com/wp-content/uploads/2017/05/DropTableDatabase.png" class="attachment-post-image size-post-image wp-post-image" alt="DropTableDatabase" decoding="async" fetchpriority="high" srcset="https://www.dbrnd.com/wp-content/uploads/2017/05/DropTableDatabase.png 600w, https://www.dbrnd.com/wp-content/uploads/2017/05/DropTableDatabase-150x150.png 150w, https://www.dbrnd.com/wp-content/uploads/2017/05/DropTableDatabase-300x300.png 300w, https://www.dbrnd.com/wp-content/uploads/2017/05/DropTableDatabase-65x65.png 65w" sizes="(max-width: 600px) 100vw, 600px" /></div>In this post, I am sharing few steps to find out the transactions history for drop commands which executed in SQL Server. There are many features for auditing and check the logging in SQL Server, but you can also directly read the transaction log and can get the necessary details. Please check the below full [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="600" height="600" src="https://www.dbrnd.com/wp-content/uploads/2017/05/DropTableDatabase.png" class="attachment-post-image size-post-image wp-post-image" alt="DropTableDatabase" decoding="async" srcset="https://www.dbrnd.com/wp-content/uploads/2017/05/DropTableDatabase.png 600w, https://www.dbrnd.com/wp-content/uploads/2017/05/DropTableDatabase-150x150.png 150w, https://www.dbrnd.com/wp-content/uploads/2017/05/DropTableDatabase-300x300.png 300w, https://www.dbrnd.com/wp-content/uploads/2017/05/DropTableDatabase-65x65.png 65w" sizes="(max-width: 600px) 100vw, 600px" /></div><p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F05%2Fsql-server-who-dropped-a-table-find-out-from-transaction-log-fn_dblog%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20table%2C%20find%20out%20from%20Transaction%20Log" 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%2F2017%2F05%2Fsql-server-who-dropped-a-table-find-out-from-transaction-log-fn_dblog%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20table%2C%20find%20out%20from%20Transaction%20Log" 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%2F2017%2F05%2Fsql-server-who-dropped-a-table-find-out-from-transaction-log-fn_dblog%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20table%2C%20find%20out%20from%20Transaction%20Log" 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%2F2017%2F05%2Fsql-server-who-dropped-a-table-find-out-from-transaction-log-fn_dblog%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20table%2C%20find%20out%20from%20Transaction%20Log" 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%2F2017%2F05%2Fsql-server-who-dropped-a-table-find-out-from-transaction-log-fn_dblog%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20table%2C%20find%20out%20from%20Transaction%20Log" 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%2F2017%2F05%2Fsql-server-who-dropped-a-table-find-out-from-transaction-log-fn_dblog%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20table%2C%20find%20out%20from%20Transaction%20Log" 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%2F2017%2F05%2Fsql-server-who-dropped-a-table-find-out-from-transaction-log-fn_dblog%2F&#038;title=SQL%20Server%3A%20Who%20dropped%20a%20table%2C%20find%20out%20from%20Transaction%20Log" data-a2a-url="https://www.dbrnd.com/2017/05/sql-server-who-dropped-a-table-find-out-from-transaction-log-fn_dblog/" data-a2a-title="SQL Server: Who dropped a table, find out from Transaction Log"></a></p><p>In this post, I am sharing few steps to find out the transactions history for drop commands which executed in SQL Server.</p>
<p>There are many features for auditing and check the logging in SQL Server, but you can also directly read the transaction log and can get the necessary details.</p>
<p><strong>Please check the below full demonstration of this:</strong></p>
<p><strong>Create a sample database and use it:</strong><br />
<pre class="crayon-plain-tag">CREATE DATABASE Drop_Test
GO
USE Drop_Test
GO</pre>
<strong>Create a sample table:</strong><br />
<pre class="crayon-plain-tag">CREATE TABLE tbl_Test (ID INT)
GO</pre>
<strong>Check the object id of table and save it:</strong><br />
<pre class="crayon-plain-tag">SELECT OBJECT_ID ('tbl_Test')
GO

--tbl_Test object id: 581577110</pre>
<strong>Now, drop the table:</strong><br />
<pre class="crayon-plain-tag">DROP TABLE tbl_Test
GO</pre>
<strong>Check the transaction id and user of that drop action:</strong><br />
Using below query, you can find only transaction id and username who dropped the objects. Later, you can use a transaction to know which object has been dropped.<br />
<pre class="crayon-plain-tag">SELECT [Transaction Id], [Begin Time], SUSER_SNAME ([Transaction SID]) AS [User]
FROM fn_dblog (NULL, NULL)
WHERE [Transaction Name] = 'DROPOBJ'
GO

-- The Result:
/*
Transaction Id Begin Time User
-------------- ------------------------ ---------
0000:00000335 2017/04/25 17:53:41:187 Anvesh
*/</pre>
<strong>Find out which object has been dropped:</strong><br />
Use above transaction id and see the details of dropped object.<br />
<pre class="crayon-plain-tag">SELECT [Transaction Id], [Begin Time], SUSER_SNAME ([Transaction SID]) AS [User]
FROM fn_dblog (NULL, NULL)
WHERE [Transaction Name] = 'DROPOBJ'
GO

-- The Result:
/*
Transaction Id Begin Time User
-------------- ------------------------ ---------
0000:00000335 2017/04/25 17:53:41:187 Anvesh
*/</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server Interview: If Transaction Log Full, what are your steps to resolve it</title>
		<link>https://www.dbrnd.com/2017/03/sql-server-interview-if-transaction-log-full-what-are-your-steps-to-resolve-it-error-9002/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 06 Mar 2017 16:16:10 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[error 9002]]></category>
		<category><![CDATA[log file]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[transaction log]]></category>
		<category><![CDATA[Transaction log full]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4712</guid>

					<description><![CDATA[I am sharing one of the very common and important Interview Questions separately so that SQL Server DBAs can recognize very easily before going for SQL DBA Interview. The question itself is one kind of common problem which is facing by many of SQL DBAs. When SQL Server transaction log full, they are getting an [&#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%2F2017%2F03%2Fsql-server-interview-if-transaction-log-full-what-are-your-steps-to-resolve-it-error-9002%2F&amp;linkname=SQL%20Server%20Interview%3A%20If%20Transaction%20Log%20Full%2C%20what%20are%20your%20steps%20to%20resolve%20it" 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%2F2017%2F03%2Fsql-server-interview-if-transaction-log-full-what-are-your-steps-to-resolve-it-error-9002%2F&amp;linkname=SQL%20Server%20Interview%3A%20If%20Transaction%20Log%20Full%2C%20what%20are%20your%20steps%20to%20resolve%20it" 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%2F2017%2F03%2Fsql-server-interview-if-transaction-log-full-what-are-your-steps-to-resolve-it-error-9002%2F&amp;linkname=SQL%20Server%20Interview%3A%20If%20Transaction%20Log%20Full%2C%20what%20are%20your%20steps%20to%20resolve%20it" 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%2F2017%2F03%2Fsql-server-interview-if-transaction-log-full-what-are-your-steps-to-resolve-it-error-9002%2F&amp;linkname=SQL%20Server%20Interview%3A%20If%20Transaction%20Log%20Full%2C%20what%20are%20your%20steps%20to%20resolve%20it" 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%2F2017%2F03%2Fsql-server-interview-if-transaction-log-full-what-are-your-steps-to-resolve-it-error-9002%2F&amp;linkname=SQL%20Server%20Interview%3A%20If%20Transaction%20Log%20Full%2C%20what%20are%20your%20steps%20to%20resolve%20it" 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%2F2017%2F03%2Fsql-server-interview-if-transaction-log-full-what-are-your-steps-to-resolve-it-error-9002%2F&amp;linkname=SQL%20Server%20Interview%3A%20If%20Transaction%20Log%20Full%2C%20what%20are%20your%20steps%20to%20resolve%20it" 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%2F2017%2F03%2Fsql-server-interview-if-transaction-log-full-what-are-your-steps-to-resolve-it-error-9002%2F&#038;title=SQL%20Server%20Interview%3A%20If%20Transaction%20Log%20Full%2C%20what%20are%20your%20steps%20to%20resolve%20it" data-a2a-url="https://www.dbrnd.com/2017/03/sql-server-interview-if-transaction-log-full-what-are-your-steps-to-resolve-it-error-9002/" data-a2a-title="SQL Server Interview: If Transaction Log Full, what are your steps to resolve it"></a></p><p>I am sharing one of the very common and important Interview Questions separately so that SQL Server DBAs can recognize very easily before going for SQL DBA Interview.</p>
<blockquote><p>The question itself is one kind of common problem which is facing by many of SQL DBAs. When SQL Server transaction log full, they are getting an error like &#8220;SQL Server Error 9002 transaction log full&#8221;.</p></blockquote>
<p>When an interviewer asks this question to you, you should give a very clear answer with a just list of few options. If they ask more, only you should explain in details; otherwise, it is OK.</p>
<p>Your answer should be like this,<br />
<strong>If we got error 9002 transaction log full, we should take following points:</strong></p>
<ul>
<li>We should take backup the transaction log file and truncate the transaction log</li>
<li>We can move log file to another disk drive</li>
<li>We can increase the size of log file</li>
<li>We can also add a new transaction log file in separate disk</li>
</ul>
<p>I am not sharing more details on each point. If you want, you should prepare it for yourself, but I would suggest avoiding detail answer because you need to prepare different commands for all the options.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Who dropped a Table and Which Table has been dropped</title>
		<link>https://www.dbrnd.com/2016/12/sql-server-who-dropped-a-table-and-which-table-has-been-dropped/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 12 Dec 2016 20:14:17 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Audit]]></category>
		<category><![CDATA[CDC]]></category>
		<category><![CDATA[Change data capture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[DDL Trii]]></category>
		<category><![CDATA[drop]]></category>
		<category><![CDATA[drop table]]></category>
		<category><![CDATA[fn_dblog()]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[transaction log]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[user]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4063</guid>

					<description><![CDATA[SQL Server provides different types of database auditing option like: CDC, Database Audit. Recently, I have shared one article about, change your database DDL changes using Encrypted DDL triggers. SQL Server: Encrypted DDL Trigger to Track all Database Changes Database Administrators are responsible for database security and Periodically, They have to track all the database [&#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%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" 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%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" 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%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" 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%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" 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%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" 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%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" 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%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&#038;title=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" data-a2a-url="https://www.dbrnd.com/2016/12/sql-server-who-dropped-a-table-and-which-table-has-been-dropped/" data-a2a-title="SQL Server: Who dropped a Table and Which Table has been dropped"></a></p><p>SQL Server provides different types of database auditing option like: CDC, Database Audit.<br />
Recently, I have shared one article about, change your database DDL changes using Encrypted DDL triggers. </p>
<blockquote class="wp-embedded-content" data-secret="0nSvSWs9bx"><p><a href="https://www.dbrnd.com/2016/10/sql-server-encrypted-ddl-trigger-to-track-all-database-changes-to-ensure-database-object-security/">SQL Server: Encrypted DDL Trigger to Track all Database Changes</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/10/sql-server-encrypted-ddl-trigger-to-track-all-database-changes-to-ensure-database-object-security/embed/#?secret=0nSvSWs9bx" data-secret="0nSvSWs9bx" width="600" height="338" title="&#8220;SQL Server: Encrypted DDL Trigger to Track all Database Changes&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>Database Administrators are responsible for database security and Periodically, They have to track all the database related changes and make sure that everything is working fine. </p></blockquote>
<blockquote><p>But still sometimes, I used to track database changes from the SQL Server log files using fn_dblog().<br />
I am sharing one way to find a person who dropped a table and also can get the name of that dropped table without enabling any auditing option of SQL Server.</p></blockquote>
<p><strong>Script to find the log of dropped objects:</strong></p>
<blockquote><p>Using this script, you can find a list of dropped tables and login name information, but you cannot get table name directly.<br />
You can find the transaction id for each record and using this transaction ID, you can find the table name.</p></blockquote>
<pre class="crayon-plain-tag">SELECT 
	[Transaction Id]
	,[Begin Time]
	,SUSER_SNAME ([Transaction SID]) AS [LoginName] 
FROM fn_dblog (NULL, NULL)  
WHERE [Transaction Name] = N'DROPOBJ';</pre> </p>
<p><strong>Find Table name using TransactionID:</strong></p>
<pre class="crayon-plain-tag">SELECT TOP 1 
	[Lock Information] 
FROM fn_dblog (NULL, NULL)  
WHERE [Transaction Id] = '0000:0015d6b3'  
AND [Lock Information] LIKE '%SCH_M OBJECT%';</pre> </p>
<p><strong>The result:</strong><br />
To get the table name, you can copy the number and search into sys.objects table.</p>
<pre class="crayon-plain-tag">HoBt 0:ACQUIRE_LOCK_SCH_M OBJECT: 8:1015674666:0</pre> </p>
<p><strong>Find your dropped table:</strong><br />
Please do not start to search your dropped table in your current database because Table already dropped.<br />
You must restore the last backup of the database and you should search your dropped table in that database. </p>
<pre class="crayon-plain-tag">SELECT *FROM sys.objects 
WHERE Object_ID ='1015674666'</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL: Difference between pg_log, pg_clog and pg_xlog log directories</title>
		<link>https://www.dbrnd.com/2016/12/postgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log/</link>
					<comments>https://www.dbrnd.com/2016/12/postgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 04 Dec 2016 14:29:42 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[binary log]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[pg_clog]]></category>
		<category><![CDATA[pg_log]]></category>
		<category><![CDATA[pg_xlog]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Point in time recovery]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[Replication]]></category>
		<category><![CDATA[transaction log]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3979</guid>

					<description><![CDATA[In this post, I am sharing the basic purpose of pg_log, pg_clog and pg_xlog log directories in PostgreSQL. If you look into your PostgreSQL data directory, you can find a different type of log folders. pg_log: This is a default database logs like: error messages, executed query log, dead lock information, Postgers start/stop messages. First, [&#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%2F2016%2F12%2Fpostgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log%2F&amp;linkname=PostgreSQL%3A%20Difference%20between%20pg_log%2C%20pg_clog%20and%20pg_xlog%20log%20directories" 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%2F2016%2F12%2Fpostgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log%2F&amp;linkname=PostgreSQL%3A%20Difference%20between%20pg_log%2C%20pg_clog%20and%20pg_xlog%20log%20directories" 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%2F2016%2F12%2Fpostgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log%2F&amp;linkname=PostgreSQL%3A%20Difference%20between%20pg_log%2C%20pg_clog%20and%20pg_xlog%20log%20directories" 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%2F2016%2F12%2Fpostgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log%2F&amp;linkname=PostgreSQL%3A%20Difference%20between%20pg_log%2C%20pg_clog%20and%20pg_xlog%20log%20directories" 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%2F2016%2F12%2Fpostgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log%2F&amp;linkname=PostgreSQL%3A%20Difference%20between%20pg_log%2C%20pg_clog%20and%20pg_xlog%20log%20directories" 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%2F2016%2F12%2Fpostgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log%2F&amp;linkname=PostgreSQL%3A%20Difference%20between%20pg_log%2C%20pg_clog%20and%20pg_xlog%20log%20directories" 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%2F2016%2F12%2Fpostgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log%2F&#038;title=PostgreSQL%3A%20Difference%20between%20pg_log%2C%20pg_clog%20and%20pg_xlog%20log%20directories" data-a2a-url="https://www.dbrnd.com/2016/12/postgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log/" data-a2a-title="PostgreSQL: Difference between pg_log, pg_clog and pg_xlog log directories"></a></p><p>In this post, I am sharing the basic purpose of pg_log, pg_clog and pg_xlog log directories in PostgreSQL. </p>
<p>If you look into your PostgreSQL data directory, you can find a different type of log folders. </p>
<p><strong>pg_log:</strong> </p>
<blockquote><p>This is a default database logs like: error messages, executed query log, dead lock information, Postgers start/stop messages.</p></blockquote>
<blockquote><p>First, you should look into this folder for any investigation. Most of the time we are getting an error because of bad queries or wrong configuration so in these cases we can find the important log messages from this folder. </p></blockquote>
<blockquote><p>You can also delete unwanted or old log files because It stores only database action related messages which are not critical for PostgreSQL Server.<br />
There are a few parameters in Postgres.conf file related to pg_log folder, you access below article for this. </p></blockquote>
<blockquote data-secret="nhEUfNZ4Cg" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2015/11/postgresql-important-parameters-to-enable-log-for-all-queries/">PostgreSQL: Important Parameters to enable Log for all Queries</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/11/postgresql-important-parameters-to-enable-log-for-all-queries/embed/#?secret=nhEUfNZ4Cg" data-secret="nhEUfNZ4Cg" width="600" height="338" title="&#8220;PostgreSQL: Important Parameters to enable Log for all Queries&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>pg_clog:</strong> </p>
<blockquote><p>We cannot read log files of this folder because it is for PostgreSQL internals. It contains logs for transaction metadata. PostgreSQL server access this folder to take the decision like which transaction completed or which did not. </p></blockquote>
<blockquote><p>This is critical log folder, you should never forget this folder during your pg_data directory backup. </p></blockquote>
<p><strong>pg_xlog:</strong> </p>
<blockquote><p>At all the times, PostgreSQL maintains a write-ahead log (WAL) in the pg_xlog/ subdirectory of the cluster&#8217;s data directory. The log records for every change made to the database&#8217;s data files. These log messages exists primarily for crash-safety purposes.</p></blockquote>
<blockquote><p>It contains the main binary transaction log data or binary log files. If you are planning for replication or Point in time Recovery, we can use this transaction log files. </p></blockquote>
<blockquote><p>We cannot delete this file. Otherwise, it causes a database corruption. The size of this folder would be greater than actual data so If you are dealing with massive database, 99% chance to face disk space related issues especially for the pg_xlog folder. </p></blockquote>
<blockquote><p>But don&#8217;t worry, There are multiple ways to optimize pg_xlog folder by removing old WAL files.</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/12/postgresql-difference-between-pg_log-pg_clog-and-pg_xlog-log-directories-transaction-log-binary-log/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
