Showing posts with label scheme. Show all posts
Showing posts with label scheme. Show all posts

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 exper
iencing database corruptions these days. Those database names just started looking suspicious to me.
I would greatly appreciate any insights or pointers.
Bing
The 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:

> 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...
> several different ways:
> 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.
>
>
|||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
|||Good points., Wayne. Just like you said, a disk drive just went belly up not long after I noticed a lot errors I've never seen in the SQL server logs.
Thanks,
Bing
"Wayne Snyder" wrote:

> 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...
> several different ways:
> 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.
>
>

inconsistent database naming scheme?

In my physical database directory, I found the databases were named in sever
al 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 pa
rts of a name? I do not remember how the names of these databases originall
y looked like. We're exper
iencing 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:

> 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 th
e
> database name as the first part of the file name. The remainder of the fi
le
> name is up to you. Personally, I add a number to make the file name uniqu
e
> 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...
> several different ways:
> and .ldf are generally standard suffix for database names. What about oth
er
> parts of a name? I do not remember how the names of these databases
> originally looked like. We're experiencing database corruptions these day
s.
> Those database names just started looking suspicious to me.
>
>|||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|||Good points., Wayne. Just like you said, a disk drive just went belly up no
t long after I noticed a lot errors I've never seen in the SQL server logs.
Thanks,
Bing
"Wayne Snyder" wrote:

> 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. G
et
> 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...
> several different ways:
> and .ldf are generally standard suffix for database names. What about oth
er
> parts of a name? I do not remember how the names of these databases
> originally looked like. We're experiencing database corruptions these day
s.
> Those database names just started looking suspicious to me.
>
>

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

Wednesday, March 7, 2012

Including Views in Replication

I have a three server peer-to-peer replication setup that includes articles for tables and views. As I understand the BOL, scheme changes -- which I take to mean changes, amont other things, changes in the design of a table or view -- should automatically replicate to the other servers in the topology. Here are my quesitons:

When including a view as part of the publication, what is it, exactly, that is getting replicated? If all the tables supporting a given view are being replicated, and the view exists on all three boxes, whatelse, besides the view schema (and changes thereto) is being replicated?

Secondly, if in fact schema changes are replicated, why can't I modify a view that is part of a publication? When I try to make a change to such a view, I get a server timeout message, every single time. When I remove the view from the publication, I can make the modification with no trouble. What does replicating schema changes mean if I can't make changes to the schema?

Thanks for any enlightenment on this.

Randy

In general, when views are replicated, the schema definition of the view object is actually what gets replicated. After initial sync, there are no data changes tied to a view.

In non-peer-to-peer transactional replication, view schema changes are propagated from the publisher to the subscribers automatically. i.e. A view schema change could be changing the list of columns included in the view select statement.

Since you have a peer-to-peer topology set up there are more restrictions to consider. Check out the General Considerations under Peer-to-Peer replication in SQL Server 2005 Books Online. One of the restrictions is that any schema changes require the peer-to-peer topology to be quiesced (stopping activity on published tables at all nodes and ensuring that each node has received all changes from all other nodes).

Hope this helps,

Tom

This posting is provided "AS IS" with no warranties, and confers no rights.

|||

the resultset and content of the view can only be replicated if it is "indexed" if the view is not index the only thing that gets replicated is the view definition.

|||

Hi Randy,

I am interested to know more about your second issue (timeout when modify a view). Could you give me more details on your issue? For example, what statement do you use to modify a view, what is the origional view definition and what is the error message?

Thanks,

Peng