Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Windows Utilities for the SQL Server DBA Expand / Collapse
Author
Message
Posted Tuesday, August 29, 2006 2:02 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, November 24, 2014 2:02 PM
Points: 259, Visits: 716
Comments posted to this topic are about the content posted at temp


Post #304813
Posted Thursday, September 7, 2006 2:35 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, March 20, 2007 12:30 PM
Points: 24, Visits: 1

Thank you Chad!

 

I liked the DELETE script for files. I was looking for the code for a long time. I had also posted it in forums. But could NOT get the code.

 

Can anyone tell me from where can I download forfiles.exe? I don’t have win2003 environment.

 

Post #306826
Posted Thursday, September 7, 2006 3:06 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, October 24, 2014 6:42 AM
Points: 438, Visits: 1,260
WOW! extremely usefull contribution - TX Chad!
This will save myself hours of work every month...




What's this "backup strategy" everyone is on about?

Post #306832
Posted Thursday, September 7, 2006 3:36 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, March 20, 2007 12:30 PM
Points: 24, Visits: 1

Downloaded forfiles.exe!

 

Found some changes in following command ( I am using v 1.1 forfiles.exe),

for %I in (TRN sqb bak) do FORFILES /S /D -2 /M *.%I /C "cmd /c del @file"

 --  @file is case sensitive, it should be @FILE

 --  Better to use properties with “-“ tag than “/” because 

     forfiles.exe behaves differently with –M and /M

 -- If you want a include the command in a .bat file, then replace %

     with %%

 

Post #306839
Posted Thursday, September 7, 2006 4:36 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, November 12, 2014 3:27 PM
Points: 66, Visits: 537

Good one

Not just for 'new SQL Server DBAs'

Post #306847
Posted Thursday, September 7, 2006 5:07 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Saturday, July 12, 2014 6:44 AM
Points: 441, Visits: 1,799

I fully agree with all of the above.  cmd scripts, or batch files if you are 'old' school, still can be enormously useful.

Here's a tip I use from time to time if you cannot connect to a SQL server and you don't have TS Administrator handy.

Killing a TS Session via Query Analyser

Occasionally all the available connections will be used up. If you have Terminal Services Manager loaded you can easily close down a connection. If you don't (the case on my XP machine at home), Brian Knight pointed out a very nice trick you can use if it's a SQL box. To get all the active sessions, open Query Analyzer and run this:

master..XP_CMDSHELL 'QUERY SESSION'

-- You'll get back a resultset containing sessionname, username, id, and state. Pick the sessin ID of the connection you want to kill, then run this:

master..XP_CMDSHELL 'logoff sessionid'

If you get back a single row containing null, it worked and you should be able to get a connection.

Dave Jackson



http://glossopian.co.uk/
"I don't know what I don't know."
Post #306851
Posted Thursday, September 7, 2006 7:15 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, August 8, 2007 2:25 PM
Points: 53, Visits: 1

I am looking for a replacement for ping, ideally it will do a continuous ping and keep a running tally of the longest n number of ping times.

C:\WINDOWS>ping www.yahoo.com -t

Pinging www.yahoo-ht2.akadns.net [209.73.186.238] with 32 bytes of data:

Reply from 209.73.186.238: bytes=32 time=20ms TTL=50
Reply from 209.73.186.238: bytes=32 time=20ms TTL=50
Reply from 209.73.186.238: bytes=32 time=20ms TTL=50
Reply from 209.73.186.238: bytes=32 time=20ms TTL=50
Reply from 209.73.186.238: bytes=32 time=20ms TTL=50
Reply from 209.73.186.238: bytes=32 time=20ms TTL=50
Reply from 209.73.186.238: bytes=32 time=19ms TTL=50

...

or maybe I should just write a script with a loops?

Any thoughts...

 

Post #306899
Posted Thursday, September 7, 2006 7:38 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Sunday, December 14, 2014 1:27 PM
Points: 604, Visits: 1,727

I'm going to take a slightly different approach in my comment here. Yes these are great utilities.  What I would like to know is how many people acting as DBAs ( whether formally or not ) actually have local administrator or even domain administrator type rights.

In my case, and I suspect in many small to mid-size companies adopting sql server, the DBA role hasn't been formalized and many of us can only execute commands such as these if logged into a query window as sysadmin -- in other words you are doing xp_cmdshell work as if you were the sql service.

In my case I'm beginning to wonder if it's worth even pursuing this role until it is recognized that DBA work typically requires some form of administrator rights.   You wind up with a situation where the systems group has the rights, but no knowledge of or desire to administer sql server, and others with knowledge and desire, but no rights other than sql sysadmin.

Picture fixing an out of sync log shipping plan by doing DOS commands via xp_cmdshell.

 

 




Post #306919
Posted Thursday, September 7, 2006 8:06 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, March 20, 2007 12:30 PM
Points: 24, Visits: 1

This is another good tip. Thank you Dave !

Post #306946
Posted Thursday, September 7, 2006 12:03 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, December 16, 2014 1:37 PM
Points: 127, Visits: 553

Chad,

Great Stuff!

Thanks,




Post #307054
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse