Archive

Archive for the ‘General’ Category

using progress Bar in powershell

March 8, 2015 Leave a comment

Hey all ,

I was looking for an way to pop up an progress BAR for an ongoing progress within an POWERSHELL script ..

figured out powershell inheritably provide an inbuilt cmdlet for doing the same .

Command ::

write-progress

for detailed help and examples on this command use below cmdlet

## get-help

  get-help write-help -full | more

 

Example ::

for ($i = 1; $i -le 100; $i++ )

{

get-process

write-progress -activity “Search in Progress” -status $i% Complete:” -percentcomplete $i;}

 

Example for 2 bars ::

for ($i = 1; $i -le 100; $i++ )

{

get-process

write-progress -activity “Search in Progress” -status $i% Complete:” -percentcomplete $i -CurrentOperation “outerloop” ;

for ($j = 1; $j -le 100; $j++ )

{

get-process

write-progress -Id 1 -activity “Search in Progress” -status $j% Complete:” -percentcomplete $j -CurrentOperation “innerloop”;

}

}

 

progress Bar

Categories: General, Powershell

Database Page Basics

December 27, 2013 Leave a comment

Hi all,

i was looking for a some basics to find out to which Table a particular page belongs to ..

Found below you tube Channel which covered everything i was looking for

check out the link and subscribe to the same ..   SQLpassion by  Klaus Aschenbrenner 

 you will cover below basics if you try out the example yourself ,

1>basic Database  PAGE Structure  and how to use DBCC IND , DBCC PAGE  and DBCC TRACEON(3604)

2> how the table partition and allocation units are related each other

3> what are different types of Allocation units  i.e in row ,LOB and row over-flow data

   Please try the example as you go through the the links 

   1 

   2

3

4

Enjoy 🙂

Could not find database ID 2, name ‘tempdb’. The database may be offline

September 14, 2013 Leave a comment

 

 

 

one of my SQL server .. has been logging in ERRORS related to Tempdb been unavailable during Startup and after few seconds everything

 

seems to be working fine .. i assumed that its related to drives holding the TempDB was going offline or it was not accessible when the SQL

 

was coming online .. below is the error message 

 

ERROR :

 

013-09-10 06:36:22.850 spid55 Could not find database ID 2, name ‘tempdb’. The database may be offline. Wait a few minutes and try again. 2013-09-10 06:36:22.980 spid9s Starting up database ‘tempdb’.

 

After some time the SQL would recover normally .. without any furthur errors or similar messages 

 

Solution :

 

i figured out that this is a known issue and does occur in SQL 2000 and 2005 (could also be a possiblity in higher versions too)

 

below is what is causing this 

 

Application like  Biztalk or web Farm keep trying to connect to SQL every second while the sql is starting up .. 

 

and they try to Create objects in tempdb .. from the very go … as TEMPDB is been refreshed and not accessible  above mentioned messages

 

are logged in SQL error log .. (which can lead to DBA’s looking for reason from drive prespective)

 

–> i have used TRACE FLAG 3614 to cause the SSNETLIB.dll (SQL server network library) to be loaded only after successful recovery of

 

system databases and hance above messages are not logged in SQL error log .. 

 

refer : http://support.microsoft.com/kb/834798

 

 

 

load test you SQL server CPU

August 24, 2013 Leave a comment

Hey There ..

                      I found 2 great CPU load testing tools .. that you can use to run heck your SQL server CPU ..

                      here’s what I got from them (download it from below link )

                       http://www.primatelabs.com/geekbench/

                     GEEKBENCH 3 can be downloaded from above link .. and below are some of the test it run against the CPU and

                      memory .. the results are very detailed and easy to consume ..

Geekbench_1

                       once you start the benchmark test .. you will see different load been put on CPU and memory ..

Geekbench_2

                       you will observer .. that CPU and memory are going over the roof .. and wish to figure out other ways to do

                       the  same …

Geekbench_3                    the results are informative about what is and what counter and numbers our server resources have hit

Geekbench_4

                     the 2nd great tool .. that we will discuss is available for download from below link ..

                     http://www.cpuid.com/softwares/cpu-z/versions-history.html

                    once you are done with download .. and get it installed .. you will get a screen similar to below ..

CPU-Z_2

the different tabs on above screen cover all aspect of processor .. that you would be interested in finding out ..

so enjoy and play around with these free tools and spread the word ..

Thanks for reading .. 🙂

bonus video by

Understanding CPU Specifications DalePoston

great whitepapers on Contention in SQL Server

August 24, 2013 1 comment

 

Hey .. Check out 2 great whitepapers on contention in SQL SERVER ..

 

Diagnosing and Resolving Latch Contention on SQL Server

 

http://sqlcat.com/sqlcat/b/whitepapers/archive/2011/07/05/diagnosing-and-resolving-latch-contention-on-sql-server.aspx

 

Diagnosing and Resolving Spinlock Contention on SQL Server

 

http://sqlcat.com/sqlcat/b/whitepapers/archive/2011/07/05/diagnosing-and-resolving-spinlock-contention-on-sql-server.aspx

Enjoy 🙂

 

multi-threading is for computers,but human are single-threaded and will be

August 2, 2013 Leave a comment

Check out a great post by Thomas Larock about why to FOCUS on single-task at time .. to really getting it done ..

why we should switch off social technology to focus on our most critical projects ..

“To do two things at once is to do neither.” – Publilius Syrus

read the whole blog on below link …

http://thomaslarock.com/2013/08/whats-the-biggest-mistake-you-make-each-day/

ENJOY:)

error while Creating an instance of the COM component with CLSID {AA40D1D6-CAEF-4A56-B9BB-D0D3DC976BA2}

July 12, 2013 1 comment

Hi There ,

got below error while trying to EDIT a job which .. i have created and edited few times earlier..

EDIT_JOB_Failure
COMPLETE Error –> TITLE: Microsoft SQL Server Management Studio
——————————

Creating an instance of the COM component with CLSID {AA40D1D6-CAEF-4A56-B9BB-D0D3DC976BA2} from the IClassFactory failed due to the following error: c001f011. (Microsoft.SqlServer.ManagedDTS)

——————————
ADDITIONAL INFORMATION:

Creating an instance of the COM component with CLSID {AA40D1D6-CAEF-4A56-B9BB-D0D3DC976BA2} from the IClassFactory failed due to the following error: c001f011. (Microsoft.SqlServer.ManagedDTS)

——————————
BUTTONS:

OK
——————————

it turns out that few people already faced this issue and reported on below connect linK

http://connect.microsoft.com/SQLServer/feedback/details/557402/ssms-can-no-longer-create-or-edit-job-steps

My SSMS and Shared features as below ::

Microsoft SQL Server Management Studio 10.50.1617.0
Microsoft Analysis Services Client Tools 10.50.1617.0
Microsoft Data Access Components (MDAC) 3.85.1132
Microsoft MSXML 2.6 3.0 4.0 5.0 6.0
Microsoft Internet Explorer 8.0.6001.18702
Microsoft .NET Framework 2.0.50727.3634
Operating System 5.1.2600

Solution : Try any one of the below workaround as your environment permits (as no single one has worked for all)

(Restarting the SSMS is what works as the first solution … but as we may have few scripts already typed in SSMS .. we would prefer a longer fix)

1> Run your SSMS as administrator

2> disable UAC

3> if on SQL2008 .. then install SP3

4> if using SQL 2008 R2 .. then install SP1

refer post :: http://blogs.msdn.com/b/sqlagent/archive/2012/01/20/fix-ssms-can-no-longer-create-or-edit-job-steps-creating-an-instance-of-the-com-component-with-clsid-aa40d1d6-caef-4a56-b9bb-d0d3dc976ba2-from-the-iclassfactory-failed.aspx

related post :: http://support.microsoft.com/kb/2315727/en-us

hope this is helpful to you 🙂