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

DB File Extension Expand / Collapse
Author
Message
Posted Monday, February 4, 2013 2:04 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 1:35 PM
Points: 96, Visits: 255
I noticed that one database file does not have an extension and the type is just File. I have an M:\ partition and when I look at the database files one just has the name and no .mdf extension. The file type is File. There are other .mdf files in the same folder and they are listed with the extension and type is SQL Server Database Primary Data File.

Also in the properties of the database under File Name it just shows the name and no extension.

Please let me know what I should do to correct this. Not sure if just renaming the file ABSdatabase.mdf will work without the database being detached or something. If I do rename the file with the extension are there any risks

Your help is appreciated


Jeff
Post #1415488
Posted Monday, February 4, 2013 2:07 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 8:18 PM
Points: 17,824, Visits: 15,756
You can leave the extension off if you wish. I wouldn't recommend it but it does work.

To rename it, detach perform the file rename and then reattach is what I would do.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1415489
Posted Monday, February 4, 2013 2:27 PM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:38 AM
Points: 5,879, Visits: 13,010
my preferred method would be the alter database command

ALTER DATABASE yourdb
(
NAME = logicalfilename,
FILENAME = N'c:\t1dat2.mdf' --for example
);


then offline the database, actually rename the physical file and online the database again.

take a backup first whatever way you do it!

(backup\restore with move is in fact another option)


---------------------------------------------------------------------

Post #1415497
Posted Monday, February 4, 2013 2:37 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 8:18 PM
Points: 17,824, Visits: 15,756
george sibbald (2/4/2013)
my preferred method would be the alter database command

ALTER DATABASE yourdb
(
NAME = logicalfilename,
FILENAME = N'c:\t1dat2.mdf' --for example
);


then offline the database, actually rename the physical file and online the database again.

take a backup first whatever way you do it!

(backup\restore with move is in fact another option)


If this is a SQL 2008 database server, I'd go that route too.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1415500
Posted Monday, February 4, 2013 3:37 PM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:38 AM
Points: 5,879, Visits: 13,010
works from 2005 up Jason.

---------------------------------------------------------------------

Post #1415515
Posted Monday, February 4, 2013 3:42 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 8:18 PM
Points: 17,824, Visits: 15,756
Yup. I always did the detach in 2005 after a bad experience. But yup - the syntax is supported in 2005. I don't recall the specifics of the bad experience.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1415516
Posted Tuesday, February 5, 2013 9:17 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 1:35 PM
Points: 96, Visits: 255
Thank you very much for the help.

Jeff


Jeff
Post #1415935
Posted Tuesday, February 5, 2013 9:20 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 8:18 PM
Points: 17,824, Visits: 15,756
jayoub1 (2/5/2013)
Thank you very much for the help.

Jeff


You're welcome.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1415938
Posted Tuesday, February 5, 2013 9:21 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:38 AM
Points: 5,879, Visits: 13,010
ditto

---------------------------------------------------------------------

Post #1415941
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse