<?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>login &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/login/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>Tue, 16 Jan 2018 10:48:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Server: Script to find Database USER LOGIN Information</title>
		<link>https://www.dbrnd.com/2018/01/sql-server-script-to-find-database-user-login-information-password-expiration-authentication-security/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 27 Jan 2018 16:16:44 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[login expiration]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[security]]></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[TSQL]]></category>
		<category><![CDATA[user]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4047</guid>

					<description><![CDATA[In this post, I am sharing one T-SQL Script to find SQL Server USER LOGIN Information. As a DBA, we should check the USER LOGIN Information to make sure about the user expiration, password expiration. Using password expiration information, you can also notify the user before its password expires. [crayon-6ab5601c0cea7792421617/]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&#038;title=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" data-a2a-url="https://www.dbrnd.com/2018/01/sql-server-script-to-find-database-user-login-information-password-expiration-authentication-security/" data-a2a-title="SQL Server: Script to find Database USER LOGIN Information"></a></p><p>In this post, I am sharing one T-SQL Script to find SQL Server USER LOGIN Information. </p>
<blockquote><p>As a DBA, we should check the USER LOGIN Information to make sure about the user expiration, password expiration.<br />
Using password expiration information, you can also notify the user before its password expires. </p></blockquote>
<pre class="crayon-plain-tag">SELECT 
	SL.name AS LoginName 
	,LOGINPROPERTY (SL.name, 'PasswordLastSetTime') AS PasswordLastSetTime 
	,LOGINPROPERTY (SL.name, 'DaysUntilExpiration') AS DaysUntilExpiration 
	,DATEADD(dd, CONVERT(int, LOGINPROPERTY (SL.name, 'DaysUntilExpiration')) 
				, CONVERT(datetime, LOGINPROPERTY (SL.name, 'PasswordLastSetTime'))) AS PasswordExpiration 
	,SL.is_policy_checked AS IsPolicyChecked 
	,LOGINPROPERTY (SL.name, 'IsExpired') AS IsExpired 
	,LOGINPROPERTY (SL.name, 'IsMustChange') AS IsMustChange 
	,LOGINPROPERTY (SL.name, 'IsLocked') AS IsLocked 
	,LOGINPROPERTY (SL.name, 'LockoutTime') AS LockoutTime 
	,LOGINPROPERTY (SL.name, 'BadPasswordCount') AS BadPasswordCount 
	,LOGINPROPERTY (SL.name, 'BadPasswordTime') AS BadPasswordTime 
	,LOGINPROPERTY (SL.name, 'HistoryLength') AS HistoryLength 
FROM sys.sql_logins AS SL 
WHERE is_expiration_checked = 1 
ORDER BY LOGINPROPERTY (SL.name, 'PasswordLastSetTime') DESC</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL Error &#8211; FATAL: database role &#8220;root&#8221; does not exist in Linux</title>
		<link>https://www.dbrnd.com/2017/01/postgresql-error-fatal-database-role-root-does-not-exist-in-linux/</link>
					<comments>https://www.dbrnd.com/2017/01/postgresql-error-fatal-database-role-root-does-not-exist-in-linux/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 23 Jan 2017 21:21:42 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[fatal]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[login fail]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[role does not exist]]></category>
		<category><![CDATA[username]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4105</guid>

					<description><![CDATA[A PostgreSQL Fatal error like role or username does not exist. This is a very common error which is facing by PostgreSQL Users. Actually, this is happening because of misconfiguration of System username and Database Username. Most of the Linux users are trying to log in PostgreSQL using root user. But actually, this is wrong. [&#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%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" 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%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" 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%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" 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%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" 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%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" 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%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&amp;linkname=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" 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%2Fpostgresql-error-fatal-database-role-root-does-not-exist-in-linux%2F&#038;title=PostgreSQL%20Error%20%E2%80%93%20FATAL%3A%20database%20role%20%E2%80%9Croot%E2%80%9D%20does%20not%20exist%20in%20Linux" data-a2a-url="https://www.dbrnd.com/2017/01/postgresql-error-fatal-database-role-root-does-not-exist-in-linux/" data-a2a-title="PostgreSQL Error – FATAL: database role “root” does not exist in Linux"></a></p><p>A PostgreSQL Fatal error like role or username does not exist. This is a very common error which is facing by PostgreSQL Users.</p>
<blockquote><p>Actually, this is happening because of misconfiguration of System username and Database Username.
</p></blockquote>
<blockquote><p>Most of the Linux users are trying to log in PostgreSQL using root user. But actually, this is wrong. </p></blockquote>
<blockquote><p>You will need to become the operating system user under which PostgreSQL was installed to create the first user account.</p></blockquote>
<blockquote><p>Generally, the default user name is Postgres and default database is also Postgres.<br />
Once you install PostgreSQL on Linux, you should set the password for the Postgres user which is the default super user of PostgreSQL. </p></blockquote>
<blockquote><p>Please do not try to log in with any other default Linux or Unix system user name.
</p></blockquote>
<p><strong>Set password for the default Postgres user:<br />
</strong></p>
<pre class="crayon-plain-tag">sudo passwd postgres</pre> </p>
<p><strong>Create another role using &#8220;postgres&#8221;:<br />
</strong>Creating new role &#8220;dbrnd&#8221;. -p = set the password and -d = allow to create database.</p>
<pre class="crayon-plain-tag">sudo -u postgres createuser dbrnd -d -P</pre> </p>
<blockquote class="wp-embedded-content" data-secret="zQcnw6C0WT"><p><a href="https://www.dbrnd.com/2016/04/postgresql-how-to-install-postgresql-9-4-on-ubuntu-14-04/">PostgreSQL: How to Install PostgreSQL 9.4 on Ubuntu 14.04?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/postgresql-how-to-install-postgresql-9-4-on-ubuntu-14-04/embed/#?secret=zQcnw6C0WT" data-secret="zQcnw6C0WT" width="600" height="338" title="&#8220;PostgreSQL: How to Install PostgreSQL 9.4 on Ubuntu 14.04?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote class="wp-embedded-content" data-secret="ViFF2aw9xL"><p><a href="https://www.dbrnd.com/2017/01/postgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04/">PostgreSQL: How to Install PostgreSQL 9.6 on Ubuntu 16.04?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2017/01/postgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04/embed/#?secret=ViFF2aw9xL" data-secret="ViFF2aw9xL" width="600" height="338" title="&#8220;PostgreSQL: How to Install PostgreSQL 9.6 on Ubuntu 16.04?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/01/postgresql-error-fatal-database-role-root-does-not-exist-in-linux/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: Who dropped a Table and Which Table has been dropped</title>
		<link>https://www.dbrnd.com/2016/12/sql-server-who-dropped-a-table-and-which-table-has-been-dropped/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 12 Dec 2016 20:14:17 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Audit]]></category>
		<category><![CDATA[CDC]]></category>
		<category><![CDATA[Change data capture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[DDL Trii]]></category>
		<category><![CDATA[drop]]></category>
		<category><![CDATA[drop table]]></category>
		<category><![CDATA[fn_dblog()]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[transaction log]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[user]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4063</guid>

					<description><![CDATA[SQL Server provides different types of database auditing option like: CDC, Database Audit. Recently, I have shared one article about, change your database DDL changes using Encrypted DDL triggers. SQL Server: Encrypted DDL Trigger to Track all Database Changes Database Administrators are responsible for database security and Periodically, They have to track all the database [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&amp;linkname=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fsql-server-who-dropped-a-table-and-which-table-has-been-dropped%2F&#038;title=SQL%20Server%3A%20Who%20dropped%20a%20Table%20and%20Which%20Table%20has%20been%20dropped" data-a2a-url="https://www.dbrnd.com/2016/12/sql-server-who-dropped-a-table-and-which-table-has-been-dropped/" data-a2a-title="SQL Server: Who dropped a Table and Which Table has been dropped"></a></p><p>SQL Server provides different types of database auditing option like: CDC, Database Audit.<br />
Recently, I have shared one article about, change your database DDL changes using Encrypted DDL triggers. </p>
<blockquote class="wp-embedded-content" data-secret="0nSvSWs9bx"><p><a href="https://www.dbrnd.com/2016/10/sql-server-encrypted-ddl-trigger-to-track-all-database-changes-to-ensure-database-object-security/">SQL Server: Encrypted DDL Trigger to Track all Database Changes</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/10/sql-server-encrypted-ddl-trigger-to-track-all-database-changes-to-ensure-database-object-security/embed/#?secret=0nSvSWs9bx" data-secret="0nSvSWs9bx" width="600" height="338" title="&#8220;SQL Server: Encrypted DDL Trigger to Track all Database Changes&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>Database Administrators are responsible for database security and Periodically, They have to track all the database related changes and make sure that everything is working fine. </p></blockquote>
<blockquote><p>But still sometimes, I used to track database changes from the SQL Server log files using fn_dblog().<br />
I am sharing one way to find a person who dropped a table and also can get the name of that dropped table without enabling any auditing option of SQL Server.</p></blockquote>
<p><strong>Script to find the log of dropped objects:</strong></p>
<blockquote><p>Using this script, you can find a list of dropped tables and login name information, but you cannot get table name directly.<br />
You can find the transaction id for each record and using this transaction ID, you can find the table name.</p></blockquote>
<pre class="crayon-plain-tag">SELECT 
	[Transaction Id]
	,[Begin Time]
	,SUSER_SNAME ([Transaction SID]) AS [LoginName] 
FROM fn_dblog (NULL, NULL)  
WHERE [Transaction Name] = N'DROPOBJ';</pre> </p>
<p><strong>Find Table name using TransactionID:</strong></p>
<pre class="crayon-plain-tag">SELECT TOP 1 
	[Lock Information] 
FROM fn_dblog (NULL, NULL)  
WHERE [Transaction Id] = '0000:0015d6b3'  
AND [Lock Information] LIKE '%SCH_M OBJECT%';</pre> </p>
<p><strong>The result:</strong><br />
To get the table name, you can copy the number and search into sys.objects table.</p>
<pre class="crayon-plain-tag">HoBt 0:ACQUIRE_LOCK_SCH_M OBJECT: 8:1015674666:0</pre> </p>
<p><strong>Find your dropped table:</strong><br />
Please do not start to search your dropped table in your current database because Table already dropped.<br />
You must restore the last backup of the database and you should search your dropped table in that database. </p>
<pre class="crayon-plain-tag">SELECT *FROM sys.objects 
WHERE Object_ID ='1015674666'</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Error 15023 User already exists in current database (Problem of Orphan User)</title>
		<link>https://www.dbrnd.com/2016/11/sql-server-error-15023-user-already-exists-in-current-database-problem-of-orphan-user/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 12 Nov 2016 16:16:43 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[map sid]]></category>
		<category><![CDATA[orphan user]]></category>
		<category><![CDATA[SID]]></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[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3409</guid>

					<description><![CDATA[In this post, I am going to share one of the common error which is faced by most of the SQL Server DBA when they are migrating database from one server to another server. Error 15023: User already exists in the current database. This basically the problem of Orphan users, which exists as a Database [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F11%2Fsql-server-error-15023-user-already-exists-in-current-database-problem-of-orphan-user%2F&amp;linkname=SQL%20Server%3A%20Error%2015023%20User%20already%20exists%20in%20current%20database%20%28Problem%20of%20Orphan%20User%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%2F11%2Fsql-server-error-15023-user-already-exists-in-current-database-problem-of-orphan-user%2F&amp;linkname=SQL%20Server%3A%20Error%2015023%20User%20already%20exists%20in%20current%20database%20%28Problem%20of%20Orphan%20User%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%2F11%2Fsql-server-error-15023-user-already-exists-in-current-database-problem-of-orphan-user%2F&amp;linkname=SQL%20Server%3A%20Error%2015023%20User%20already%20exists%20in%20current%20database%20%28Problem%20of%20Orphan%20User%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%2F11%2Fsql-server-error-15023-user-already-exists-in-current-database-problem-of-orphan-user%2F&amp;linkname=SQL%20Server%3A%20Error%2015023%20User%20already%20exists%20in%20current%20database%20%28Problem%20of%20Orphan%20User%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%2F11%2Fsql-server-error-15023-user-already-exists-in-current-database-problem-of-orphan-user%2F&amp;linkname=SQL%20Server%3A%20Error%2015023%20User%20already%20exists%20in%20current%20database%20%28Problem%20of%20Orphan%20User%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%2F11%2Fsql-server-error-15023-user-already-exists-in-current-database-problem-of-orphan-user%2F&amp;linkname=SQL%20Server%3A%20Error%2015023%20User%20already%20exists%20in%20current%20database%20%28Problem%20of%20Orphan%20User%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%2F11%2Fsql-server-error-15023-user-already-exists-in-current-database-problem-of-orphan-user%2F&#038;title=SQL%20Server%3A%20Error%2015023%20User%20already%20exists%20in%20current%20database%20%28Problem%20of%20Orphan%20User%29" data-a2a-url="https://www.dbrnd.com/2016/11/sql-server-error-15023-user-already-exists-in-current-database-problem-of-orphan-user/" data-a2a-title="SQL Server: Error 15023 User already exists in current database (Problem of Orphan User)"></a></p><p>In this post, I am going to share one of the common error which is faced by most of the SQL Server DBA when they are migrating database from one server to another server. </p>
<blockquote><p>Error 15023: User already exists in the current database. This basically the problem of Orphan users, which exists as a Database Login, but no longer exists in Master Database.</p></blockquote>
<p>For example, I have migrated one database and user &#8220;dbrnd&#8221; exists in that database. In that new server, now I am going to create &#8220;dbrnd&#8221; login with assignment of that database.<br />
Which threw an error like user already exists in the current database. </p>
<p>The simple solution is to map SID between Database login and Master Login.<br />
<strong>Step 1: Identified orphaned users of your restored database. </strong></p>
<pre class="crayon-plain-tag">SELECT 
	[dp].[type_desc]
	,[dp].[SID]
	,[dp].[name] AS UserName
FROM sys.database_principals AS dp  
LEFT JOIN sys.server_principals AS sp  
    ON [dp].[SID] = [sp].[SID]
WHERE [sp].[SID] IS NULL  
    AND [dp].[authentication_type_desc] = 'INSTANCE';</pre> </p>
<p><strong>Step 2: Select any of that SID and try to find in sys.sql_logins table. If you do not find any match record, that user is orphaned.</strong></p>
<pre class="crayon-plain-tag">SELECT [sid] 
FROM sys.sql_logins;</pre> </p>
<p><strong>Step 3: Create manual login and map your missing SIDs:</strong></p>
<pre class="crayon-plain-tag">CREATE LOGIN Login4Orphaned 
WITH PASSWORD = 'test123*1',  
SID = 0x088232135A0AAF44A2D1B18DCC280E44;</pre> </p>
<p><strong>Step 4: Now, create user for this and a make your orphaned user as specific user:</strong></p>
<pre class="crayon-plain-tag">ALTER USER MyUser123 WITH Login = Login4Orphaned;</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
