Friday, March 9, 2012

inconsistent database naming scheme?

In my physical database directory, I found the databases were named in several different ways:
1. db1.mdf
db1.ldf
2. db2_Data.MDF
db2_Log.LDF
3. db3.mdf
db3_Log.LDF
4. msdbdata.mdf
msdblog.ldf
5. model.mdf
modellog.ldf
How could this happen? I read the online books and just found that .mdf and .ldf are generally standard suffix for database names. What about other parts of a name? I do not remember how the names of these databases originally looked like. We're experiencing database corruptions these days. Those database names just started looking suspicious to me.
I would greatly appreciate any insights or pointers.
BingThe names of the files has absolutely nothing to do with corruption in the
database. Usually corruption is the result of faulty hardware these days.
The only standard per say for data files is the Primary data file has an
extension of .mdf and any secondary ones have an extension of .ndf and of
coarse Log files are .ldf.
--
Andrew J. Kelly SQL MVP
"bing" <bing@.discussions.microsoft.com> wrote in message
news:17493040-675C-432A-8D95-F845EDB7A4C1@.microsoft.com...
> In my physical database directory, I found the databases were named in
several different ways:
> 1. db1.mdf
> db1.ldf
> 2. db2_Data.MDF
> db2_Log.LDF
> 3. db3.mdf
> db3_Log.LDF
> 4. msdbdata.mdf
> msdblog.ldf
> 5. model.mdf
> modellog.ldf
> How could this happen? I read the online books and just found that .mdf
and .ldf are generally standard suffix for database names. What about other
parts of a name? I do not remember how the names of these databases
originally looked like. We're experiencing database corruptions these days.
Those database names just started looking suspicious to me.
> I would greatly appreciate any insights or pointers.
>
> Bing|||> How could this happen?
Physical database file names can be any legal file name supported by your
file system:
CREATE DATABASE MyDatabase
ON(NAME='MyDatabase', FILENAME='C:\ICanNameThisAnything.abcde')
LOG ON(NAME='MyDatabase_Log', FILENAME='C:\ICanNameThisAnythingToo.defgh')
Andrew noted the suggested suffixes and it's a good practice to specify the
database name as the first part of the file name. The remainder of the file
name is up to you. Personally, I add a number to make the file name unique
and also include the filegroup name for files in user-defined filegroups.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"bing" <bing@.discussions.microsoft.com> wrote in message
news:17493040-675C-432A-8D95-F845EDB7A4C1@.microsoft.com...
> In my physical database directory, I found the databases were named in
several different ways:
> 1. db1.mdf
> db1.ldf
> 2. db2_Data.MDF
> db2_Log.LDF
> 3. db3.mdf
> db3_Log.LDF
> 4. msdbdata.mdf
> msdblog.ldf
> 5. model.mdf
> modellog.ldf
> How could this happen? I read the online books and just found that .mdf
and .ldf are generally standard suffix for database names. What about other
parts of a name? I do not remember how the names of these databases
originally looked like. We're experiencing database corruptions these days.
Those database names just started looking suspicious to me.
> I would greatly appreciate any insights or pointers.
>
> Bing|||Thanks for the information.
Bing
"Dan Guzman" wrote:
> > How could this happen?
> Physical database file names can be any legal file name supported by your
> file system:
> CREATE DATABASE MyDatabase
> ON(NAME='MyDatabase', FILENAME='C:\ICanNameThisAnything.abcde')
> LOG ON(NAME='MyDatabase_Log', FILENAME='C:\ICanNameThisAnythingToo.defgh')
> Andrew noted the suggested suffixes and it's a good practice to specify the
> database name as the first part of the file name. The remainder of the file
> name is up to you. Personally, I add a number to make the file name unique
> and also include the filegroup name for files in user-defined filegroups.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "bing" <bing@.discussions.microsoft.com> wrote in message
> news:17493040-675C-432A-8D95-F845EDB7A4C1@.microsoft.com...
> > In my physical database directory, I found the databases were named in
> several different ways:
> >
> > 1. db1.mdf
> > db1.ldf
> >
> > 2. db2_Data.MDF
> > db2_Log.LDF
> >
> > 3. db3.mdf
> > db3_Log.LDF
> >
> > 4. msdbdata.mdf
> > msdblog.ldf
> >
> > 5. model.mdf
> > modellog.ldf
> >
> > How could this happen? I read the online books and just found that .mdf
> and .ldf are generally standard suffix for database names. What about other
> parts of a name? I do not remember how the names of these databases
> originally looked like. We're experiencing database corruptions these days.
> Those database names just started looking suspicious to me.
> >
> > I would greatly appreciate any insights or pointers.
> >
> >
> > Bing
>
>|||Additionally, if you are getting corruptions..
Ensure you are running your dbccs and watching them closely. corruption is
generally a preview for an upcoming ( but now transient) hardware error. Get
your hardware guys involved and check the disks, controllers, etc.
You may wish to keep your database backups a little longer until you have
found the problem and corrected it...You do not want to get into a
situation where all of your database backups are copies of a corrupted
database
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"bing" <bing@.discussions.microsoft.com> wrote in message
news:17493040-675C-432A-8D95-F845EDB7A4C1@.microsoft.com...
> In my physical database directory, I found the databases were named in
several different ways:
> 1. db1.mdf
> db1.ldf
> 2. db2_Data.MDF
> db2_Log.LDF
> 3. db3.mdf
> db3_Log.LDF
> 4. msdbdata.mdf
> msdblog.ldf
> 5. model.mdf
> modellog.ldf
> How could this happen? I read the online books and just found that .mdf
and .ldf are generally standard suffix for database names. What about other
parts of a name? I do not remember how the names of these databases
originally looked like. We're experiencing database corruptions these days.
Those database names just started looking suspicious to me.
> I would greatly appreciate any insights or pointers.
>
> Bing

No comments:

Post a Comment