<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3076701290557136267</id><updated>2024-09-05T20:46:49.512-07:00</updated><category term="Database backup tool"/><category term="SQL DBA General"/><category term="SQL DBA&#39;s Scripts"/><title type='text'>DBASearch</title><subtitle type='html'>This Blog is meant to help SQL DBAs.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dbasearch.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076701290557136267/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dbasearch.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>DBASearch</name><uri>http://www.blogger.com/profile/02393900283342221624</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/-aZybNwsp1j8/Tq7W6oYceRI/AAAAAAAACCA/4t-gf0DZRw8/s220/IMG_8717%2B-%2BCopy.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3076701290557136267.post-1442726957645550215</id><published>2012-05-08T04:29:00.001-07:00</published><updated>2012-05-31T21:21:28.558-07:00</updated><title type='text'>SQLCMD helps DBAs at the time of crisis</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;We do set default DB for logins other than master database in SQL server for security reasons. There is a scenario if default database gets offline or corrupts.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Suppose default database is XYZ that goes offline or corrupts then SQL does not allow connection to all logins those having XYZ as a default database. Because it tries to connect the default database first.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Thanks to SQLCMD that has a way to get in, using to -d switch&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;sqlcmd -S&amp;lt;servername&amp;gt; -d &amp;lt;Other_database_Name_ABC&amp;gt; -U&amp;lt;login&amp;gt; -P&amp;lt;password&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;It&amp;nbsp; is helpful in case we disable Built-In logins, SA and don&#39;t have choice of other logins to connect to SQL server. &lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbasearch.blogspot.com/feeds/1442726957645550215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dbasearch.blogspot.com/2012/05/change-default-db-using-sqlcmd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076701290557136267/posts/default/1442726957645550215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076701290557136267/posts/default/1442726957645550215'/><link rel='alternate' type='text/html' href='http://dbasearch.blogspot.com/2012/05/change-default-db-using-sqlcmd.html' title='SQLCMD helps DBAs at the time of crisis'/><author><name>DBASearch</name><uri>http://www.blogger.com/profile/02393900283342221624</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/-aZybNwsp1j8/Tq7W6oYceRI/AAAAAAAACCA/4t-gf0DZRw8/s220/IMG_8717%2B-%2BCopy.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076701290557136267.post-3185265020978772805</id><published>2011-10-30T09:10:00.000-07:00</published><updated>2012-04-24T20:59:31.762-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL DBA&#39;s Scripts"/><title type='text'>SQL Login locked out status check script</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;/*&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This script is designed to find the logins those are locked out in the database Server.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;It is tested to run on:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;SQL 2000 - NO (Login lock feature was not introduced in this SQL version)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;SQL 2005 - YES&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;SQL 2008 - YES&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;*/&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;set nocount on&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;declare&amp;nbsp; Cur_locked_login cursor for select name from master..syslogins order by name&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;declare @loginname nvarchar(100)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;open Cur_locked_login&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;fetch next from Cur_locked_login into @loginname&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;while @@FETCH_STATUS &amp;gt;= 0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;if (select LOGINPROPERTY(@loginname,&#39;islocked&#39;)) =1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;print &#39;Login -&amp;gt; &#39; + @loginname +&#39; is LOCKED&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;fetch next from Cur_locked_login into @loginname&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;close Cur_locked_login&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;deallocate Cur_locked_login&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbasearch.blogspot.com/feeds/3185265020978772805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dbasearch.blogspot.com/2011/10/sql-login-locked-out-status-check.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076701290557136267/posts/default/3185265020978772805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076701290557136267/posts/default/3185265020978772805'/><link rel='alternate' type='text/html' href='http://dbasearch.blogspot.com/2011/10/sql-login-locked-out-status-check.html' title='SQL Login locked out status check script'/><author><name>DBASearch</name><uri>http://www.blogger.com/profile/02393900283342221624</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/-aZybNwsp1j8/Tq7W6oYceRI/AAAAAAAACCA/4t-gf0DZRw8/s220/IMG_8717%2B-%2BCopy.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076701290557136267.post-8882312956180251233</id><published>2011-10-27T20:36:00.000-07:00</published><updated>2011-11-05T21:12:05.036-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL DBA General"/><title type='text'>Run SQLCMD from SQL 2008 management studio query window</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Microsoft embedded sqlcmd to run thru query-window. Now you can run SQLCMD without enabling xp_cmdshell from SQL management Studio. ( &lt;i&gt;As you know, it is risky to enable this surface area configuration parameter &lt;/i&gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;Open Management Studio -&amp;gt; Query -&amp;gt; SQLCMD Mode&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;Now, you can run a sqlcmd statements from a query window like below -&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;!!sqlcmd -S&amp;lt;ServerName&amp;gt; -E -Q&quot;select * from sysfiles&quot;&lt;/div&gt;&lt;br /&gt;
If you don&#39;t have a tool to run query against multiple database servers. No worries !! You can add your all database servers as a linked server in a server and run SQLCMD to query against multiple servers.&lt;br /&gt;
&lt;br /&gt;
If you have more than 50 servers, there are many SQL diagnosis tools are available in the market. I worked with idera multi query tool. It is easy to use. There are a lot other things can be done using this tool. You can get more details here -&lt;br /&gt;
&lt;a href=&quot;http://www.idera.com/Product-Tour/SQL-admin-toolset/SQL-Multi-Query/&quot;&gt;http://www.idera.com/Product-Tour/SQL-admin-toolset/SQL-Multi-Query/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbasearch.blogspot.com/feeds/8882312956180251233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dbasearch.blogspot.com/2011/10/run-sqlcmd-from-sql-2008-new-query.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076701290557136267/posts/default/8882312956180251233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076701290557136267/posts/default/8882312956180251233'/><link rel='alternate' type='text/html' href='http://dbasearch.blogspot.com/2011/10/run-sqlcmd-from-sql-2008-new-query.html' title='Run SQLCMD from SQL 2008 management studio query window'/><author><name>DBASearch</name><uri>http://www.blogger.com/profile/02393900283342221624</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/-aZybNwsp1j8/Tq7W6oYceRI/AAAAAAAACCA/4t-gf0DZRw8/s220/IMG_8717%2B-%2BCopy.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3076701290557136267.post-8865039221994704681</id><published>2011-10-27T12:04:00.000-07:00</published><updated>2011-10-27T21:04:50.722-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database backup tool"/><title type='text'>Database backup tool</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;SQL database BackupTool:&lt;br /&gt;
hyperbac is a tool to run the compressed SQL backups. It has feature to encrypt the backupfile. Why the encryption is required for backup !! In many organization there is policy to FTP the backup file and most of the customers now a days has mandate to provide encrypted backup file. In your organization you can refer this tool.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More important, hyperbac can be used to restore a single table from a backup file. You just need to have to create a LINKEDSERVER and you can fire query against object.&lt;br /&gt;
&lt;br /&gt;
You can check more details -&lt;a href=&quot;http://www.red-gate.com/products/dba/sql-hyperbac/&quot;&gt; http://www.red-gate.com/products/dba/sql-hyperbac/&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbasearch.blogspot.com/feeds/8865039221994704681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dbasearch.blogspot.com/2011/10/sql-basics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3076701290557136267/posts/default/8865039221994704681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3076701290557136267/posts/default/8865039221994704681'/><link rel='alternate' type='text/html' href='http://dbasearch.blogspot.com/2011/10/sql-basics.html' title='Database backup tool'/><author><name>DBASearch</name><uri>http://www.blogger.com/profile/02393900283342221624</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/-aZybNwsp1j8/Tq7W6oYceRI/AAAAAAAACCA/4t-gf0DZRw8/s220/IMG_8717%2B-%2BCopy.JPG'/></author><thr:total>0</thr:total></entry></feed>