Showing posts with label properties. Show all posts
Showing posts with label properties. Show all posts

Sunday, March 11, 2012

Add table to replicated database

How do I add a table to a replicated database using the Enterprise
Manager? I know to use the Publications properties to add a column,
but want to be sure to add a table correctly.
It's the same dialog box. Click the checkbox to show unpublished articles
and then select the table. In this sense it is different to adding a column,
as the table must already exist. After that, run the snapshot agent to
create the bcp files for the table. If the publication is a merge one, a
complete snapshot is created although only the new table will be used. On
synchronization, just the new article will be sent to the subscriber.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Thursday, February 9, 2012

actual space used in data file

Hi all,
I'm having a problem need your help:
I can see all properties of datafile (FilegroupName, FileID, FileType,
Location, CurrentSize, Space Used) by Enterpise Manager.
Please tell me how do I see all those properties by SQL Query Analyzer.
I want to know actual space used in data file to shrink file.
Thanks in advanced,
TN
sp_helpdb <your db>
can give you alot of this info
"TN" <TN@.discussions.microsoft.com> wrote in message
news:A86BD7C1-BC03-4163-80C9-EFB6A688D0B3@.microsoft.com...
> Hi all,
> I'm having a problem need your help:
> I can see all properties of datafile (FilegroupName, FileID, FileType,
> Location, CurrentSize, Space Used) by Enterpise Manager.
> Please tell me how do I see all those properties by SQL Query Analyzer.
> I want to know actual space used in data file to shrink file.
> Thanks in advanced,
> TN
|||Thanks for your help.
But this Proc does not tell me space used in data file.
I can see space used in data file
right click on DB
select All Tasks menu item
select Shrink Database..
click Files button
I can see all
I want to know like this in SQL Query Analyzer
Thanks
TN
"Armando Prato" wrote:

> sp_helpdb <your db>
> can give you alot of this info
> "TN" <TN@.discussions.microsoft.com> wrote in message
> news:A86BD7C1-BC03-4163-80C9-EFB6A688D0B3@.microsoft.com...
>
>
|||Enterprise Mangler uses an undocumented DBCC function called DBCC
SHOWFILESTATS. You will need to build a tool around it if you want more
than absolute bare-bones information.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"TN" <TN@.discussions.microsoft.com> wrote in message
news:305ECE55-D52D-4326-995C-221F8EE005D2@.microsoft.com...[vbcol=seagreen]
> Thanks for your help.
> But this Proc does not tell me space used in data file.
> I can see space used in data file
> right click on DB
> select All Tasks menu item
> select Shrink Database..
> click Files button
> I can see all
> I want to know like this in SQL Query Analyzer
> Thanks
> TN
> "Armando Prato" wrote:
Analyzer.[vbcol=seagreen]
|||Use profiler - you can see exactly what queries EM uses to do this.
"TN" <TN@.discussions.microsoft.com> wrote in message
news:305ECE55-D52D-4326-995C-221F8EE005D2@.microsoft.com...[vbcol=seagreen]
> Thanks for your help.
> But this Proc does not tell me space used in data file.
> I can see space used in data file
> right click on DB
> select All Tasks menu item
> select Shrink Database..
> click Files button
> I can see all
> I want to know like this in SQL Query Analyzer
> Thanks
> TN
> "Armando Prato" wrote:
Analyzer.[vbcol=seagreen]
|||Thanks Scott,
I do not know what is profiler.
Please tell me how to use this tool.
Thanks
TN
"Scott Morris" wrote:

> Use profiler - you can see exactly what queries EM uses to do this.
> "TN" <TN@.discussions.microsoft.com> wrote in message
> news:305ECE55-D52D-4326-995C-221F8EE005D2@.microsoft.com...
> Analyzer.
>
>
|||Perhaps now would be a good time to spend a little effort familiarizing
yourself with the tools provided with SQL Server (of which profiler is one).
Each is documented in the SQL Server documentation; the appropriate section
of the documentation can be accessed directly from each application (for
those that are not command-line based) using the Help menu. In addition,
you can find answers to many basic and advanced questions by searching the
index or by searching the documentation just by guessing with appropriate
words. The online documentation shipped with SQL server is generally
referred to as BOL in the newsgroups (Books OnLine - which is the text of
the corresponding item in the Start menu).
"TN" <TN@.discussions.microsoft.com> wrote in message
news:E10E2A99-F3FF-4E90-A253-EBE562FD1393@.microsoft.com...[vbcol=seagreen]
> Thanks Scott,
> I do not know what is profiler.
> Please tell me how to use this tool.
> Thanks
> TN
> "Scott Morris" wrote:
FileType,[vbcol=seagreen]

actual space used in data file

Hi all,
I'm having a problem need your help:
I can see all properties of datafile (FilegroupName, FileID, FileType,
Location, CurrentSize, Space Used) by Enterpise Manager.
Please tell me how do I see all those properties by SQL Query Analyzer.
I want to know actual space used in data file to shrink file.
Thanks in advanced,
TNsp_helpdb <your db>
can give you alot of this info
"TN" <TN@.discussions.microsoft.com> wrote in message
news:A86BD7C1-BC03-4163-80C9-EFB6A688D0B3@.microsoft.com...
> Hi all,
> I'm having a problem need your help:
> I can see all properties of datafile (FilegroupName, FileID, FileType,
> Location, CurrentSize, Space Used) by Enterpise Manager.
> Please tell me how do I see all those properties by SQL Query Analyzer.
> I want to know actual space used in data file to shrink file.
> Thanks in advanced,
> TN|||Thanks for your help.
But this Proc does not tell me space used in data file.
I can see space used in data file
right click on DB
select All Tasks menu item
select Shrink Database..
click Files button
I can see all
I want to know like this in SQL Query Analyzer
Thanks
TN
"Armando Prato" wrote:

> sp_helpdb <your db>
> can give you alot of this info
> "TN" <TN@.discussions.microsoft.com> wrote in message
> news:A86BD7C1-BC03-4163-80C9-EFB6A688D0B3@.microsoft.com...
>
>|||Enterprise Mangler uses an undocumented DBCC function called DBCC
SHOWFILESTATS. You will need to build a tool around it if you want more
than absolute bare-bones information.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"TN" <TN@.discussions.microsoft.com> wrote in message
news:305ECE55-D52D-4326-995C-221F8EE005D2@.microsoft.com...[vbcol=seagreen]
> Thanks for your help.
> But this Proc does not tell me space used in data file.
> I can see space used in data file
> right click on DB
> select All Tasks menu item
> select Shrink Database..
> click Files button
> I can see all
> I want to know like this in SQL Query Analyzer
> Thanks
> TN
> "Armando Prato" wrote:
>
Analyzer.[vbcol=seagreen]|||Use profiler - you can see exactly what queries EM uses to do this.
"TN" <TN@.discussions.microsoft.com> wrote in message
news:305ECE55-D52D-4326-995C-221F8EE005D2@.microsoft.com...[vbcol=seagreen]
> Thanks for your help.
> But this Proc does not tell me space used in data file.
> I can see space used in data file
> right click on DB
> select All Tasks menu item
> select Shrink Database..
> click Files button
> I can see all
> I want to know like this in SQL Query Analyzer
> Thanks
> TN
> "Armando Prato" wrote:
>
Analyzer.[vbcol=seagreen]|||Thanks Scott,
I do not know what is profiler.
Please tell me how to use this tool.
Thanks
TN
"Scott Morris" wrote:

> Use profiler - you can see exactly what queries EM uses to do this.
> "TN" <TN@.discussions.microsoft.com> wrote in message
> news:305ECE55-D52D-4326-995C-221F8EE005D2@.microsoft.com...
> Analyzer.
>
>|||Perhaps now would be a good time to spend a little effort familiarizing
yourself with the tools provided with SQL Server (of which profiler is one).
Each is documented in the SQL Server documentation; the appropriate section
of the documentation can be accessed directly from each application (for
those that are not command-line based) using the Help menu. In addition,
you can find answers to many basic and advanced questions by searching the
index or by searching the documentation just by guessing with appropriate
words. The online documentation shipped with SQL server is generally
referred to as BOL in the newsgroups (Books OnLine - which is the text of
the corresponding item in the Start menu).
"TN" <TN@.discussions.microsoft.com> wrote in message
news:E10E2A99-F3FF-4E90-A253-EBE562FD1393@.microsoft.com...[vbcol=seagreen]
> Thanks Scott,
> I do not know what is profiler.
> Please tell me how to use this tool.
> Thanks
> TN
> "Scott Morris" wrote:
>
FileType,[vbcol=seagreen]

actual space used in data file

Hi all,
I'm having a problem need your help:
I can see all properties of datafile (FilegroupName, FileID, FileType,
Location, CurrentSize, Space Used) by Enterpise Manager.
Please tell me how do I see all those properties by SQL Query Analyzer.
I want to know actual space used in data file to shrink file.
Thanks in advanced,
TNsp_helpdb <your db>
can give you alot of this info
"TN" <TN@.discussions.microsoft.com> wrote in message
news:A86BD7C1-BC03-4163-80C9-EFB6A688D0B3@.microsoft.com...
> Hi all,
> I'm having a problem need your help:
> I can see all properties of datafile (FilegroupName, FileID, FileType,
> Location, CurrentSize, Space Used) by Enterpise Manager.
> Please tell me how do I see all those properties by SQL Query Analyzer.
> I want to know actual space used in data file to shrink file.
> Thanks in advanced,
> TN|||Thanks for your help.
But this Proc does not tell me space used in data file.
I can see space used in data file
right click on DB
select All Tasks menu item
select Shrink Database..
click Files button
I can see all
I want to know like this in SQL Query Analyzer
Thanks
TN
"Armando Prato" wrote:
> sp_helpdb <your db>
> can give you alot of this info
> "TN" <TN@.discussions.microsoft.com> wrote in message
> news:A86BD7C1-BC03-4163-80C9-EFB6A688D0B3@.microsoft.com...
> > Hi all,
> >
> > I'm having a problem need your help:
> >
> > I can see all properties of datafile (FilegroupName, FileID, FileType,
> > Location, CurrentSize, Space Used) by Enterpise Manager.
> >
> > Please tell me how do I see all those properties by SQL Query Analyzer.
> > I want to know actual space used in data file to shrink file.
> >
> > Thanks in advanced,
> > TN
>
>|||Enterprise Mangler uses an undocumented DBCC function called DBCC
SHOWFILESTATS. You will need to build a tool around it if you want more
than absolute bare-bones information.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"TN" <TN@.discussions.microsoft.com> wrote in message
news:305ECE55-D52D-4326-995C-221F8EE005D2@.microsoft.com...
> Thanks for your help.
> But this Proc does not tell me space used in data file.
> I can see space used in data file
> right click on DB
> select All Tasks menu item
> select Shrink Database..
> click Files button
> I can see all
> I want to know like this in SQL Query Analyzer
> Thanks
> TN
> "Armando Prato" wrote:
> > sp_helpdb <your db>
> >
> > can give you alot of this info
> >
> > "TN" <TN@.discussions.microsoft.com> wrote in message
> > news:A86BD7C1-BC03-4163-80C9-EFB6A688D0B3@.microsoft.com...
> > > Hi all,
> > >
> > > I'm having a problem need your help:
> > >
> > > I can see all properties of datafile (FilegroupName, FileID, FileType,
> > > Location, CurrentSize, Space Used) by Enterpise Manager.
> > >
> > > Please tell me how do I see all those properties by SQL Query
Analyzer.
> > > I want to know actual space used in data file to shrink file.
> > >
> > > Thanks in advanced,
> > > TN
> >
> >
> >|||Use profiler - you can see exactly what queries EM uses to do this.
"TN" <TN@.discussions.microsoft.com> wrote in message
news:305ECE55-D52D-4326-995C-221F8EE005D2@.microsoft.com...
> Thanks for your help.
> But this Proc does not tell me space used in data file.
> I can see space used in data file
> right click on DB
> select All Tasks menu item
> select Shrink Database..
> click Files button
> I can see all
> I want to know like this in SQL Query Analyzer
> Thanks
> TN
> "Armando Prato" wrote:
> > sp_helpdb <your db>
> >
> > can give you alot of this info
> >
> > "TN" <TN@.discussions.microsoft.com> wrote in message
> > news:A86BD7C1-BC03-4163-80C9-EFB6A688D0B3@.microsoft.com...
> > > Hi all,
> > >
> > > I'm having a problem need your help:
> > >
> > > I can see all properties of datafile (FilegroupName, FileID, FileType,
> > > Location, CurrentSize, Space Used) by Enterpise Manager.
> > >
> > > Please tell me how do I see all those properties by SQL Query
Analyzer.
> > > I want to know actual space used in data file to shrink file.
> > >
> > > Thanks in advanced,
> > > TN
> >
> >
> >|||Thanks Scott,
I do not know what is profiler.
Please tell me how to use this tool.
Thanks
TN
"Scott Morris" wrote:
> Use profiler - you can see exactly what queries EM uses to do this.
> "TN" <TN@.discussions.microsoft.com> wrote in message
> news:305ECE55-D52D-4326-995C-221F8EE005D2@.microsoft.com...
> > Thanks for your help.
> > But this Proc does not tell me space used in data file.
> > I can see space used in data file
> >
> > right click on DB
> > select All Tasks menu item
> > select Shrink Database..
> > click Files button
> >
> > I can see all
> >
> > I want to know like this in SQL Query Analyzer
> >
> > Thanks
> > TN
> >
> > "Armando Prato" wrote:
> >
> > > sp_helpdb <your db>
> > >
> > > can give you alot of this info
> > >
> > > "TN" <TN@.discussions.microsoft.com> wrote in message
> > > news:A86BD7C1-BC03-4163-80C9-EFB6A688D0B3@.microsoft.com...
> > > > Hi all,
> > > >
> > > > I'm having a problem need your help:
> > > >
> > > > I can see all properties of datafile (FilegroupName, FileID, FileType,
> > > > Location, CurrentSize, Space Used) by Enterpise Manager.
> > > >
> > > > Please tell me how do I see all those properties by SQL Query
> Analyzer.
> > > > I want to know actual space used in data file to shrink file.
> > > >
> > > > Thanks in advanced,
> > > > TN
> > >
> > >
> > >
>
>|||Perhaps now would be a good time to spend a little effort familiarizing
yourself with the tools provided with SQL Server (of which profiler is one).
Each is documented in the SQL Server documentation; the appropriate section
of the documentation can be accessed directly from each application (for
those that are not command-line based) using the Help menu. In addition,
you can find answers to many basic and advanced questions by searching the
index or by searching the documentation just by guessing with appropriate
words. The online documentation shipped with SQL server is generally
referred to as BOL in the newsgroups (Books OnLine - which is the text of
the corresponding item in the Start menu).
"TN" <TN@.discussions.microsoft.com> wrote in message
news:E10E2A99-F3FF-4E90-A253-EBE562FD1393@.microsoft.com...
> Thanks Scott,
> I do not know what is profiler.
> Please tell me how to use this tool.
> Thanks
> TN
> "Scott Morris" wrote:
> > Use profiler - you can see exactly what queries EM uses to do this.
> >
> > "TN" <TN@.discussions.microsoft.com> wrote in message
> > news:305ECE55-D52D-4326-995C-221F8EE005D2@.microsoft.com...
> > > Thanks for your help.
> > > But this Proc does not tell me space used in data file.
> > > I can see space used in data file
> > >
> > > right click on DB
> > > select All Tasks menu item
> > > select Shrink Database..
> > > click Files button
> > >
> > > I can see all
> > >
> > > I want to know like this in SQL Query Analyzer
> > >
> > > Thanks
> > > TN
> > >
> > > "Armando Prato" wrote:
> > >
> > > > sp_helpdb <your db>
> > > >
> > > > can give you alot of this info
> > > >
> > > > "TN" <TN@.discussions.microsoft.com> wrote in message
> > > > news:A86BD7C1-BC03-4163-80C9-EFB6A688D0B3@.microsoft.com...
> > > > > Hi all,
> > > > >
> > > > > I'm having a problem need your help:
> > > > >
> > > > > I can see all properties of datafile (FilegroupName, FileID,
FileType,
> > > > > Location, CurrentSize, Space Used) by Enterpise Manager.
> > > > >
> > > > > Please tell me how do I see all those properties by SQL Query
> > Analyzer.
> > > > > I want to know actual space used in data file to shrink file.
> > > > >
> > > > > Thanks in advanced,
> > > > > TN
> > > >
> > > >
> > > >
> >
> >
> >

Actual physical file size

Hi Everybody,
I like to compute the actual physical database file size using queries.

From the EM database properties, the file size shown is not matching with the master..sysaltfiles.size

Ex. Actual file size is 12MB and 1MB for MDF & LDF respectively.
'sysaltfiles' shows 1464 & 96 resp. Since they are shoing it as 8K Pages,
96*8 = 768KB is not matching with 1024KB for the LDF file.
Is there any overheads (additional space from the physical file for file headers) allocated?

Thanks
Babuhm odd, I see the same thing. Additionaly, when calculating via sysaltfiles and comparing it with what a 'dir' shows, I have a match. The EM does show the size correctly in the Space allocated (taskpad), but not the Database Size. In my case it's a 4,56 MB off. Detaching the DB didn't change the size on disk either.|||Hi Kaiowas,

So you are getting the computation of sysaltfiles.size*8K pages matching with those of the physical OS file size. There is no difference in your system.
Mine is not matching. Any idea?|||yes, I did size * 8 * 1024 to get a bytesize to compare against a dir/properties of the actual databasefile.