Showing posts with label documentation. Show all posts
Showing posts with label documentation. Show all posts

Sunday, March 25, 2012

Database files free space (SQL Server 2005)

Dear friends

I need to report the amount of free space in each datafile of a database.

I have tried sys.dm_db_file_space_usage , but the documentation says that it only works for the TempDB.

Please help.

Regards

Parviz

Take a look at the sp_spaceused text. You should be able to derive from there.

exec sp_helptext 'sp_spaceused'|||

Thanks for the fast reply, but please note that sp_spaceused returns the free space for the whole database files including the LOG file. I need the info fo each file in a database seperately.

If you have a look at summary reports for a database (SQL 2005 SSMS),you would see a table and a pie chart showng the status for each file.

Thanks again.

Parviz

|||Yup. sp_spacedused can be used to get the data file usage. You can then use 'dbcc sqlperf(logspace)' to get the log usage.|||

Here's some code, cribbed from a sqldbatips report designed to mimic the taskpad in SSMS. (http://sqlblogcasts.com/blogs/sqldbatips/archive/2006/11/21/custom-ssms-reports-in-sp2-enterprise-manager-taskpad-view.aspx). All I did was add some code to show the amount free. Seems to work well. Posting here because this was one of the top results in Google when I went looking for code myself.

create table #data(Fileid int NOT NULL,

[FileGroup] int NOT NULL,

TotalExtents int NOT NULL,

UsedExtents int NOT NULL,

[Name] sysname NOT NULL,

[FileName] varchar(300) NOT NULL)

create table #log(dbname sysname NOT NULL,

LogSize numeric(15,7) NOT NULL,

LogUsed numeric(9,5) NOT NULL,

Status int NOT NULL)

insert #data exec('DBCC showfilestats with no_infomsgs')

insert #log exec('dbcc sqlperf(logspace) with no_infomsgs')

select [type], [name], totalmb, usedmb, totalmb - usedmb as EmptySpace from

(

select 'DATA' as [Type],[Name],(TotalExtents*64)/1024.0 as [TotalMB],(UsedExtents*64)/1024.0 as [UsedMB]

from #data

union all

select 'LOG',db_name()+' LOG',LogSize,((LogUsed/100)*LogSize) from #log where dbname = db_name()

--order by [Type],[Name]

)a

order by [Type],[Name]

drop table #data

drop table #log

|||

This will work for you:

-- Individual File Size query

SELECT name AS 'File Name' , physical_name AS 'Physical Name', size/128 AS 'Total Size in MB',

size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS 'Available Space In MB', *

FROM sys.database_files;

Wednesday, March 21, 2012

Database Environment Naming Production -vs- Development

I have been looking for some documentation that would support or reject
my opinion on Production -vs- Development naming conventions. I
believe that each environment should be housed on separate servers with
identical names, access, users, stored procs...... If you either
agree or disagree with this methodology, I would appreciate your input.

TIA,
BillWith the same access? In most situations I don't want developers to
have the same access to production as they have in development. I
pretty much never want my users to have access to development either.

Other than that, I would agree. I think that every item that you have
to change between development and production is one more item that may
get you when moving changes from development to production.

In my environments I usually have a QA or testing server as well. This
one will more closely mirror production so that moving changes from QA
to production involves no manual changes at all - everything is
automated. This helps to ensure that no unforeseen bugs get moved into
production as the result of an errant upgrade script. The upgrade
scripts are run on QA, which is identical to production at the start
(often synchronized by a backup/restore unless the data is sensitive or
too large for the QA server). If the upgrade scripts work successfully
on QA and testing the changes is successful then confidence is pretty
high that they will work correctly in production.

HTH,
-Tom.|||I agree with Thomas. You cannot / should not test on a Dev server. So
you need at least three environments as near identical as possible.
Developers don't get access to Production except to troubleshoot a
problem that you can't repro elsewhere (unfortunately that happens).

--
David Portas
SQL Server MVP
--|||Thank you all for your responses.
And the access does change for Developers, we grant SELECT access to
view potential data issues and we also have Production control to move
both Databases and Interface methods (Executables and Web) from
Development to Production. There has been a desire to create a three
tier type environment, as we cycle out Production equipment I am keeping
it for the Development environments, so in another year or so I should
have the equipment for the 'QA' level.

Thanks again,
Bill

*** Sent via Developersdex http://www.developersdex.com ***|||Bill Willyerd (bwillyerd@.dshs.wa.gov) writes:
> I have been looking for some documentation that would support or reject
> my opinion on Production -vs- Development naming conventions. I
> believe that each environment should be housed on separate servers with
> identical names, access, users, stored procs...... If you either
> agree or disagree with this methodology, I would appreciate your input.

If we were do that in our shop, we would have to have a load of servers!

More generally, it depends on what your situation is. The above could
be a good idea for in-house applications, where there is exactly one
production server. (We develop a product, and we have one development
environment and one test environment for each customer and for each
version in production, test and development. That's a lot of databases.)

I would say that the key point is that you have separate servers.
Testing on a second database on the production machine can lead
unpleasant incidents, because test reveals a query with a poor query
plan.

Wether the database should have the same name? Of course, it helps,
but what if you need more than one testing environment? One of our
customers at one point had 3-4 test databases, all for our application.
I can reveal that they did not have four test servers. Thus, it is a
good idea to make it easy to switch database in the application.

As for the same stored procedures etc, this is best achieved by having
a version-control system as the definition of your system.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Hi

If your servers have identical names then they can not be on the same
network!!

John

"Bill Willyerd" <bwillyerd@.dshs.wa.gov> wrote in message
news:1114176300.794189.215830@.g14g2000cwa.googlegr oups.com...
>I have been looking for some documentation that would support or reject
> my opinion on Production -vs- Development naming conventions. I
> believe that each environment should be housed on separate servers with
> identical names, access, users, stored procs...... If you either
> agree or disagree with this methodology, I would appreciate your input.
> TIA,
> Bill

Monday, March 19, 2012

Database Documenter

Does SQL Server 2000 have a documentation tool similar to the one in
MSAccess?
Any help is greatly appreciated.
Consider WT3 - one of the SQL Server Tools applications...
http://www.sqlservertools.us
It may do what you are asking for, as well as a lot more.
"Greg Smith" wrote:

> Does SQL Server 2000 have a documentation tool similar to the one in
> MSAccess?
> Any help is greatly appreciated.
>
>

Database Documentation is important

Hi
As a project manager,
=B7 Do you have an up-2-date overview of the database structure?
=B7 What will you do when your database administrator leaves your
company?
=B7 Are you willing to pay extra hours to update the database
information?
As a developer,
=B7 Do you spent too much hours on writing boring database
documentation?
=B7 Are you tired of not having the latest DB-information?
More info on www.dbmanual.com and download the free evaluation version.
FrederikI took a look at your live demo, and it seems to offer no advantages over
just browsing a database in Enterprise Manager. Explain the "documentation"
aspect of it.
<frederik@.dbmanual.com> wrote in message
news:1140473260.871832.218700@.g14g2000cwa.googlegroups.com...
Hi
As a project manager,
Do you have an up-2-date overview of the database structure?
What will you do when your database administrator leaves your
company?
Are you willing to pay extra hours to update the database
information?
As a developer,
Do you spent too much hours on writing boring database
documentation?
Are you tired of not having the latest DB-information?
More info on www.dbmanual.com and download the free evaluation version.
Frederik

Database Documentation

Please advise me of any tools that are available that allow to create a data dictionary of a SQL 2000 database into either Microsoft Word or Excel.

Bill Partridge

you can use visio i think

Database Documentation

Hi guys, my manager asked me that to do documentation; right now we are using MSSQL SERVER 2005 Databases, here you assume I am new to make documents on any database but good idea about databases currently that data warehouse in development environment need to done this documentation before go on test environment . So that way you advise me to prepare a document.

Here is my main concerned how to start and what things should we keep in mind while preparing document (what are measurements).if you any prepared documents could help to start or there tool we should use (power point) them. any help appreciated

Things to include in DB documentation, and some suggested sources:

1.Server where DB is implemented; SQL Server version used, and required (for example SQL 2005 SP1 because of fix to XXX).

2.Database design - in an ideal world, you should have a ERD for a

database design before the database was created. This may have been

done in an external tool like ERWin, Rational Rose, PowerDesigner etc.

etc. You can also use the Database Diagram tool in Enterprise manager

(sql 2000, not sure about SQL 7.0) or SQL Server Management Studio

(SQL2005) to create these diagrams. The physical DB model (or

design, or ERD, - whatever your preferred name), is, imho, the single

most important piece of documentation about a database;

3. Volumetrics - this is a field on it's own, and one that is often

largely ignored (until a problem occurs!). This is about predicting the

sizing of a database, so as to ensure that the production server has

sufficient capacity when initially created, and sufficient space during

the database life. Since space addition can be a difficult/time

consuming activity (for example, ordering disks, taking server off-line

to add them, or getting drives purchased and added to a SAN and

allocated to the LUNs for you server, if you have a SAN), you really

want to know how much space you need, and when you are going to need

more. There are 2 large sections to this: predictions based on

assumptions, and forecasts made on trend analysis.

- predictions are done during design and creation phase. For example,

the business should have some kind of idea about the viability of a

system. In that, they would, hopefully, have some kind of expectations

regarding usage - for example: We expect 2000 orders a day, typically

of an average of 13.5 products. That already tells us we can expect

2000 rows in our order table, on a daily basis, and 27000 rows in the

OrderItem table. Extrapolation that further, based on 21*12 working

days a year, and we have a prediction of 504 000 rows in the order

table at year end, and 6 804 000 rows in the OrderItem table. This kind

of information can be used to generate an estimated size for the

database, so we can ensure that the database will have enough space on

the brand new server the business bought

- forecasts are done on an on-going basis and are a pro-active measure

by the DBAs in production to determine real growth of a database. So,

after the first month, for example, the dba's note that the ORder table

has 60000 entries, and the Orderitem table has 900 000 rows. Based on

that, they can forecast that the year end sizes will now be 720 000

order rows, and 10 800 000 OrderItems. The goods news is that the

business is doing 42% more orders, at that point in time, that

predicted (see the prediction above), and has sold 58% more Items. They

can use the extra money to buy some disk space, because the forecast

says that at 60000 order per month, the DB is going to be the size that

was predicted for year-end, after less than 9 months (9*60000 = 540 000

> 504 000, for example).

I haven't covered a discussion about the increase in volumes on the

underlying server resources (for example, are the batch jobs able to

finish processing within the agreed SLA's, now that we are doing 2857

orders per day? Do we have periods where this causes excessive load on

the server? These things are NOT (imho) part of a DB document, but they

do flow out of the forecasts that are being done. A final comment on

forecasts above is that, when they are done regularly, you can also do

trend analysis - this is use for technical people - for example, orders

are growing by 10% each month, so in fact that 9 month prediction is

too far away - it needs to be earlier

(60000+66000+72600+79860+87846+96630.6+106293.66=569230 after 7 months).

4. Access - who needs access, to what. For example, Users required, and

which stored procedures they need to execute. Hopefully, there is

little of no dorect table access, but that can also be listed. This can

be done in a matrix in excel:

User -> UserA UserB

Object
TableA - S

TableB - -

SP_1 - Ex

SP_2 - Ex

SP_3 Ex ExGr

SP_4 Ex -

And a key that defines the meanings:

S = Select (D=Delete,U=Update,I=Insert)

Ex = Execute

ExGr = Execute with Grant

etc. etc. These are examples - create as seems relevant.

5. Maintenance. what is the DRP strategy - do you have off-site

backups, how often, are they tested? Do you do regular maintenance (db

indexdefrag's etc) and if so, are they maintenance plans, or specific

jobs?

depending on the target audience for the document (for example someone

using it to rebuild servers in a disaster), you could consider adding

reference to the Source Control system, so that if the database needs

to be rebuilt, they know where to get relevant code.

hmm - well that was off the top of my head. Hopefully it gives you a

good palce to start. I'd be interested to see the additional items

other people suggest.|||

You might want to check out SqlSpec. It will generate documentation for any SQL 2000 or 2005 database. It's very reasonably priced at $50, a fraction of other data dictionary software out there.

see www.elsasoft.org for more info.

|||Interesting. It does seem quite useful and covers much of what I listed|||

You might be interested in checking out dbdesc as well. This tool documents SQL Server databases and you can fully customize its reports as it uses XSL templates to generate the final files. It has built-in templates to generate Word 2003, RTF, HTML, XML and PDF reports.

It was reviewed by Mike Gunderloy (Larkware News) here.

|||

Hi, Geth. Have you gotten everything you need on this subject? If so, you can close the thread, if not, let us know and we'll try to give you some more help.

Buck Woody

|||ERm. I'm happy, but I wasn't the thread starter. Can I cl,ose someone else's thread?|||

You're right! My bad. I'm not sure if you can mark it "happy" or not. I'll ask the right person this time...

|||

Hello - did you get everything you needed? I have some more info on building your own documentor here:

http://www.informit.com/guides/content.asp?g=sqlserver&seqNum=108&rl=1

If you've found these answers to be helpful, you can mark this thread as "answered". Thanks!

|||IAM Happy we can close this thread

Database Documentation

If someone can provide a good guideline for finding
Database centric documentation, which would include naming
convention, Design & Pattern, Process & Procedure and such.
This guide would be something like MSF, but with more
details in planning, implementation, development,
deployment, maintenance, and troubleshooting.
Thanks in advance.from the Operational side , there is some good stuff in the SQL Ops guide as
per below
http://support.microsoft.com/defaul...kb;en-us;829024
also below, which is based around MSF anyway
http://www.microsoft.com/resources/...se/default.mspx
cheers,
Andy.
"TO" <anonymous@.discussions.microsoft.com> wrote in message
news:143001c48c3a$6214ab10$a601280a@.phx.gbl...
> If someone can provide a good guideline for finding
> Database centric documentation, which would include naming
> convention, Design & Pattern, Process & Procedure and such.
> This guide would be something like MSF, but with more
> details in planning, implementation, development,
> deployment, maintenance, and troubleshooting.
> Thanks in advance.

Database Documentation

Is there a way, or a program or utility out there, that would give me a list
of all the constraints, triggers, indexes, relationships, primary keys,
etc., on an entire database or table, so I don't ahve to go into each table
to find primary keys and indexes.? There are all kinds of tools for this. Any database modeling tool
(including Visio) will have a reverse engineering function to allow this.
You could also look at SQLScribe or something like that.
"Rock" <rockisland@.yahoo.com> wrote in message
news:OfD7$bstEHA.1272@.TK2MSFTNGP12.phx.gbl...
> Is there a way, or a program or utility out there, that would give me a
list
> of all the constraints, triggers, indexes, relationships, primary keys,
> etc., on an entire database or table, so I don't ahve to go into each
table
> to find primary keys and indexes.
>|||I guess I was looking for something free.
"Derrick Leggett" <derrickleggett@.yahoo.com> wrote in message
news:%23fcYsDutEHA.3016@.TK2MSFTNGP12.phx.gbl...
> ? There are all kinds of tools for this. Any database modeling tool
> (including Visio) will have a reverse engineering function to allow this.
> You could also look at SQLScribe or something like that.
>
> "Rock" <rockisland@.yahoo.com> wrote in message
> news:OfD7$bstEHA.1272@.TK2MSFTNGP12.phx.gbl...
> list
> table
>|||If very inexpensive will do...
Consider WT3 - one of the SQL Server Tools applications.
http://www.sqlservertools.us
One of the features is automated generation of database documentation.
"Rock" wrote:

> I guess I was looking for something free.
>
> "Derrick Leggett" <derrickleggett@.yahoo.com> wrote in message
> news:%23fcYsDutEHA.3016@.TK2MSFTNGP12.phx.gbl...
>
>

Database Documentation

I would be interested in hearing what tools people have used to document the
business uses of tables in a database? I have looked at the meta data
services that comes with SQL Server, and while it looks like a good tool, I
do not think that it fits particularly well with what I am looking to
accomplish. I would like to have some documentation that outlines the
business uses of/business rules for each table in the database. Almost an
ERD, but something that discusses/shows information about the business model
that the database/system(s) were constructed to support.
Any advice is appreciated!
TimHello Tim,
This might not be what you are looking for but maybe it can be. I've started
a project which is intended to help people with their network documentation.
The output is to Microsoft word.
The project has two files, one for documenting Servers in general and one
for documenting SQL-Servers. I've just started with the SQL version so there
are a lot of things that can be added.
If you are interested in the project you can find information here:
http://sydi.sourceforge.net
If you want to add feature requests you can do so here:
http://sourceforge.net/tracker/?group_id=116471&atid=674897
Best regards
Patrick
"TimS" <timstspry@.msn.com(donotspam)> wrote in message
news:77AD57C8-C893-41D7-B200-38435DB2D11A@.microsoft.com...
> I would be interested in hearing what tools people have used to document
the
> business uses of tables in a database? I have looked at the meta data
> services that comes with SQL Server, and while it looks like a good tool,
I
> do not think that it fits particularly well with what I am looking to
> accomplish. I would like to have some documentation that outlines the
> business uses of/business rules for each table in the database. Almost an
> ERD, but something that discusses/shows information about the business
model
> that the database/system(s) were constructed to support.
> Any advice is appreciated!
> Tim|||Hi Tim,
Here is what we have done. In our database we have two "extra tables" One
that describes the tables and one that describes individual fields
(columns). The fields table has a foreign key back to the tables table so
that fields can be associated with their proper table. In those tables we
have columns that are used to describe the individual tables and fields.
Things like business rules, uses etc. We then have a set of web pages that
connect to an empty version of the database that has only this meta data
information in it. Everyone can use them to view and update this
information. Each time a new version of the DB comes out we have an
automated process that creates a new empty DB, copies the two tables of meta
data from the existing DB and then updates the metadata tables with the
updates to the schema (updated tables & colums). The existing DB then gets
replaced with the updated DB and the web pages now use this.
Wayne
"TimS" <timstspry@.msn.com(donotspam)> wrote in message
news:77AD57C8-C893-41D7-B200-38435DB2D11A@.microsoft.com...
>I would be interested in hearing what tools people have used to document
>the
> business uses of tables in a database? I have looked at the meta data
> services that comes with SQL Server, and while it looks like a good tool,
> I
> do not think that it fits particularly well with what I am looking to
> accomplish. I would like to have some documentation that outlines the
> business uses of/business rules for each table in the database. Almost an
> ERD, but something that discusses/shows information about the business
> model
> that the database/system(s) were constructed to support.
> Any advice is appreciated!
> Tim|||SchemaToDoc (http://www.schematodoc.com) lets you annotate the tables and
fields in your database. It then lets you export the structure of your
database (tables, fields, indexes, check constraints, foreign key
constraints, and triggers) as well as your annotations to a Word document.
"Patrick Ogenstad" <patrick.ogenstad@.netsafe.se> wrote in message
news:uoeqjdgoEHA.1272@.TK2MSFTNGP09.phx.gbl...
> Hello Tim,
>
> This might not be what you are looking for but maybe it can be. I've
started
> a project which is intended to help people with their network
documentation.
> The output is to Microsoft word.
>
> The project has two files, one for documenting Servers in general and one
> for documenting SQL-Servers. I've just started with the SQL version so
there
> are a lot of things that can be added.
>
> If you are interested in the project you can find information here:
> http://sydi.sourceforge.net
>
> If you want to add feature requests you can do so here:
> http://sourceforge.net/tracker/?group_id=116471&atid=674897
>
> Best regards
> Patrick
>
> "TimS" <timstspry@.msn.com(donotspam)> wrote in message
> news:77AD57C8-C893-41D7-B200-38435DB2D11A@.microsoft.com...
> > I would be interested in hearing what tools people have used to document
> the
> > business uses of tables in a database? I have looked at the meta data
> > services that comes with SQL Server, and while it looks like a good
tool,
> I
> > do not think that it fits particularly well with what I am looking to
> > accomplish. I would like to have some documentation that outlines the
> > business uses of/business rules for each table in the database. Almost
an
> > ERD, but something that discusses/shows information about the business
> model
> > that the database/system(s) were constructed to support.
> >
> > Any advice is appreciated!
> >
> > Tim
>

Database Documentation

If someone can provide a good guideline for finding
Database centric documentation, which would include naming
convention, Design & Pattern, Process & Procedure and such.
This guide would be something like MSF, but with more
details in planning, implementation, development,
deployment, maintenance, and troubleshooting.
Thanks in advance.from the Operational side , there is some good stuff in the SQL Ops guide as
per below
http://support.microsoft.com/default.aspx?scid=kb;en-us;829024
also below, which is based around MSF anyway
http://www.microsoft.com/resources/practices/database/default.mspx
cheers,
Andy.
"TO" <anonymous@.discussions.microsoft.com> wrote in message
news:143001c48c3a$6214ab10$a601280a@.phx.gbl...
> If someone can provide a good guideline for finding
> Database centric documentation, which would include naming
> convention, Design & Pattern, Process & Procedure and such.
> This guide would be something like MSF, but with more
> details in planning, implementation, development,
> deployment, maintenance, and troubleshooting.
> Thanks in advance.

Database Documentation

Is there a way, or a program or utility out there, that would give me a list
of all the constraints, triggers, indexes, relationships, primary keys,
etc., on an entire database or table, so I don't ahve to go into each table
to find primary keys and indexes.? There are all kinds of tools for this. Any database modeling tool
(including Visio) will have a reverse engineering function to allow this.
You could also look at SQLScribe or something like that.
"Rock" <rockisland@.yahoo.com> wrote in message
news:OfD7$bstEHA.1272@.TK2MSFTNGP12.phx.gbl...
> Is there a way, or a program or utility out there, that would give me a
list
> of all the constraints, triggers, indexes, relationships, primary keys,
> etc., on an entire database or table, so I don't ahve to go into each
table
> to find primary keys and indexes.
>|||I guess I was looking for something free.
"Derrick Leggett" <derrickleggett@.yahoo.com> wrote in message
news:%23fcYsDutEHA.3016@.TK2MSFTNGP12.phx.gbl...
> ? There are all kinds of tools for this. Any database modeling tool
> (including Visio) will have a reverse engineering function to allow this.
> You could also look at SQLScribe or something like that.
>
> "Rock" <rockisland@.yahoo.com> wrote in message
> news:OfD7$bstEHA.1272@.TK2MSFTNGP12.phx.gbl...
> > Is there a way, or a program or utility out there, that would give me a
> list
> > of all the constraints, triggers, indexes, relationships, primary keys,
> > etc., on an entire database or table, so I don't ahve to go into each
> table
> > to find primary keys and indexes.
> >
> >
>|||If very inexpensive will do...
Consider WT3 - one of the SQL Server Tools applications.
http://www.sqlservertools.us
One of the features is automated generation of database documentation.
"Rock" wrote:
> I guess I was looking for something free.
>
> "Derrick Leggett" <derrickleggett@.yahoo.com> wrote in message
> news:%23fcYsDutEHA.3016@.TK2MSFTNGP12.phx.gbl...
> > ? There are all kinds of tools for this. Any database modeling tool
> > (including Visio) will have a reverse engineering function to allow this.
> > You could also look at SQLScribe or something like that.
> >
> >
> > "Rock" <rockisland@.yahoo.com> wrote in message
> > news:OfD7$bstEHA.1272@.TK2MSFTNGP12.phx.gbl...
> > > Is there a way, or a program or utility out there, that would give me a
> > list
> > > of all the constraints, triggers, indexes, relationships, primary keys,
> > > etc., on an entire database or table, so I don't ahve to go into each
> > table
> > > to find primary keys and indexes.
> > >
> > >
> >
> >
>
>

Database Documentation

Hi guys, my manager asked me that to do documentation; right now we are using MSSQL SERVER 2005 Databases, here you assume I am new to make documents on any database but good idea about databases currently that data warehouse in development environment need to done this documentation before go on test environment . So that way you advise me to prepare a document.

Here is my main concerned how to start and what things should we keep in mind while preparing document (what are measurements).if you any prepared documents could help to start or there tool we should use (power point) them. any help appreciated

Things to include in DB documentation, and some suggested sources:

1.Server where DB is implemented; SQL Server version used, and required (for example SQL 2005 SP1 because of fix to XXX).

2.Database design - in an ideal world, you should have a ERD for a

database design before the database was created. This may have been

done in an external tool like ERWin, Rational Rose, PowerDesigner etc.

etc. You can also use the Database Diagram tool in Enterprise manager

(sql 2000, not sure about SQL 7.0) or SQL Server Management Studio

(SQL2005) to create these diagrams. The physical DB model (or

design, or ERD, - whatever your preferred name), is, imho, the single

most important piece of documentation about a database;

3. Volumetrics - this is a field on it's own, and one that is often

largely ignored (until a problem occurs!). This is about predicting the

sizing of a database, so as to ensure that the production server has

sufficient capacity when initially created, and sufficient space during

the database life. Since space addition can be a difficult/time

consuming activity (for example, ordering disks, taking server off-line

to add them, or getting drives purchased and added to a SAN and

allocated to the LUNs for you server, if you have a SAN), you really

want to know how much space you need, and when you are going to need

more. There are 2 large sections to this: predictions based on

assumptions, and forecasts made on trend analysis.

- predictions are done during design and creation phase. For example,

the business should have some kind of idea about the viability of a

system. In that, they would, hopefully, have some kind of expectations

regarding usage - for example: We expect 2000 orders a day, typically

of an average of 13.5 products. That already tells us we can expect

2000 rows in our order table, on a daily basis, and 27000 rows in the

OrderItem table. Extrapolation that further, based on 21*12 working

days a year, and we have a prediction of 504 000 rows in the order

table at year end, and 6 804 000 rows in the OrderItem table. This kind

of information can be used to generate an estimated size for the

database, so we can ensure that the database will have enough space on

the brand new server the business bought

- forecasts are done on an on-going basis and are a pro-active measure

by the DBAs in production to determine real growth of a database. So,

after the first month, for example, the dba's note that the ORder table

has 60000 entries, and the Orderitem table has 900 000 rows. Based on

that, they can forecast that the year end sizes will now be 720 000

order rows, and 10 800 000 OrderItems. The goods news is that the

business is doing 42% more orders, at that point in time, that

predicted (see the prediction above), and has sold 58% more Items. They

can use the extra money to buy some disk space, because the forecast

says that at 60000 order per month, the DB is going to be the size that

was predicted for year-end, after less than 9 months (9*60000 = 540 000

> 504 000, for example).

I haven't covered a discussion about the increase in volumes on the

underlying server resources (for example, are the batch jobs able to

finish processing within the agreed SLA's, now that we are doing 2857

orders per day? Do we have periods where this causes excessive load on

the server? These things are NOT (imho) part of a DB document, but they

do flow out of the forecasts that are being done. A final comment on

forecasts above is that, when they are done regularly, you can also do

trend analysis - this is use for technical people - for example, orders

are growing by 10% each month, so in fact that 9 month prediction is

too far away - it needs to be earlier

(60000+66000+72600+79860+87846+96630.6+106293.66=569230 after 7 months).

4. Access - who needs access, to what. For example, Users required, and

which stored procedures they need to execute. Hopefully, there is

little of no dorect table access, but that can also be listed. This can

be done in a matrix in excel:

User -> UserA UserB

Object
TableA - S

TableB - -

SP_1 - Ex

SP_2 - Ex

SP_3 Ex ExGr

SP_4 Ex -

And a key that defines the meanings:

S = Select (D=Delete,U=Update,I=Insert)

Ex = Execute

ExGr = Execute with Grant

etc. etc. These are examples - create as seems relevant.

5. Maintenance. what is the DRP strategy - do you have off-site

backups, how often, are they tested? Do you do regular maintenance (db

indexdefrag's etc) and if so, are they maintenance plans, or specific

jobs?

depending on the target audience for the document (for example someone

using it to rebuild servers in a disaster), you could consider adding

reference to the Source Control system, so that if the database needs

to be rebuilt, they know where to get relevant code.

hmm - well that was off the top of my head. Hopefully it gives you a

good palce to start. I'd be interested to see the additional items

other people suggest.|||

You might want to check out SqlSpec. It will generate documentation for any SQL 2000 or 2005 database. It's very reasonably priced at $50, a fraction of other data dictionary software out there.

see www.elsasoft.org for more info.

|||Interesting. It does seem quite useful and covers much of what I listed|||

You might be interested in checking out dbdesc as well. This tool documents SQL Server databases and you can fully customize its reports as it uses XSL templates to generate the final files. It has built-in templates to generate Word 2003, RTF, HTML, XML and PDF reports.

It was reviewed by Mike Gunderloy (Larkware News) here.

|||

Hi, Geth. Have you gotten everything you need on this subject? If so, you can close the thread, if not, let us know and we'll try to give you some more help.

Buck Woody

|||ERm. I'm happy, but I wasn't the thread starter. Can I cl,ose someone else's thread?|||

You're right! My bad. I'm not sure if you can mark it "happy" or not. I'll ask the right person this time...

|||

Hello - did you get everything you needed? I have some more info on building your own documentor here:

http://www.informit.com/guides/content.asp?g=sqlserver&seqNum=108&rl=1

If you've found these answers to be helpful, you can mark this thread as "answered". Thanks!

|||IAM Happy we can close this thread

Database Documentation

I would be interested in hearing what tools people have used to document the
business uses of tables in a database? I have looked at the meta data
services that comes with SQL Server, and while it looks like a good tool, I
do not think that it fits particularly well with what I am looking to
accomplish. I would like to have some documentation that outlines the
business uses of/business rules for each table in the database. Almost an
ERD, but something that discusses/shows information about the business model
that the database/system(s) were constructed to support.
Any advice is appreciated!
Tim
Hello Tim,
This might not be what you are looking for but maybe it can be. I've started
a project which is intended to help people with their network documentation.
The output is to Microsoft word.
The project has two files, one for documenting Servers in general and one
for documenting SQL-Servers. I've just started with the SQL version so there
are a lot of things that can be added.
If you are interested in the project you can find information here:
http://sydi.sourceforge.net
If you want to add feature requests you can do so here:
http://sourceforge.net/tracker/?grou...71&atid=674897
Best regards
Patrick
"TimS" <timstspry@.msn.com(donotspam)> wrote in message
news:77AD57C8-C893-41D7-B200-38435DB2D11A@.microsoft.com...
> I would be interested in hearing what tools people have used to document
the
> business uses of tables in a database? I have looked at the meta data
> services that comes with SQL Server, and while it looks like a good tool,
I
> do not think that it fits particularly well with what I am looking to
> accomplish. I would like to have some documentation that outlines the
> business uses of/business rules for each table in the database. Almost an
> ERD, but something that discusses/shows information about the business
model
> that the database/system(s) were constructed to support.
> Any advice is appreciated!
> Tim
|||Hi Tim,
Here is what we have done. In our database we have two "extra tables" One
that describes the tables and one that describes individual fields
(columns). The fields table has a foreign key back to the tables table so
that fields can be associated with their proper table. In those tables we
have columns that are used to describe the individual tables and fields.
Things like business rules, uses etc. We then have a set of web pages that
connect to an empty version of the database that has only this meta data
information in it. Everyone can use them to view and update this
information. Each time a new version of the DB comes out we have an
automated process that creates a new empty DB, copies the two tables of meta
data from the existing DB and then updates the metadata tables with the
updates to the schema (updated tables & colums). The existing DB then gets
replaced with the updated DB and the web pages now use this.
Wayne
"TimS" <timstspry@.msn.com(donotspam)> wrote in message
news:77AD57C8-C893-41D7-B200-38435DB2D11A@.microsoft.com...
>I would be interested in hearing what tools people have used to document
>the
> business uses of tables in a database? I have looked at the meta data
> services that comes with SQL Server, and while it looks like a good tool,
> I
> do not think that it fits particularly well with what I am looking to
> accomplish. I would like to have some documentation that outlines the
> business uses of/business rules for each table in the database. Almost an
> ERD, but something that discusses/shows information about the business
> model
> that the database/system(s) were constructed to support.
> Any advice is appreciated!
> Tim
|||SchemaToDoc (http://www.schematodoc.com) lets you annotate the tables and
fields in your database. It then lets you export the structure of your
database (tables, fields, indexes, check constraints, foreign key
constraints, and triggers) as well as your annotations to a Word document.
"Patrick Ogenstad" <patrick.ogenstad@.netsafe.se> wrote in message
news:uoeqjdgoEHA.1272@.TK2MSFTNGP09.phx.gbl...
> Hello Tim,
>
> This might not be what you are looking for but maybe it can be. I've
started
> a project which is intended to help people with their network
documentation.
> The output is to Microsoft word.
>
> The project has two files, one for documenting Servers in general and one
> for documenting SQL-Servers. I've just started with the SQL version so
there[vbcol=seagreen]
> are a lot of things that can be added.
>
> If you are interested in the project you can find information here:
> http://sydi.sourceforge.net
>
> If you want to add feature requests you can do so here:
> http://sourceforge.net/tracker/?grou...71&atid=674897
>
> Best regards
> Patrick
>
> "TimS" <timstspry@.msn.com(donotspam)> wrote in message
> news:77AD57C8-C893-41D7-B200-38435DB2D11A@.microsoft.com...
> the
tool,[vbcol=seagreen]
> I
an
> model
>

Database Documentation

If someone can provide a good guideline for finding
Database centric documentation, which would include naming
convention, Design & Pattern, Process & Procedure and such.
This guide would be something like MSF, but with more
details in planning, implementation, development,
deployment, maintenance, and troubleshooting.
Thanks in advance.
from the Operational side , there is some good stuff in the SQL Ops guide as
per below
http://support.microsoft.com/default...b;en-us;829024
also below, which is based around MSF anyway
http://www.microsoft.com/resources/p...e/default.mspx
cheers,
Andy.
"TO" <anonymous@.discussions.microsoft.com> wrote in message
news:143001c48c3a$6214ab10$a601280a@.phx.gbl...
> If someone can provide a good guideline for finding
> Database centric documentation, which would include naming
> convention, Design & Pattern, Process & Procedure and such.
> This guide would be something like MSF, but with more
> details in planning, implementation, development,
> deployment, maintenance, and troubleshooting.
> Thanks in advance.

Database Documentation

Is there a way, or a program or utility out there, that would give me a list
of all the constraints, triggers, indexes, relationships, primary keys,
etc., on an entire database or table, so I don't ahve to go into each table
to find primary keys and indexes.
? There are all kinds of tools for this. Any database modeling tool
(including Visio) will have a reverse engineering function to allow this.
You could also look at SQLScribe or something like that.
"Rock" <rockisland@.yahoo.com> wrote in message
news:OfD7$bstEHA.1272@.TK2MSFTNGP12.phx.gbl...
> Is there a way, or a program or utility out there, that would give me a
list
> of all the constraints, triggers, indexes, relationships, primary keys,
> etc., on an entire database or table, so I don't ahve to go into each
table
> to find primary keys and indexes.
>
|||I guess I was looking for something free.
"Derrick Leggett" <derrickleggett@.yahoo.com> wrote in message
news:%23fcYsDutEHA.3016@.TK2MSFTNGP12.phx.gbl...
> ? There are all kinds of tools for this. Any database modeling tool
> (including Visio) will have a reverse engineering function to allow this.
> You could also look at SQLScribe or something like that.
>
> "Rock" <rockisland@.yahoo.com> wrote in message
> news:OfD7$bstEHA.1272@.TK2MSFTNGP12.phx.gbl...
> list
> table
>
|||If very inexpensive will do...
Consider WT3 - one of the SQL Server Tools applications.
http://www.sqlservertools.us
One of the features is automated generation of database documentation.
"Rock" wrote:

> I guess I was looking for something free.
>
> "Derrick Leggett" <derrickleggett@.yahoo.com> wrote in message
> news:%23fcYsDutEHA.3016@.TK2MSFTNGP12.phx.gbl...
>
>