<?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>interview &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/interview/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>Mon, 09 Jan 2017 18:46:37 +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 Interview: What is the logical order of SQL Query (SELECT Statement)</title>
		<link>https://www.dbrnd.com/2017/01/sql-server-interview-what-is-the-logical-order-of-sql-query-select-statement/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 09 Jan 2017 18:46:37 +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 developer interview]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[logical order]]></category>
		<category><![CDATA[select statement]]></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[t-sql interview]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4112</guid>

					<description><![CDATA[I have already shared hundreds of SQL Server Interview Questions. Here, I would like to share one more common and important SQL Interview question for SQL Beginner. Whenever I am taking the SQL Beginner&#8217;s Interview, I always ask one question &#8220;What is the logical order of SQL Query or SELECT Statement&#8221;. It looks like a [&#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%2F01%2Fsql-server-interview-what-is-the-logical-order-of-sql-query-select-statement%2F&amp;linkname=SQL%20Server%20Interview%3A%20What%20is%20the%20logical%20order%20of%20SQL%20Query%20%28SELECT%20Statement%29" 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%2F01%2Fsql-server-interview-what-is-the-logical-order-of-sql-query-select-statement%2F&amp;linkname=SQL%20Server%20Interview%3A%20What%20is%20the%20logical%20order%20of%20SQL%20Query%20%28SELECT%20Statement%29" 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%2F01%2Fsql-server-interview-what-is-the-logical-order-of-sql-query-select-statement%2F&amp;linkname=SQL%20Server%20Interview%3A%20What%20is%20the%20logical%20order%20of%20SQL%20Query%20%28SELECT%20Statement%29" 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%2F01%2Fsql-server-interview-what-is-the-logical-order-of-sql-query-select-statement%2F&amp;linkname=SQL%20Server%20Interview%3A%20What%20is%20the%20logical%20order%20of%20SQL%20Query%20%28SELECT%20Statement%29" 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%2F01%2Fsql-server-interview-what-is-the-logical-order-of-sql-query-select-statement%2F&amp;linkname=SQL%20Server%20Interview%3A%20What%20is%20the%20logical%20order%20of%20SQL%20Query%20%28SELECT%20Statement%29" 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%2F01%2Fsql-server-interview-what-is-the-logical-order-of-sql-query-select-statement%2F&amp;linkname=SQL%20Server%20Interview%3A%20What%20is%20the%20logical%20order%20of%20SQL%20Query%20%28SELECT%20Statement%29" 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%2F01%2Fsql-server-interview-what-is-the-logical-order-of-sql-query-select-statement%2F&#038;title=SQL%20Server%20Interview%3A%20What%20is%20the%20logical%20order%20of%20SQL%20Query%20%28SELECT%20Statement%29" data-a2a-url="https://www.dbrnd.com/2017/01/sql-server-interview-what-is-the-logical-order-of-sql-query-select-statement/" data-a2a-title="SQL Server Interview: What is the logical order of SQL Query (SELECT Statement)"></a></p><p>I have already shared hundreds of SQL Server Interview Questions.<br />
Here, I would like to share one more common and important SQL Interview question for SQL Beginner.</p>
<blockquote><p>Whenever I am taking the SQL Beginner&#8217;s Interview, I always ask one question &#8220;What is the logical order of SQL Query or SELECT Statement&#8221;.</p></blockquote>
<blockquote><p>It looks like a very basic question, but It is very important to know about the sequence of query execution because It plays main role in query optimization.</p></blockquote>
<blockquote><p>You should know that JOINS are executing the first or WHERE clause is executing the first. Both are filtering the data, but most of the time I have found a wrong answer.</p></blockquote>
<p><strong>Below is a correct logical order of SQL Query or SELECT Statement:</strong></p>
<ul>
<li>FROM</li>
<li>ON</li>
<li>JOIN</li>
<li>WHERE</li>
<li>GROUP BY</li>
<li>WITH CUBE or WITH ROLLUP</li>
<li>HAVING</li>
<li>SELECT</li>
<li>DISTINCT</li>
<li>ORDER BY</li>
<li>TOP</li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Security Interview Questions and Answers  (Day-6)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 23 Jul 2016 14:09:23 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[database security]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[dynamic data masking]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[row level security]]></category>
		<category><![CDATA[secure view column]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2016]]></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[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3397</guid>

					<description><![CDATA[How do you grant a SQL Server developer truncate table permission without giving them the ability to alter the table? This is accomplished by a DBA creating a stored procedure with the TRUNCATE TABLE statements and then granting execute permission on the stored procedure to those who need it. I have a table where some [&#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%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&#038;title=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6/" data-a2a-title="SQL Server: Database Security Interview Questions and Answers  (Day-6)"></a></p><p><strong>How do you grant a SQL Server developer truncate table permission without giving them the ability to alter the table?</strong></p>
<blockquote><p>This is accomplished by a DBA creating a stored procedure with the TRUNCATE TABLE statements and then granting execute permission on the stored procedure to those who need it.</p></blockquote>
<p><strong>I have a table where some of the columns should not be queryable by all users. How can I filter the data appropriately, so that not everyone can select the data?</strong></p>
<blockquote><p>One of the easiest ways to do this is through the use of views.</p>
<p>If we can use a view, we can successfully filter the data and grant the users access to the view, we can present just the data we want the users to have access to.</p>
<p>however, there are two requirements for this:</p>
<ul>
<li>The users do not already have the ability to select data from the table.</li>
<li>A view can be created where an ownership chain can be established with the table.</li>
</ul>
</blockquote>
<p><strong>How to grant only few columns without creating views?</strong></p>
<p>We can assign column list to table.</p><pre class="crayon-plain-tag">GRANT SELECT ON dbo.Employee (EmployeeID, FirstName, MiddleName, SurName) TO HR_Intern;</pre><p>
<strong>I can create Stored Procedure, but However, when I went to execute the stored procedure, SQL Server told me I didn&#8217;t have permission to do so. Is this a bug or did I do something wrong?</strong></p>
<blockquote><p>This is entirely possible if you have the ability to create a stored procedure in a schema you don&#8217;t own.</p>
<p>In this particular case we&#8217;ve created a role that has the ability to create stored procedures in the database and the ability to alter the dbo schema. By default, the dbo schema is owned by the database owner.</p></blockquote>
<p><strong>What do you know about the SQL Server 2016 Row Level Security?</strong></p>
<blockquote><p>SQL Server 2016 has introduced Row Level Security (RLS) which is a feature that enables fine grained control over access to rows in a table. RLS allows you to easily control which users can access which data with complete transparency to the application.This enables us to easily restrict the data based on the user identity or security context.</p>
<p>Row-Level Security enables customers to control access to rows in a database table based on the characteristics of the user executing a query.</p></blockquote>
<p><strong>Which are the different predicates support by Row Level Security?</strong></p>
<blockquote><p>RLS supports two types of security predicates.</p>
<p>Filter predicates silently filter the rows available to read operations (SELECT, UPDATE, and DELETE).</p>
<p>Block predicates explicitly block write operations (AFTER INSERT, AFTER UPDATE, BEFORE UPDATE, BEFORE DELETE) that violate the predicate.</p></blockquote>
<p><strong>What do you know about the Dynamic Data Masking?</strong></p>
<blockquote><p>Dynamic data masking limits sensitive data exposure by masking it to non-privileged users. Dynamic data masking helps prevent unauthorized access to sensitive data by enabling customers to designate how much of the sensitive data to reveal with minimal impact on the application layer. It’s a data protection feature that hides the sensitive data in the result set of a query over designated database fields, while the data in the database is not changed.</p>
<p>For example, a call center support person may identify callers by several digits of their social security number or credit card number, but those data items should not be fully exposed to the support person. A masking rule can be defined that masks all but the last four digits of any social security number or credit card number in the result set of any query.</p></blockquote>
<p>What should be the characteristics for strong password?</p>
<ul>
<li>Is at least 8 characters long.</li>
<li>Combines letters, numbers, and symbol characters within the password.</li>
<li>Is not found in a dictionary.</li>
<li>Is not the name of a command.</li>
<li>Is not the name of a person.</li>
<li>Is not the name of a user.</li>
<li>Is not the name of a computer.</li>
<li>Is changed regularly.</li>
<li>Is significantly different from previous passwords.</li>
</ul>
<p><strong>How SQL Injection Works?</strong></p>
<blockquote><p>The primary form of SQL injection consists of direct insertion of code into user-input variables that are concatenated with SQL commands and executed. A less direct attack injects malicious code into strings that are destined for storage in a table or as metadata. When the stored strings are subsequently concatenated into a dynamic SQL command, the malicious code is executed.</p>
<p>The injection process works by prematurely terminating a text string and appending a new command. Because the inserted command may have additional strings appended to it before it is executed, the malefactor terminates the injected string with a comment mark &#8220;&#8211;&#8220;. Subsequent text is ignored at execution time.</p></blockquote>
<p><strong>What are your best practices to avoid SQL Injection?</strong></p>
<ul>
<li>Validate all input.</li>
<li>Use Type-Safe SQL Parameters.</li>
<li>Use Parameterized Input with Stored Procedures.</li>
<li>Wrapping Parameters with QUOTENAME() and REPLACE().</li>
<li>Use the Parameters Collection with Dynamic SQL.</li>
</ul>
<p><strong>How Do You Determine What Data Are Confidential?</strong></p>
<ul>
<li>We should to contact our legal department (if there is one), an attorney, or law professor, if in doubt about data.</li>
<li>Ask about, What type of data should we be extra cautious about?</li>
<li>Ask government officials or look at government websites on the industry we are in.</li>
<li>We should think like a hacker.</li>
</ul>
<p><strong>Have you seen any performance hit using SQL Server Transparent Data Encryption (TDE)?</strong></p>
<blockquote><p>Given that you are performing more operations, there is some. One advantage to TDE is that the data is only encrypted in disk. So if it&#8217;s in SQL Server&#8217;s memory buffers, there&#8217;s no repeated decryption going on.</p></blockquote>
<p><strong>Any concerns about the SQL Server public database role?</strong></p>
<blockquote><p>Yes, the general recommendation is to avoid using the public role. Every database user is a member of public. As a result, any permissions assigned to it are also assigned to every database user.</p></blockquote>
<p><strong>What do you use to avoid the SQL Server fixed server roles?</strong></p>
<blockquote><p>The recommended practice is to create a role and assign explicit permissions.</p>
<p>A developer wants to execute a SQL Server stored procedure in debug mode. I believe SQL Server sysadmin level access required to use debug mode. I don&#8217;t want to give sysadmin access to the developer. Is there any I can handle this without giving sysadmin access?</p>
<p>Unfortunately, there is not. Debugging requires sysadmin role membership.</p></blockquote>
<p><strong>Is it possible to grant linked server permissions to Windows user group?</strong></p>
<blockquote><p>Yes: A Windows group is no different from any other login.</p></blockquote>
<p><strong>T-SQL Script to find mismatched between Database Login and Server Login.</strong></p><pre class="crayon-plain-tag">SELECT d.[name] AS 'DB User', s.[name] AS 'Login', s.sid AS 'SID'
FROM sys.database_principals d
 JOIN sys.server_principals s
 ON d.sid = s.sid
WHERE d.[name] &lt;&gt; s.[name];</pre><p>
<strong><br />
What is the main hierarchy of Permissions?</strong><br />
<a href="https://msdn.microsoft.com/en-us/library/ms191465.aspx" target="_blank">Please visit this Microsoft official documents:</a></p>
<p><strong>What should be your common practice for SQL Server Security?</strong></p>
<ul>
<li>SQL Server should be hardened after the installation.</li>
<li>After the installation, use the SQL Server Configuration Manager tool in order to disable unnecessary features and services.</li>
<li>Install only required components.</li>
<li>Recent service packs and critical fixes should be installed for SQL Server and Windows.</li>
<li>Windows Authentication mode is more secure than SQL Authentication.</li>
<li>If there is still a need to use SQL Authentication – enforce strong password policy.</li>
<li>Disable the SA account and rename it. Do not use this account for SQL server management.</li>
<li>Change default SQL Server ports associated with the SQL Server installation to keep hackers from port scanning the server.</li>
<li>Hide SQL Server instances or disable the SQL Server Browser service.</li>
<li>Remove BUILDIN\Administrators group from the SQL Server Logins.</li>
<li>Enable logging SQL Server login attempts (failed &amp; successful).</li>
<li>Defining Database Ownership to Increase Security.</li>
<li>Disabling certain system stored procedures.</li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Security Interview Questions and Answers  (Day-5)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5/</link>
					<comments>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 22 Jul 2016 14:06:57 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[database security]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[deny]]></category>
		<category><![CDATA[GRANT]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[REVOKE]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[sql server audit]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[XP_CMDSHELL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3378</guid>

					<description><![CDATA[What do you know about the SQL Server Audit? SQL Server Audit is used to track and log events (not data change) occurring on the SQL Server. SQL Server uses extended events to help create an audit. The audit can be server level or database level. If you create an audit on a database table, [&#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%2F07%2Fsql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-5%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-5%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-5%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-5%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-5%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-5%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5%2F&#038;title=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-5%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5/" data-a2a-title="SQL Server: Database Security Interview Questions and Answers  (Day-5)"></a></p><p><strong>What do you know about the SQL Server Audit?</strong></p>
<blockquote><p>SQL Server Audit is used to track and log events (not data change) occurring on the SQL Server. SQL Server uses extended events to help create an audit. The audit can be server level or database level.</p>
<p>If you create an audit on a database table, SQL Server will only track the events that trigger the certain operations (SELECT/INSERT/UPDATE/DELETE) defined in the database audit specification.</p></blockquote>
<p><strong>What options are available to audit login activity?</strong></p>
<ul>
<li>Custom solution with your application to log all logins into a centralized table</li>
<li>Enable login auditing at the instance level in Management Studio</li>
<li>Execute Profiler to capture logins into the instance</li>
<li>Leverage a third party product</li>
</ul>
<p><strong>What is Audit in SQL Server?</strong></p>
<blockquote><p>Auditing an instance of the SQL Server Database Engine or an individual database involves tracking and logging events that occur on the Database Engine.</p></blockquote>
<p><strong>What is Server level Audit specification?</strong></p>
<blockquote><p>You can create one server audit specification per audit.</p>
<p>The server audit specification collects many server-level action groups raised by the Extended Events feature. You can include audit action groups in a server audit specification. Audit action groups are predefined groups of actions, which are atomic events occurring in the Database Engine.</p></blockquote>
<p><strong>What is Database level Audit specification?</strong></p>
<blockquote><p>You can create one database audit specification per SQL Server database per audit.</p>
<p>The database audit specification collects database-level audit actions raised by the Extended Events feature. You can add either audit action groups or audit events to a database audit specification.</p></blockquote>
<p><strong>Is it good to enable Audit only for SQL Server Login fails?</strong></p>
<blockquote><p>Yes:</p>
<p>Database administrators should enable login auditing feature of SQL Server on all instances which they manage. Once this feature is enabled SQL Server will write all the failed and successful login information in SQL Server Error Logs. It is always a best practice to auditing failed SQL Server logins.</p></blockquote>
<p><strong>Does SQL Server Audit require any additional permission?</strong></p>
<blockquote><p>Yes:</p>
<p>Each feature and command for SQL Server Audit has individual permission requirements.</p></blockquote>
<p><strong>Should we encrypt the SQL Server datatabase backups?</strong></p>
<blockquote><p>Yes:</p>
<p>We need to make sure the database backups are encrypted to avoid the misuse.</p></blockquote>
<p><strong>Why we should not use tha SA login for all the different SQL Server access?</strong></p>
<blockquote><p>Because, the sa login and password to all of your SQL Servers because auditing the sa login with a shared password is difficult without capturing the host name or some other personally identifiable data. We should migrate all SQL Server authentication to Windows based authentication.</p></blockquote>
<p><strong>Can I stop a System Admin from enabling SQL Server xp_cmdshell?</strong></p>
<blockquote><p>No:</p></blockquote>
<p><strong>T-SQL script to disable the SA login</strong></p><pre class="crayon-plain-tag">ALTER LOGIN sa DISABLE;</pre><p>
<strong>T-SQL script to rename the SQ login.</strong></p><pre class="crayon-plain-tag">ALTER LOGIN sa WITH NAME = [dbrnd_user];</pre><p>
<strong>Please do auto reset the SA password and disable it.</strong></p>
<blockquote><p>SQL Server has an undocumented system stored procedure named sp_SetAutoSAPasswordAndDisable. This procedure will do exactly as the name suggests: it will reset the password and then disable the &#8216;sa&#8217; login.</p></blockquote>
<pre class="crayon-plain-tag">EXEC sp_SetAutoSAPasswordAndDisable
GO</pre>
<strong>T-SQL script to find common passwords.</strong><br />
<pre class="crayon-plain-tag">SELECT name,type_desc,create_date,modify_date,password_hash 
FROM sys.sql_logins 
WHERE PWDCOMPARE('mssqltips',password_hash)=1;</pre>
<strong>T-SQL script to find blank passwords.</strong><br />
<pre class="crayon-plain-tag">SELECT name,type_desc,create_date,modify_date,password_hash 
FROM sys.sql_logins 
WHERE PWDCOMPARE('',password_hash)=1;</pre>
<strong>T-SQL script to find Passwords that are the same as the Login name.</strong><br />
<pre class="crayon-plain-tag">SELECT name,type_desc,create_date,modify_date,password_hash 
FROM sys.sql_logins 
WHERE PWDCOMPARE(name,password_hash)=1;</pre>
<strong>What is GRANT, DENY and REVOKE?</strong></p>
<blockquote><p>GRANT:gives a user permission to perform certain tasks on database objects.<br />
DENY:denies any access to a user to perform certain tasks on database objects.<br />
REVOKE:removes a grant or deny permission from a user on certain database objects.</p></blockquote>
<p><strong>Sample T-SQL scripts for GRANT, DENY and REVOKE.</strong><br />
<pre class="crayon-plain-tag">GRANT INSERT, UPDATE, SELECT ON Customers TO Joe, Mary;
DENY DELETE ON Customers to Joe, Mary;
REVOKE UPDATE ON Customers to Joe;</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-sql-audit-xp_cmdshell-sa-login-grant-deny-revoke-day-5/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: Database Security Interview Questions and Answers  (Day-4)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-hash-function-encrypted-password-symmetric-encryption-with-encryption-option-day-4/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 21 Jul 2016 21:00:34 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[database security]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Hashing function]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></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[Symmetric encryption]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[WITH ENCRYPTION OPTION]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3375</guid>

					<description><![CDATA[In our organization we have two teams that stored encrypted data in Microsoft SQL Server. The data is encrypted using symmetric keys and those keys are encrypted with passwords. However, we have a director who needs to be able to see the data for both teams, but we&#8217;d like it so that he only has [&#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%2F07%2Fsql-server-database-security-interview-questions-and-answers-hash-function-encrypted-password-symmetric-encryption-with-encryption-option-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-4%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-hash-function-encrypted-password-symmetric-encryption-with-encryption-option-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-4%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-hash-function-encrypted-password-symmetric-encryption-with-encryption-option-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-4%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-hash-function-encrypted-password-symmetric-encryption-with-encryption-option-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-4%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-hash-function-encrypted-password-symmetric-encryption-with-encryption-option-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-4%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-hash-function-encrypted-password-symmetric-encryption-with-encryption-option-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-4%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-hash-function-encrypted-password-symmetric-encryption-with-encryption-option-day-4%2F&#038;title=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-4%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-hash-function-encrypted-password-symmetric-encryption-with-encryption-option-day-4/" data-a2a-title="SQL Server: Database Security Interview Questions and Answers  (Day-4)"></a></p><p><strong>In our organization we have two teams that stored encrypted data in Microsoft SQL Server. The data is encrypted using symmetric keys and those keys are encrypted with passwords. However, we have a director who needs to be able to see the data for both teams, but we&#8217;d like it so that he only has to remember one password, preferably separate from the passwords used by the two teams. Is that possible?</strong></p>
<blockquote><p>Yes, it is. Microsoft SQL Server supports the ability for encryption keys to be encrypted via multiple mechanisms. For instance, a symmetric key can be encrypted with a password and an asymmetric key. If you have access to the symmetric key and at least one of those mechanisms, you can open the key.</p></blockquote>
<p><strong>What is hash function?</strong></p>
<blockquote><p>A hash function takes in data and returns back a fixed length block of bits such that any change to the data should result in a different block.</p></blockquote>
<p><strong>What do you know about the HASHBYTES()?</strong></p>
<blockquote><p>HASHBYTES(), as the name implies, is a function or algorithm that generates a hash from some input.</p></blockquote>
<p><strong>Which are the different hashing algorithms?</strong></p>
<blockquote><p>MD2, MD4, MD5, SHA-0, SHA-1, SHA-2</p></blockquote>
<p><strong>What is the main limitation of hasing function?</strong></p>
<blockquote><p>Since a hash function will return a fixed length block, obviously, there are a finite set of possibilities for the output. Therefore, there&#8217;s bound to be different inputs that will result in the same output. We call these situations collisions. What is of concern is if a collision can be engineered fairly quickly/cheaply. This is referred to as a collision attack.</p></blockquote>
<p><strong>What do you know about the Symmetric Encryption Algorithm?</strong></p>
<blockquote><p>This algorithm either take unencrypted data and return encrypted data, or they take encrypted data and return unencrypted data. In order to do so, they use a key, and the key is the same regardless of which direction you go. When it comes to encryption algorithms, symmetric encryption algorithms are substantially faster than asymmetric algorithms.</p></blockquote>
<p><strong>What are the different type of Symmetric Encryption Algorithms?</strong></p>
<ul>
<li>DES (DES)</li>
<li>Triple DES with 128 bit key (TRIPLE_DES)</li>
<li>Triple DES with 192 bit key (DESX)</li>
<li>RC2 (RC2)</li>
<li>RC4 (RC4)</li>
<li>RC4 with 128 bit key (RC4_128)</li>
<li>AES with 128 bit key (AES_128)</li>
<li>AES with 192 bit key (AES_192)</li>
<li>AES with 256 bit key (AES_256)</li>
</ul>
<p><strong>What is your common practice with account SA?</strong></p>
<ul>
<li>Set a hard to guess password.</li>
<li>Rename sa.</li>
<li>Disable sa.</li>
<li>Ensure that no other accounts exist named sa.</li>
</ul>
<p><strong>A user asked how they could get an alert whenever a login failed due to the account being locked out?</strong></p>
<ul>
<li>A SQL Server Agent alert, using the WMI event AUDIT_LOGIN_FAILED</li>
<li>Event Notifications, also using AUDIT_LOGIN_FAILED</li>
<li>Manually consuming the error log</li>
</ul>
<p><strong>How to hide your SQL Server code?</strong></p>
<blockquote><p>The WITH ENCRYPTION clause is used to encrypt the definition of SQL Server objects (views, stored procedures, functions ), so that no one may be able to view the definition/code of that specific object. Using the clause while creating an object is fairly easy.</p></blockquote>
<p><strong>What is the main disadvantage of WITH ENCRYPTION option to hide the SQL Server code?</strong></p>
<blockquote><p>The definition/code of object will not be available to anyone regardless of their permissions or access level. You can not customize the permissions for code/definition visibility.</p>
<p>Once an object has been created on the server using the WITH ENCRYPTION option, there is no standard method provided to get the definition/code back out of the encrypted object. You will need to keep a copy of the code outside of SQL Server.</p></blockquote>
<p><strong>What is the alternative of WITH ENCRYPTION oprtion to secure the SQL Server code?</strong></p>
<blockquote><p>The simple alternative is to granting or revoking View Definition rights.</p>
<p>If permission View Definition is denied for an object to any user then the user would not be able to view the object in SSMS or view.</p></blockquote>
<p><strong>What is a Salt?</strong></p>
<blockquote><p>It is basically something added to whatever we&#8217;re trying to encrypt to make it harder to decrypt the data (two way functions, like symmetric and asymmetric key functions) or find a collision (one way functions, AKA hash functions). The salt should be potentially different for every single piece of encrypted data. The salt should be randomly generated.</p></blockquote>
<p><strong>What will you do if you lost rights of your SQL Server instance?</strong></p>
<ul>
<li>Dedicated Administrator Connection</li>
<li>BUILIN\Administrator Group (Incase its rights are not revoked)</li>
<li>Final Option is to change the registry value</li>
<li>You can change authentication mode via registry</li>
</ul>
<p><strong>What is the difference between sysadmin and serveradmin server role?</strong></p>
<blockquote><p><strong>sysadmin:</strong> Members of the sysadmin fixed server role can perform any activity in the server.</p>
<p><strong>serveradmin:</strong> Members of the serveradmin fixed server role can change server-wide configuration options and shut down the server.</p></blockquote>
<p><strong>How to check SA login related information?</strong><br />
<pre class="crayon-plain-tag">USE Master
GO
SELECT sid, [name], createdate, updatedate
FROM master.dbo.syslogins
WHERE [name] = 'sa'
GO</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Security Interview Questions and Answers  (Day-3)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-change-data-capture-cdc-guest-user-sa-password-trustworthy-day-3/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 20 Jul 2016 04:24:20 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[authentication mode]]></category>
		<category><![CDATA[Change Data Capture CDC]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[database security]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[password policy]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[SA Account]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></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[trustworthy]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3372</guid>

					<description><![CDATA[What do you know about the Change Data Capture (CDC)? Change Data Capture (CDC) is used to track the changed data caused by common DML operations (INSERT/UPDATE/DEKLETE). The capture process reads the transaction log to pull out the data change information and then load the information into the associated change table. How to disable change [&#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%2F07%2Fsql-server-database-security-interview-questions-and-answers-change-data-capture-cdc-guest-user-sa-password-trustworthy-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-3%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-change-data-capture-cdc-guest-user-sa-password-trustworthy-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-3%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-change-data-capture-cdc-guest-user-sa-password-trustworthy-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-3%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-change-data-capture-cdc-guest-user-sa-password-trustworthy-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-3%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-change-data-capture-cdc-guest-user-sa-password-trustworthy-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-3%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-change-data-capture-cdc-guest-user-sa-password-trustworthy-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-3%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-change-data-capture-cdc-guest-user-sa-password-trustworthy-day-3%2F&#038;title=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-3%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-change-data-capture-cdc-guest-user-sa-password-trustworthy-day-3/" data-a2a-title="SQL Server: Database Security Interview Questions and Answers  (Day-3)"></a></p><p><strong>What do you know about the Change Data Capture (CDC)?</strong></p>
<blockquote><p>Change Data Capture (CDC) is used to track the changed data caused by common DML operations (INSERT/UPDATE/DEKLETE). The capture process reads the transaction log to pull out the data change information and then load the information into the associated change table.</p></blockquote>
<p><strong>How to disable change data capture (CDC) on a table?</strong></p><pre class="crayon-plain-tag">USE Your_Database_Name
GO
EXEC sys.sp_cdc_disable_table
@source_schema = N'dbo',
@source_name = N'YourTableName',
@capture_instance = N'dbo_YourTableName'
GO</pre><p>
<strong>How to check if Change Data Capture is enabled or disabled on a SQL Server Database?</strong></p><pre class="crayon-plain-tag">SELECT [name], is_cdc_enabled
FROM sys.databases where name = 'Database_Name'
/*
is_cdc_enabled = 0 -- CDC is disabled
is_cdc_enabled = 1 -- CDC is enabled
*/</pre><p>
<strong>How to Restore Database On Which Change Data Capture (CDC) Is Enabled?</strong></p>
<blockquote><p>When we restore a database from a CDC enabled database backup, it does not restore the CDC object automatically. Also if you try to look for some options for Restore with CDC object etc. in Database Restore Wizard, you would not find anything.</p>
<p>If we restore the database on the same SQL Server instance with same name, CDC objects will be restored and it will start working fine as CDC jobs are available on the server already.</p>
<p>If you try to restore with a different name or restore to different SQL Server instance, It will not restore CDC objects by default. In Restore Database statement, we have to include Keep_CDC.</p></blockquote>
<p><strong>What is the Guest user account in SQL Server?  What login is it mapped to it?</strong></p>
<blockquote><p>The Guest user account is created by default in all databases and is used when explicit permissions are not granted to access an object.  It is not mapped directly to any login, but can be used by any login.</p></blockquote>
<p><strong>How can SQL Server instances be hidden?</strong></p>
<blockquote><p>To hide a SQL Server instance, we need to make a change in SQL Server Configuration Manager. To do this launch SQL Server Configuration Manager and do the following: select the instance of SQL Server, right click and select Properties.</p>
<p>After selecting properties you will just set Hide Instance to &#8220;Yes&#8221; and click OK or Apply. After the change is made, you need to restart the instance of SQL Server to not expose the name of the instance.</p></blockquote>
<p><strong>Is it possible to disable SA, how?</strong></p>
<blockquote><p>Disable the SA Login</p>
<p>Disabling the SA account is a good option to prevent its use. When it is disabled no one can use it in any circumstance until it is enabled.</p></blockquote>
<p><strong>What is the difference between Authenticate and Authorization?</strong></p>
<blockquote><p>When you log on to a PC with a user name and password you are authenticating. Authorization is the process of verifying that you have access to something. Gaining access to a resource (e.g. directory on a hard disk) because the permissions configured on it allow you access is authorization.</p></blockquote>
<p><strong>Which one is highest privileged role out of SQLAgentUserRole, SQLAgentReaderRole, SQLAgentOperatorRole?</strong></p>
<blockquote><p>SQLAgentOperatorRole is the most privileged of the SQL Server Agent fixed database roles. It includes all the permissions of SQLAgentUserRole andSQLAgentReaderRole. Members of this role can also view properties for operators and proxies, and enumerate available proxies and alerts on the server.</p></blockquote>
<p><strong>What is the password policy for SQL Server Accounts?</strong></p>
<ul>
<li>The password must contain uppercase &amp; lowercase letters.</li>
<li>The password must contain numbers &amp; alphanumeric characters.</li>
<li>The password must contain non-alphanumeric characters such as &amp;, ^,%,*,$ etc.</li>
<li>Do not use common known passwords that are easy to guess such as: admin, password, sa, administrator, sysadmin etc.</li>
<li>Passwords should be long enough (at least 8 characters long).</li>
<li>It does not allows blank password for the SA account.</li>
</ul>
<p><strong>What are the disadvantages of SQL Server Authentication Mode?</strong></p>
<blockquote><p>If a user is a Windows domain user who has a login and password for Windows, he must still provide another (SQL Server) login and password to connect. Keeping track of multiple names and passwords is difficult for many users. Having to provide SQL Server credentials every time that one connects to the database can be annoying.</p>
<p>SQL Server Authentication cannot use Kerberos security protocol.</p>
<p>Windows offers additional password policies that are not available for SQL Server logins.</p>
<p>The encrypted SQL Server Authentication login password, must be passed over the network at the time of the connection. Some applications that connect automatically will store the password at the client. These are additional attack points.</p></blockquote>
<p><strong>When CHECK_POLICY is ON, what kind of behavior occur?</strong></p>
<blockquote><p>CHECK_EXPIRATION is also set to ON unless it is explicitly set to OFF.</p>
<p>The password history is initialized with the value of the current password hash.</p>
<p>Account lockout duration, account lockout threshold, and reset account lockout counter after are also enabled.</p></blockquote>
<p><strong>What is What is TRUSTWORTHY database?</strong></p>
<blockquote><p>Applies To: SQL Server 2016.</p>
<p>The TRUSTWORTHY database property is used to indicate whether the instance of SQL Server trusts the database and the contents within it. By default, this setting is OFF, but can be set to ON by using the ALTER DATABASE statement.</p>
<p>This property can be used to reduce certain threats that can exist as a result of attaching a database.</p></blockquote>
<p><strong>Where are the places that I should not use the sa login?</strong></p>
<ul>
<li>Embedded in management tools or application development tools</li>
<li>Hard coded in application connection strings</li>
<li>DTS or SSIS connection objects</li>
<li>UDL files</li>
<li>Batch files</li>
<li>SQLCMD, OSQL or ISQL T-SQL scripts</li>
<li>In casual conversation</li>
<li>On sticky notes on your desk or monitor</li>
</ul>
<p><strong>What is the use of BUILTIN\Administrators Group in SQL Server?</strong></p>
<blockquote><p>Any Windows login in BUILTIN\Administrators group is by default a SQL Server system administrator. This single group can be used to manage administrators from a Windows and SQL Server perspective.</p></blockquote>
<p><strong>How to detect Orphaned Users in SQL Server?</strong><br />
<pre class="crayon-plain-tag">SELECT dp.type_desc, dp.SID, dp.name AS user_name
FROM sys.database_principals AS dp
LEFT JOIN sys.server_principals AS sp
ON dp.SID = sp.SID
WHERE sp.SID IS NULL
AND authentication_type_desc = 'INSTANCE';</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Security Interview Questions and Answers  (Day-1)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1/</link>
					<comments>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 18 Jul 2016 19:28:52 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Data Masking]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Decryption]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[orphaned user]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[secure socket layer]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></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[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3364</guid>

					<description><![CDATA[What do you mean by Database Security? Database security refers to the collective measures used to protect and secure a database or database management software from illegitimate use and malicious threats and attacks. It is a broad term that includes a multitude of processes, tools and methodologies that ensure security within a database environment. What [&#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%2F07%2Fsql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-1%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-1%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-1%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-1%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-1%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-1%29" 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%2F07%2Fsql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1%2F&#038;title=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-1%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1/" data-a2a-title="SQL Server: Database Security Interview Questions and Answers  (Day-1)"></a></p><p><strong>What do you mean by Database Security?</strong></p>
<blockquote><p>Database security refers to the collective measures used to protect and secure a database or database management software from illegitimate use and malicious threats and attacks. It is a broad term that includes a multitude of processes, tools and methodologies that ensure security within a database environment.</p></blockquote>
<p><strong>What is Data Masking?</strong></p>
<blockquote class="wp-embedded-content" data-secret="JnDNNa5P6s"><p><a href="https://www.dbrnd.com/2015/11/database-theory-what-is-a-data-masking-2/">Database Theory: What is a Data Masking ?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/11/database-theory-what-is-a-data-masking-2/embed/#?secret=JnDNNa5P6s" data-secret="JnDNNa5P6s" width="600" height="338" title="&#8220;Database Theory: What is a Data Masking ?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is Data Theft?</strong></p>
<blockquote><p>Data theft is the act of stealing computer-based information from an unknowing victim with the intent of compromising privacy or obtaining confidential information. Data theft is increasingly a problem for individual computer users, as well as big corporate firms.</p>
<p>Data must be stored and transmitted securely, so that information such as credit card numbers cannot be stolen. Over the Internet and Wide Area Network (WAN) environments, both public carriers and private network owners often route portions of their network through insecure landlines, extremely vulnerable microwave and satellite links, or a number of servers.</p></blockquote>
<p><strong>What are the different types of Security levels?</strong></p>
<ul>
<li>Physical</li>
<li>Human</li>
<li>Operating System</li>
<li>Network</li>
<li>Database System</li>
</ul>
<p><strong>What does Database Encryption and Decryption mean?</strong></p>
<blockquote><p>Database encryption is the process of converting data, within a database, in plain text format into a meaningless cipher text by means of a suitable algorithm.</p>
<p>Database decryption is converting the meaningless cipher text into the original information using keys generated by the encryption algorithms.</p>
<p>Database encryption can be provided at the file or column level.</p></blockquote>
<p><strong>What is SQL injection?</strong></p>
<blockquote><p>SQL injection is an attack by malicious users in which malicious code can be inserted into strings that can be passed to an instance of SQL server for parsing and execution. All statements have to checked for vulnerabilities as it executes all syntactically valid queries that it receives.</p>
<p>Even parameters can be manipulated by the skilled and experienced attackers.</p></blockquote>
<p><strong>What are the methods used to protect against SQL injection attack?</strong></p>
<p>Following are the methods used to protect against SQL injection attack:</p>
<ul>
<li>Use Parameters for Stored Procedures</li>
<li>Filtering input parameters</li>
<li>Use Parameter collection with Dynamic SQL</li>
<li>In like clause, user escape characters</li>
</ul>
<p><strong>How can SQL Server instances be hidden?</strong></p>
<blockquote><p>To hide a SQL Server instance, we need to make a change in SQL Server Configuration Manager.</p>
<p>To do this launch SQL Server Configuration Manager and do the following:</p>
<p>select the instance of SQL Server, right click and select Properties. After selecting properties you will just set Hide Instance to &#8220;Yes&#8221; and click OK or Apply.</p>
<p>After the change is made, you need to restart the instance of SQL Server to not expose the name of the instance.</p></blockquote>
<p><strong>What are Orphaned Users?</strong></p>
<p>A database user for which the corresponding SQL Server login is undefined or is incorrectly defined on a server instance cannot log in to the instance. Such a user is said to be an orphaned user of the database on that server instance.</p>
<ul>
<li>A database user can become orphaned if the corresponding SQL Server login is dropped.</li>
<li>A database user can become orphaned after a database is restored or attached to a different instance of SQL Server.</li>
<li>Orphaning can happen if the database user is mapped to a SID that is not present in the new server instance.</li>
</ul>
<p><strong>Would you please describe any five server role with its permission?</strong></p>
<ul>
<li>bulkadmin: Granted &#8211; ADMINISTER BULK OPERATIONS</li>
<li>dbcreator: Granted &#8211; CREATE ANY DATABASE</li>
<li>diskadmin: Granted &#8211; ALTER RESOURCES</li>
<li>processadmin: Granted &#8211; ALTER ANY CONNECTION, ALTER SERVER STATE</li>
<li>securityadmin: Granted &#8211; ALTER ANY LOGIN</li>
<li>serveradmin: Granted &#8211; ALTER ANY ENDPOINT, ALTER RESOURCES, ALTER SERVER STATE, ALTER SETTINGS, SHUTDOWN, VIEW SERVER STATE</li>
<li>setupadmin: Granted &#8211; ALTER ANY LINKED SERVER</li>
<li>sysadmin: Granted with GRANT option &#8211; CONTROL SERVER</li>
</ul>
<p><strong>Which authentication mode is more secured?</strong></p>
<blockquote><p>Windows authentication is definitely more secure as it’s controlled and authenticated by Active Directory policies.</p></blockquote>
<p><strong>What is a Symmetric key in Data encryption process?</strong></p>
<blockquote><p>In Symmetric cryptography system, the sender and the receiver of a message share a single, common key that is used to encrypt and decrypt the message. This is relatively easy to implement, and both the sender and the receiver can encrypt or decrypt the messages.</p></blockquote>
<p><strong>What is a Asymmetric key in Data encryption process?</strong></p>
<blockquote><p>Asymmetric cryptography, also known as Public-key cryptography, is a system in which the sender and the receiver of a message have a pair of cryptographic keys – a public key and a private key – to encrypt and decrypt the message. This is a relatively complex system where the sender can use his key to encrypt the message but he cannot decrypt it. The receiver, on the other hand, can use his key to decrypt the message but he cannot encrypt it.</p></blockquote>
<p><strong>What Secure Socket Layer (SSL) with SQL Server and can we enable it?</strong></p>
<blockquote><p>Yes: We can enable SSL with SQL Server</p>
<p>Microsoft SQL Server can use Secure Sockets Layer (SSL) to encrypt data that is transmitted across a network between an instance of SQL Server and a client application. Enabling SSL encryption increases the security of data transmitted across networks between instances of SQL Server and applications.</p></blockquote>
<p><strong>What are basic steps to configure SSL for SQL Server?</strong></p>
<blockquote><p>Install a certificate in the Windows certificate store of the server computer.</p>
<p>Click Start, in the Microsoft SQL Server program group, point to Configuration Tools, and thenclick SQL Server Configuration Manager.</p>
<p>Expand SQL Server Network Configuration, right-click the protocols for the server you want, and then click Properties.</p>
<p>On the Certificate tab, configure the Database Engine to use the certificate.</p>
<p>On the Flags tab, view or specify the protocol encryption option. The login packet will always be encrypted.</p></blockquote>
<p><strong>What are the built-In Schemas?</strong></p>
<ul>
<li>dbo</li>
<li>guest</li>
<li>sys</li>
<li>INFORMATION_SCHEMA</li>
</ul>
<p><strong>Are you agree with User-Schema Separation in SQL Server?</strong></p>
<blockquote><p>Yes: User-schema separation allows for more flexibility in managing database object permissions. A schema is a named container for database objects, which allows you to group objects into separate namespaces.</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-data-mask-encryption-decrption-ssl-orphand-user-sql-injection-day-1/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server Database Administrator Interview Questions and Answers (Day-2)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 10 Jul 2016 16:32:04 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[checkpoints]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database administrator]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[range scan]]></category>
		<category><![CDATA[singleton lookup]]></category>
		<category><![CDATA[Snapshot database]]></category>
		<category><![CDATA[sparse file]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></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[stand by server]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[warm server]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3322</guid>

					<description><![CDATA[How to change the database owner of the database? [crayon-6aa5c109d5b66787603143/] What is Singleton Lookup? A singleton lookup is a seek operation whereby a single record/page of data is retrieved. This can occur, for example when you perform a query that needs to access only a single record, or a few records from a single page. [&#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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&#038;title=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2/" data-a2a-title="SQL Server Database Administrator Interview Questions and Answers (Day-2)"></a></p><p><strong>How to change the database owner of the database?</strong></p><pre class="crayon-plain-tag">EXEC sp_changedbowner 'MyAdmin';</pre><p>
<strong>What is Singleton Lookup?</strong></p>
<blockquote><p>A singleton lookup is a seek operation whereby a single record/page of data is retrieved. This can occur, for example when you perform a query that needs to access only a single record, or a few records from a single page.</p></blockquote>
<p><strong>What is a Range Scan?</strong></p>
<blockquote><p>A range-scan is a scan operation whereby a range of pages are retrieved &#8211; think of this as a full-scan with boundaries.</p></blockquote>
<p><strong>What is Checkpoints?</strong></p>
<blockquote><p>A checkpoint creates a known good point from which the SQL Server Database Engine can start applying changes contained in the log during recovery after an unexpected shutdown or crash.</p></blockquote>
<p><strong>What are the different type of Checkpoints?</strong></p>
<ul>
<li>automatic &#8211; Issued automatically in the background.</li>
<li>indirect &#8211; Issued in the background to meet a user-specified target recovery time for a given database.</li>
<li>manual &#8211; Issued when you execute a Transact-SQL CHECKPOINT command. The manual checkpoint occurs in the current database for your connection.</li>
<li>internal &#8211; Issued by various server operations such as backup and database-snapshot creation to guarantee that disk images match the current state of the log.</li>
</ul>
<p><strong>What is Database Snapshot?</strong></p>
<blockquote><p>A database snapshot is a view of what the source database looked like at the time at which the snapshot was created. This means that all the objects will be the same as what it was when the snapshot was taken and all of the data will be exactly as it was then.</p>
<p>To use database snapshots to recover from an unwanted DML statement, you need to have a suitable snapshot in place. Snapshots can only be created by using a T-SQL statement.</p></blockquote>
<p><strong>What is Sparse file in Database Snapshot?</strong></p>
<blockquote><p>To store the copied original pages, the snapshot uses one or more sparse files. Initially, a sparse file is an essentially empty file that contains no user data and has not yet been allocated disk space for user data.</p>
<p>As more and more pages are updated in the source database, the size of the file grows. When a snapshot is taken, the sparse file takes up little disk space. As the database is updated over time, however, a sparse file can grow into a very large file.</p></blockquote>
<p><strong>Explain Sparse file Size in database snapshot.</strong></p>
<blockquote><p>At the creation time sparse file will take very little space, but as the data changes occurred into the parent database, data page before the changes copied into the sparse file.</p>
<p>Thus sparse file grows. Sparse files are the feature of NTFS file system. As the sparse file grows NTFS will allocate the space to sparse file gradually.</p></blockquote>
<p><strong>How to create database snapshot?</strong></p>
<blockquote><p>Based on the current size of the source database, ensure that you have sufficient disk space to hold the database snapshot. The maximum size of a database snapshot is the size of the source database at snapshot creation.</p>
<p>Issue a CREATE DATABASE statement on the files using the AS SNAPSHOT OF clause. Creating a snapshot requires specifying the logical name of every database file of the source database.</p></blockquote>
<p><strong>How does a snapshot work?</strong></p>
<ul>
<li>When you create a snapshot a sparse file is created for each data file</li>
<li>When data is modified in the source database for the first time, the old value of the modified data is copied to the sparse file</li>
<li>If the same data is the subsequently changed again, those changes will be ignored and not copied to the snapshot</li>
<li>When you query the snapshot, it first checks if the data is available in the snapshot. If it’s there it reads if from the snapshot. If it’s not there, I reads through to the source database and gets the data from there instead, because that means the data has not yet changed since the time the snapshot was taken.</li>
</ul>
<p><strong>Can we change the permissions in a database snapshot?</strong></p>
<blockquote><p>No it’s not possible.</p></blockquote>
<p><strong>Can we take a backup of a database snapshot?</strong></p>
<blockquote><p>No.</p></blockquote>
<p><strong>What are the benefits of Database Snapshots?</strong></p>
<ul>
<li>Snapshots can be used for reporting purposes.</li>
<li>Using a mirror database that you are maintaining for availability purposes to offload reporting.</li>
<li>Safeguarding data against administrative and user error.</li>
</ul>
<p><strong>What is hot standby and warm standby server?</strong></p>
<blockquote><p>Warm servers are often used for replication and mirroring.</p>
<p>A hot server is a backup server that receives regular updates and is standing by ready (on hot standby) to take over immediately in the event of a failover.</p></blockquote>
<p><strong>What is copy-on-write operation in database snapshot?</strong></p>
<blockquote><p>Database snapshots operate at the data-page level. Before a page of the source database is modified for the first time, the original page is copied from the source database to the snapshot.</p>
<p>This process is called a copy-on-write operation. The snapshot stores the original page, preserving the data records as they existed when the snapshot was created.</p></blockquote>
<p><strong>Is database snapshot transitionally consistent?</strong></p>
<blockquote><p>Each database snapshot is transitionally consistent with the source database at the moment of the snapshot’s creation. When we create a database snapshot, the source database will typically have number open transactions.</p>
<p>Before the snapshot becomes available, the open transactions are rolled back to make the database snapshot transitionally consistent. Just like it follows the recovery interval step and it will not affect the source database.</p></blockquote>
<p><strong>Can SQL Servers linked to other servers like Oracle?</strong></p>
<blockquote><p>SQL Server can be linked to any server provided it has OLE-DB provider from Microsoft to allow a link. E.g. Oracle has an OLE-DB provider for oracle that Microsoft provides to add it as linked server to SQL Server group.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server Database Administrator Interview Questions and Answers (Day-1)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-administrator-interview-questions-and-answers-day-1/</link>
					<comments>https://www.dbrnd.com/2016/07/sql-server-database-administrator-interview-questions-and-answers-day-1/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 09 Jul 2016 19:59:51 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database administrator]]></category>
		<category><![CDATA[database maintenance plan]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></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[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3319</guid>

					<description><![CDATA[How to check server side configuration? [crayon-6aa5c109d5d9b430941999/] How to check the current location of data and log files for the system databases? [crayon-6aa5c109d5d9d700495092/] What are the types of CHECKSUM? SQL Server supports three types of checksums: a checksum on pages, a checksum in log blocks, and a backup checksum. What is a SQL Server Credential? [&#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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-day-1%2F&#038;title=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-1%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-administrator-interview-questions-and-answers-day-1/" data-a2a-title="SQL Server Database Administrator Interview Questions and Answers (Day-1)"></a></p><p><strong>How to check server side configuration?</strong></p><pre class="crayon-plain-tag">SELECT * FROM sys.configurations;</pre><p>
<strong>How to check the current location of data and log files for the system databases?</strong></p><pre class="crayon-plain-tag">SELECT name, physical_name AS current_file_location
FROM sys.master_files
WHERE database_id IN (DB_ID('master'), DB_ID('model'), DB_ID('msdb'), DB_ID('tempdb'));</pre><p>
<strong>What are the types of CHECKSUM?</strong></p>
<blockquote><p>SQL Server supports three types of checksums: a checksum on pages, a checksum in log blocks, and a backup checksum.</p></blockquote>
<p><strong>What is a SQL Server Credential?</strong></p>
<blockquote><p>A SQL Server credential is an object that is used to store authentication information required to connect to a resource outside of SQL Server.</p></blockquote>
<p><strong>How to remove all SQL Job related history from the related system tables?</strong></p>
<blockquote><p>Using this system stored procedure &#8211; sp_purge_jobhistory .</p></blockquote>
<p><strong>What are Database Maintenance Plans?</strong></p>
<blockquote><p>Database Maintenance Plans allow us to automate many database administration tasks in Microsoft SQL Server. Maintenance plans create a workflow of the tasks required to make sure that our database is optimized, regularly backed up, and free of inconsistencies.</p></blockquote>
<p><strong>What all options we have in a Database maintenance plans which helps a DBA to keep the database healthy?</strong></p>
<ul>
<li>Check Database Integrity</li>
<li>Shrink Database</li>
<li>Reorganize Index</li>
<li>Rebuild Index</li>
<li>Update Statistics</li>
<li>Clean Up History</li>
<li>Execute SQL Server agent job</li>
<li>All type of Database Backup</li>
<li>Maintenance clean up task</li>
</ul>
<p><strong>In which Database all the Maintenance Plans are stored?</strong></p>
<blockquote><p>MSDB database contains information about all the Database Maintenance plans.</p></blockquote>
<p><strong>Can we execute TSQL Statement using Database Maintenance Tasks?</strong></p>
<blockquote><p>Yes, we can run TSQL Statement in a Database Maintenance Plan.</p></blockquote>
<p><strong>Can we run a SQL Server Agent job using Database Maintenance Tasks?</strong></p>
<blockquote><p>Yes, we run a SQL Server Agent job in a Database Maintenance Plan.</p></blockquote>
<p><strong>Is it possible to mark Primary File Group as Read only?</strong></p>
<blockquote><p>No it’s not possible to make Primary File Group read only.</p></blockquote>
<p><strong>How to make the File Group read only?</strong></p><pre class="crayon-plain-tag">ALTER DATABASE AdvantureWorks2012 MODIFY FILEGROUP SecondaryFile Read_Only;</pre><p>
<strong>What are the benefits of Read only file groups?</strong></p>
<ul>
<li>Can be compressed (using NTFS compression)</li>
<li>During recovery you don’t need to apply logs to recover a read-only file group</li>
<li>Protection of data from accidental modifications</li>
</ul>
<p><strong>What are the important dynamic management views to find different type of fragmentations?</strong></p>
<ul>
<li>dm_db_index_operational_stats</li>
<li>dm_db_index_physical_stats</li>
<li>dm_db_partition_stats</li>
<li>dm_db_index_usage_stats</li>
</ul>
<p><strong>What are the important dynamic management views to find space usage related information?</strong></p>
<ul>
<li>dm_db_file_space_usage</li>
<li>dm_db_task_space_usage</li>
<li>dm_db_session_space_usage</li>
</ul>
<p><strong>What is the Query Hints option?</strong></p>
<blockquote><p>Query hints override the default behavior of the query optimizer for the duration of the query statement.</p>
<p>You can use query hints to specify a locking method on the affected tables, one or more indexes, a query processing operation such as a table scan or index seek, or other options. Query hints are applied to the entire query.</p></blockquote>
<p><strong>What is BCP? When does it used?</strong></p>
<blockquote><p>BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination. BULK INSERT command helps to import a data file into a database table or view in a user-specified format.</p></blockquote>
<p><strong>Can we add CPU to sql server?</strong></p>
<blockquote><p>Yes: Adding CPUs can occur physically by adding new hardware, logically by online hardware partitioning, or virtually through a virtualization layer.</p></blockquote>
<p><strong>What are the most common ports of SQL Server?</strong></p>
<ul>
<li>MSSQL Server: 1433</li>
<li>HTTP TCP: 80</li>
<li>HTTPS TCP: 443</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/07/sql-server-database-administrator-interview-questions-and-answers-day-1/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: Database Log Shipping Interview Questions and Answers (Day-4)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-log-shipping-interview-questions-and-answers-common-problems-sp_resolve_logins-mirroring-differences-day-4/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 08 Jul 2016 19:48:39 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[log shipping]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></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[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3257</guid>

					<description><![CDATA[What are common reasons which breaks or stops the Log Shipping? Recent modifications on the shared folders. Human error like, either someone used the option of truncate only or switched the recovery model. date/time for the windows servers unmatching due to any DST activities. Datafile added on Primary on different drives then you need to [&#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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-common-problems-sp_resolve_logins-mirroring-differences-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-4%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-common-problems-sp_resolve_logins-mirroring-differences-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-4%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-common-problems-sp_resolve_logins-mirroring-differences-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-4%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-common-problems-sp_resolve_logins-mirroring-differences-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-4%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-common-problems-sp_resolve_logins-mirroring-differences-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-4%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-common-problems-sp_resolve_logins-mirroring-differences-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-4%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-common-problems-sp_resolve_logins-mirroring-differences-day-4%2F&#038;title=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-4%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-log-shipping-interview-questions-and-answers-common-problems-sp_resolve_logins-mirroring-differences-day-4/" data-a2a-title="SQL Server: Database Log Shipping Interview Questions and Answers (Day-4)"></a></p><p><strong>What are common reasons which breaks or stops the Log Shipping?</strong></p>
<ul>
<li>Recent modifications on the shared folders.</li>
<li>Human error like, either someone used the option of truncate only or switched the recovery model.</li>
<li>date/time for the windows servers unmatching due to any DST activities.</li>
<li>Datafile added on Primary on different drives then you need to apply that on secondary with move until that your log shipping restore job will fail.</li>
<li>Any I/O,Memory,N/w bottleneck.</li>
<li>Your tuf file is missing.</li>
<li>You may have set the incorrect value for the Out of Sync Alert threshold.</li>
<li>Might be you have scheduled the jobs in same time.</li>
<li>Might be your MSDB database is full.</li>
</ul>
<p><strong>I&#8217;m getting the below error message in restoration job on secondary server, WHY?</strong></p>
<p><strong>&#8221; [Microsoft SQL-DMO (ODBC SQLState: 42000)]</strong></p>
<p><strong>Error 4305: [Microsoft][ODBC SQL Server Driver][SQL Server]The log in this backup set</strong></p>
<p><strong>begins at LSN 7000000026200001, which is too late to apply to the database. An earlier</strong></p>
<p><strong>log backup that includes LSN 6000000015100001 can be restored.</strong></p>
<p><strong>[Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE LOG is terminating abnormally &#8220;.</strong></p>
<blockquote><p>Was your sql server or agent restarted yesterday in either source or destination ? because the error states there is a mismatch in LSN. A particular transaction log was not applied in the destination server hence the subsequent transaction logs cannot be applied as a result.</p>
<p>You can check log shipping monitor \ log shipping tables to check the which transaction log is last applied to secondary database.</p>
<p>Incase if you are not able to find the next transaction log in secondary server shared folder, you need to reconfigure log shipping.</p></blockquote>
<p><strong>What are your basic steps to reconfigure the Log Shipping?</strong></p>
<ul>
<li>Disable all the log shipping jobs in source and destination servers.</li>
<li>Take a full backup in source and restore it in secondary server using the With Standby option.</li>
<li>Enable all the jobs you disabled previously in step1.</li>
</ul>
<p><strong>Is it possible load balance in log shipping?</strong></p>
<blockquote><p>Yes: its possible in log shipping, while configuring log shipping you have the option to choose standby or no recovery mode, there you select STANDBY option to make the secondary database readonly.</p></blockquote>
<p><strong>Can I take full backup of the log shipped database in secondary server?</strong></p>
<blockquote><p>No: You cannot take the full backup.</p></blockquote>
<p><strong>What are the benefits of Log Shipping?</strong></p>
<ul>
<li>Log shipping doesn&#8217;t require expensive hardware or software. While it is great if your standby server is similar in capacity to your production server, it is not a requirement. In addition, you can use the standby server for other tasks, helping to justify the cost of the standby server.</li>
<li>Once log shipping has been implemented, it is relatively easy to maintain.</li>
<li>Assuming you have implemented log shipping correctly, it is very reliable.</li>
<li>The manual failover process is generally very short, typically 15 minutes or less.</li>
<li>Depending on how you have designed your log shipping process, very little, if any, data is lost should you have to failover. The amount of data loss, if any, is also dependent on why your production server failed.</li>
<li>Implementing log shipping is not technically difficult. Almost any DBA with several months or more of SQL Server 7 experience can successfully implement it.</li>
</ul>
<p><strong>Once the primary server comes back online, is it a difficult process to switch back to the primary database server?</strong></p>
<ul>
<li>Traditionally, depending on the size and number of database that are invloved in logshipping, it may or may not be difficult.</li>
<li>Database size and your network bandwidth matters a lot. Normally, you just have to resetup log-shipping. Meaning &#8211; point all your apps to primary and in background, do a full backup of primary, copy that to secondary server and restore it with no-recovery with subsequent log backups.</li>
<li>To minimize the downtime, you can use &#8220;Reverse logshipping&#8221; will prove to be a huge help.</li>
</ul>
<p><strong>Will changing the Recovery model to Full (from simple) have any issues?</strong></p>
<blockquote><p>Yes. Changing recovery model breaks the log chain.</p></blockquote>
<p><strong>Will my existing backups (using Symantec Backup Exec) be affected by enabling log shipping and switching to a full recovery model?</strong></p>
<blockquote><p>Once you setup logshipping, there is no need to take any additional log backups. In fact, any adhoc log backups will break the log chain. Use COPY_ONLY backups.</p></blockquote>
<p><strong>There are two servers. one is primary and the other is secondary. primary is on production server.</strong></p>
<ul>
<li>Logshipping configured and working fine. Suddenly, after some days, the sync between the servers is not there.</li>
<li>What is the immediate action?</li>
<li>First thing I&#8217;d do is check the backup log job and the copy job which copies the job from the primary to secondary and after that check the restore job which restores the log on the secondary. If there are no errors there then I&#8217;d start looking in msdb at the log shipping tables and see if I could determine the error from there.</li>
</ul>
<p><strong>Do we require any endpoints for Log Shipping?</strong></p>
<blockquote><p>We don&#8217;t need to create endpoints or assign port in log shipping, which is required for database mirroring.</p></blockquote>
<p><strong>What are the log shipping frequent issues you have faced?</strong></p>
<blockquote><p>It depends. I have seen some issues like transaction log cannot restored on the secondary database which is due to that the transaction log sequence is broken.</p></blockquote>
<p><strong>You might find that the last backed up/copied/restored files do not reflect correctly in the log shipping reports when you use a remote monitor server. What is this issue?</strong></p>
<blockquote><p>The last copied and restored file will show up as null if the monitor instance is not on the same box as the secondary instance. The last backed up file will show up as null if the monitor instance is not on the same box as the primary instance if the select @@servername value is not used as the monitor server name while configuring the log shipping monitor.</p></blockquote>
<p><strong>What do you know about the below error?</strong></p>
<blockquote><p>Error: During startup of warm standby database ‘testdb’ (database ID 7), its standby file (‘&lt;UNC path of the TUF file&gt;’) was inaccessible to the RESTORE statement. The operating system error was ‘5(Access is denied.)’.</p>
<p>If you have configured Log Shipping with STANDBY mode on SQL Server 2008 and the destination folder for the TLOGS uses a remote server on which the sqlservice/sqlagent is not a Local Admin, then the restore job will fail every time.</p></blockquote>
<p><strong>The sp_resolve_logins stored procedure runs successfully; however, it does not perform the expected modifications to the security on the secondary server. Why?</strong></p>
<blockquote><p>The sp_resolve_logins stored procedure requires an up-to-date BCP file of the primary server&#8217;s syslogins system table. These logins must already by created on the secondary server.</p></blockquote>
<p><strong>Log Shipping Backup and Out of Sync alerts are firing, even when the secondary server is updated with the transaction log backups. Is this possible?</strong></p>
<blockquote><p>Yes. It is possible that the alerts might fire even when the secondary database is being updated. If the alert threshold is set to a value less than double the time between back up and copy or restore jobs, the alerts might be raised.</p></blockquote>
<p><strong>What are the main differences between Log Shipping and Database Mirroring?</strong></p>
<p><span style="text-decoration: underline;"><strong>Log Shipping:</strong></span></p>
<ul>
<li>It automatically sends transaction log backups from one database (Known as the primary database) to a database (Known as the Secondary database) on another server. An optional third server, known as the monitor server, records the history and status of backup and restore operations. The monitor server can raise alerts if these operations fail to occur as scheduled.</li>
<li>It has a manual Failover.</li>
<li>You can use a secondary database for reporting purposes when the secondary database restore in STANDBY mode.</li>
<li>The servers involved in log shipping should have the same logical design and collation setting.</li>
<li>The databases in a log shipping configuration must use the full recovery model or bulk-logged recovery model.</li>
<li>The SQL server agent should be configured to start up automatically.</li>
<li>You must have sysadmin privileges on each computer running SQL server to configure log shipping.</li>
</ul>
<p><span style="text-decoration: underline;"><strong>Mirroring:</strong></span></p>
<ul>
<li>Database mirroring is a primarily software solution for increasing database availability.</li>
<li>It has a Automatice Failover.</li>
<li>Mirrored DB can only be accessed using snapshot DB.</li>
<li>It maintains two copies of a single database that must reside on different server instances of SQL Server Database Engine.</li>
<li>Verify that there are no differences in system collation settings between the principal and mirror servers.</li>
<li>Verify that the local windows groups and SQL Server logins definitions are the same on both servers.</li>
<li>Verify that external software components are installed on both the principal and the mirror servers.</li>
<li>Verify that the SQL Server software version is the same on both servers.</li>
<li>Verify that global assemblies are deployed on both the principal and mirror server.</li>
<li>Verify that for the certificates and keys used to access external resources, authentication and encryption match on the principal and mirror server.</li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Log Shipping Interview Questions and Answers (Day-1)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-log-shipping-interview-questions-and-answers-backup-copy-restore-agent-job-monitor-server-day-1/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 05 Jul 2016 19:42:36 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[agent job]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[backup job]]></category>
		<category><![CDATA[copy job]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[log shipping]]></category>
		<category><![CDATA[monitor server]]></category>
		<category><![CDATA[primary server]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[restore job]]></category>
		<category><![CDATA[secondary server]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></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[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3244</guid>

					<description><![CDATA[What is a Log Shipping? It is a shipping of SQL Server transaction log from one server to another server. It is a one kind of high availability feature of SQL Server. You can use log shipping to send transaction logs from one database (the primary database) to another (the secondary database) on a constant [&#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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-backup-copy-restore-agent-job-monitor-server-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-backup-copy-restore-agent-job-monitor-server-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-backup-copy-restore-agent-job-monitor-server-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-backup-copy-restore-agent-job-monitor-server-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-backup-copy-restore-agent-job-monitor-server-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-backup-copy-restore-agent-job-monitor-server-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-1%29" 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%2F07%2Fsql-server-database-log-shipping-interview-questions-and-answers-backup-copy-restore-agent-job-monitor-server-day-1%2F&#038;title=SQL%20Server%3A%20Database%20Log%20Shipping%20Interview%20Questions%20and%20Answers%20%28Day-1%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-log-shipping-interview-questions-and-answers-backup-copy-restore-agent-job-monitor-server-day-1/" data-a2a-title="SQL Server: Database Log Shipping Interview Questions and Answers (Day-1)"></a></p><p><strong>What is a Log Shipping?</strong></p>
<blockquote><p>It is a shipping of SQL Server transaction log from one server to another server. It is a one kind of high availability feature of SQL Server.</p>
<p>You can use log shipping to send transaction logs from one database (the primary database) to another (the secondary database) on a constant basis. Continually backing up the transaction logs from a primary database and then copying and restoring them to a secondary database keeps the secondary database nearly synchronized with the primary database.</p></blockquote>
<p><strong>Would you please explain the basic work of Log Shipping?</strong></p>
<blockquote><p>Log shipping allows you to automatically send transaction log backups from a primary database on a primary server instance to one or more secondary databases on separate secondary server instances. The transaction log backups are applied to each of the secondary databases individually. An optional third server instance, known as the monitor server, records the history and status of backup and restore operations and, optionally, raises alerts if these operations fail to occur as scheduled.</p></blockquote>
<p><strong>What are the main operations involved in Log Shipping?</strong></p>
<ul>
<li>Log shipping consists of three operations:</li>
<li>Back up the transaction log at the primary server instance.</li>
<li>Copy the transaction log file to the secondary server instance.</li>
<li>Restore the log backup on the secondary server instance.</li>
</ul>
<p><strong>Does Log Shipping support automatic failover?</strong></p>
<blockquote><p>A log shipping configuration does not automatically fail over from the primary server to the secondary server. If the primary database becomes unavailable, any of the secondary databases can be brought online manually.</p></blockquote>
<p><strong>Can we use a secondary database as Reporting purpose?</strong></p>
<blockquote><p>Yes: we can use a secondary database for reporting purpose.</p></blockquote>
<p><strong>What is a Primary server or database in Log Shipping?</strong></p>
<blockquote><p>The primary server in a log shipping configuration is the instance of the SQL Server Database Engine that is your production server. The primary database is the database on the primary server that you want to back up to another server. All administration of the log shipping configuration through SQL Server Management Studio is performed from the primary database.</p></blockquote>
<p><strong>Can I apply Simple Recovery Model to Parimary database of Log Shipping?</strong></p>
<blockquote><p>No:The primary database must use the full or bulk-logged recovery model; switching the database to simple recovery will cause log shipping to stop functioning.</p></blockquote>
<p><strong>What is a Secondary server or database in Log Shipping?</strong></p>
<blockquote><p>The secondary server in a log shipping configuration is the server where you want to keep a warm standby copy of your primary database. A secondary server can contain backup copies of databases from several different primary servers.</p>
<p>One single Secondary server could be used for multiple primary server.</p>
<p>The secondary database must be initialized by restoring a full backup of the primary database. The restore can be completed using either the NORECOVERY or STANDBY option.</p></blockquote>
<p><strong>What do you know about the Monitor Server of Log Shipping?</strong></p>
<blockquote><p>This is an optional server which tracks all of the details of log shipping.</p>
<p>Details like:</p>
<ul>
<li>When the transaction log on the primary database was last backed up.</li>
<li>When the secondary servers last copied and restored the backup files.</li>
<li>Information about any backup failure alerts.</li>
<li>Another important thing is,</li>
<li>Once the monitor server has been configured, it cannot be changed without removing log shipping first.</li>
</ul>
</blockquote>
<p><strong>What kind of different SQL Jobs involved in Log Shipping Operations?</strong></p>
<blockquote><p>Log shipping involves four jobs, which are handled by dedicated SQL Server Agent jobs. These jobs include the backup job, copy job, restore job, and alert job.</p>
<p>The basic work of these jobs is, How frequently log backups are taken, how frequently they are copied to each secondary server, and how frequently they are applied to the secondary database.</p></blockquote>
<p><strong>What is the main use of Backup Job?</strong></p>
<blockquote><p>When log shipping is enabled, the SQL Server Agent job category &#8220;Log Shipping Backup&#8221; is created on the primary server instance.</p>
<p>A backup job is created on the primary server instance for each primary database. It performs the backup operation, logs history to the local server and the monitor server, and deletes old backup files and history information. By default, this job will run every 15 minutes, but the interval is customizable.</p></blockquote>
<p><strong>What is the main use of Copy Job?</strong></p>
<blockquote><p>When log shipping is enabled, the SQL Server Agent job category &#8220;Log Shipping Copy&#8221; is created on the secondary server instance.</p>
<p>A copy job is created on each secondary server instance in a log shipping configuration. This job copies the backup files from the primary server to a configurable destination on the secondary server and logs history on the secondary server and the monitor server. The copy job schedule, which is customizable, should approximate the backup schedule.</p></blockquote>
<p><strong>What is the main task of Restore Job?</strong></p>
<ul>
<li>The SQL Server job category &#8220;Log Shipping Restore&#8221; is created on the secondary server instance when log shipping is enabled.</li>
<li>A restore job is created on the secondary server instance for each log shipping configuration. This job restores the copied backup files to the secondary databases. It logs history on the local server and the monitor server, and deletes old files and old history information.</li>
<li>Scheduling these jobs with the same frequency keeps the secondary database as closely aligned with the primary database as possible to create a warm standby database.</li>
</ul>
<p><strong>What is the main use of Agent Job?</strong></p>
<blockquote><p>If a monitor server is used, an alert job is created on the monitor server instance. This alert job is shared by the primary and secondary databases of all log shipping configurations using this monitor server instance.</p>
<p>This job raises alerts (for which you must specify alert numbers) for primary and secondary databases when backup and restore operations have not completed successfully within specified thresholds.</p></blockquote>
<p><strong>Do you know what is the default time interval in Log Shipping?</strong></p>
<blockquote><p>It is 15 minutes.</p></blockquote>
<p><strong>What is the solution of the below error?</strong></p>
<p><strong>&#8220;Error: The restore operation cannot proceed because the secondary database ‘&lt;Database Name&gt;’ is not in NORECOVERY/STANDBY mode.(Microsoft.SqlServer.Management.LogShipping)&#8221;</strong></p>
<blockquote><p>Restore the secondary database with the full backup of the primary database with NORECOVERY and REPLACE option.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
