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»»»

DBCC on a detached MDF file Expand / Collapse
Author
Message
Posted Wednesday, April 10, 2013 2:05 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, May 23, 2013 7:38 AM
Points: 12, Visits: 27
Hello,

I am by no means above a SQL novice, but I am trying to figure out if there is a way to run DBCC commands (DBCC fileheader in particular) on an offline/detached MDF? Is this possible? If so, any help pointing me in the right direction? Thank you!
Post #1441013
Posted Wednesday, April 10, 2013 2:57 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, July 3, 2014 4:00 PM
Points: 2,038, Visits: 1,663
Nope - not possible.

Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Post #1441036
Posted Wednesday, April 10, 2013 3:41 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 11:35 AM
Points: 33,102, Visits: 15,213
Is there some reason you cannot attach this to another instance? If it's because of possible corruption, please make sure you copy the MDF before attempting.

If you have potential data loss issues, please consider calling Microsoft CSS Support.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1441047
Posted Wednesday, April 10, 2013 3:45 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, May 23, 2013 7:38 AM
Points: 12, Visits: 27
Thanks! Well I'm trying to combine all of my results from a exec sp_msforeachdb 'dbcc fileheader(?)' into 1 table so I can just select 2 of the columns instead of all. If they have to be online, that is fine also. The end result, is to print 2 of these columns into a document of some sort... Any ideas from any of you? Thanks for the replies!
Post #1441049
Posted Wednesday, April 10, 2013 3:48 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, July 3, 2014 4:00 PM
Points: 2,038, Visits: 1,663
What data are you trying to gather from that? There may be an easier way to do it.

Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Post #1441054
Posted Thursday, April 11, 2013 5:07 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, May 23, 2013 7:38 AM
Points: 12, Visits: 27
I need to pull the logicalname and bindingid fields from fieldheader on multiple DBs, and place them in a text file. It looks like Windows Powershell might be able to do that too... What was your idea?
Post #1441184
Posted Thursday, April 11, 2013 12:59 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, July 3, 2014 4:00 PM
Points: 2,038, Visits: 1,663
Hmm - no other way to get those AFAIK. I was hoping you were after some information that was stored in master for each database.

Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Post #1441445
Posted Thursday, April 11, 2013 1:28 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, May 23, 2013 7:38 AM
Points: 12, Visits: 27
Thanks! Is there a way to compile all of the msforeachdb dbCC fileheader results into 1 page with just those 2 columns (I can't figure out how to do a select from dbcc fileheader), then write to the tempdb, then export that to a CSV?
Post #1441461
Posted Thursday, April 11, 2013 2:07 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, July 3, 2014 4:00 PM
Points: 2,038, Visits: 1,663
Create a temp table and then INSERT into the table EXEC (string variable with the DBCC fileheader command in).

Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Post #1441471
Posted Thursday, April 11, 2013 2:38 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, May 23, 2013 7:38 AM
Points: 12, Visits: 27
Hmm, does that work with sp_msforeachdb? It's not liking what I'm putting in... Thank you for all the help!!!
Post #1441477
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse